Matlab first-order low-pass filter

tags: matlab

LPF

First-order low-pass filter
also analyze the air pressure gauge log of the bomber for better comparison

  1. Create a new variable and store the height in itBaroAlt.mat
  2. writeGet height value function
  3. writeLPF function
function output = LPF(x)

persistent lastx Init

if isempty(Init)
  lastx = x;
  Init = 1;
end

alpha = 0.9;
output = alpha*lastx + (1 - alpha)*x;

lastx = output;
  1. Write a call scriptRunLPF.m
clear all
Nsamples = 6800;
Xsaved   = zeros(Nsamples, 1);
Xmsaved  = zeros(Nsamples, 1);
for k=1:Nsamples
  xm = GetAlt();
  x  = LPF(xm);
  Xsaved(k)  = x;
  Xmsaved(k) = xm;
end

dt = 0.02;
t  = 0:dt:Nsamples*dt-dt;

figure
hold on
plot(t, Xmsaved, 'r.');
plot(t, Xsaved, 'b');
legend('Measured', 'LPF')

  1. The experimental results are as follows:

Intelligent Recommendation

Understanding the transfer function of a first-order low-pass filter

The content of the principle of automatic control is very deep and needs to be learned gradually Algorithm implementation of first-order RC filter (low-pass and high-pass) Understanding the transfer f...

First-order low-pass digital filter and its application

table of Contents First-order low-pass analog filter Basic method derivation formula Phase method derivation First-order low-pass digital filter Filter formula derivation Filter example data preparati...

Digital first-order low-pass filter detailed analysis

Article Source: The cause of the incident is as shown in Figure 1. My friend accidentally talked about the first-order low-pass filter, to introduce the principle of the first-order low-pass filter in...

Digital first-order low pass filter Simulink Simulation

Digital first-order low pass filter Simulink Simulation principle Procedure formula Filter coefficient calculation method simulation Construction according to formula Use Simulink self-contained model...

Mathematical Model and Algorithm for First-order RC Low Pass Filter Realization

Mathematical Model and Algorithm for First-order RC Low Pass Filter Realization 1. Successful domain mathematical model of a first-order RC low pass filter 1.1 Derivation of mathematical model 1.2 fre...

More Recommendation

The simple application of first -order low -pass filter in STM32

First of all, look at the simplest first -order low -pass filter circuit model:   It is not difficult to launch its transmission function: TF is related to the frequency of the filter, but the ac...

Stereo analysis of digital first-order low-pass filter

first-order inertia link The combination of an independent energy storage element and an energy dissipation element can constitute an inertial link. The figure below is a common circuit, a first-order...

Matlab model-low pass filter

Low pass filter Check the performance of the filter to eliminate high frequency noise to smooth the signal. The model you will use includes a simulated, noisy signal and a filter that selects low freq...

Matlab design low pass filter

Teach you how to use FDATOOL in matlab to design filters Transfer from: Input: sinusoidal signal polluted by white noise, fs=100khz, signal frequency is 10khz, noise signal is 20khz, now we need to fi...

matlab Butterworth low pass filter

  Result of operation: analysis, the larger the Rp, the larger the amplitude of access Reference ":...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top