Discrete Low Pass Filter

31 ビュー (過去 30 日間)
Bleron Kroni
Bleron Kroni 2021 年 9 月 23 日
コメント済み: Mathieu NOE 2021 年 9 月 24 日
Hi people,
I'm trying to modell a discrete low pass filter first order with a discrete time integrator.
I want to filter Frequencies up to 5 Hz.
Filter equation is y(k)= (1-a)*y_(k-1) + a*y_(k) where a is (T_s/(T_f+T_s))
How do I have to chose the T_f and T_s to filter under 5Hz
Thank you

回答 (1 件)

Mathieu NOE
Mathieu NOE 2021 年 9 月 23 日
hello
the a value will give you a cut off frequency of fc if you choose a = 2*pi*fc
  2 件のコメント
Bleron Kroni
Bleron Kroni 2021 年 9 月 23 日
Hi,
you are saying a = (T_s/(T_f+T_s))
and I have to equalize 2*pi*fc = (T_s/(T_f+T_s))
I have to compansate a with T_f (filter )and T_s --> T_f > T_s for lowpass filter
Mathieu NOE
Mathieu NOE 2021 年 9 月 24 日
hello
if you know your sampling rate then T_s is fixed . Now I don't have your T_f definition, but I can show you how the cut off frequency , sampling frequency and a factor are linked together
try this :
fc = 5; % cut off frequency (example)
Fs = 250; % sampling rate ; suggestion, depends of signal attributes
wc = 2*pi*fc / Fs ; % Fs = sampling rate, fc = cut off frequency
a = 1-exp(-wc);
% Filter equation is y(k)= (1-a)*y(k-1) + a*e(k);
% represented in H(z^-1) transfer function
numd = [a 0];
dend = [1 a-1];
freq = logspace(-1,1,200);
[mod,phas] = dbode(numd,dend,1/Fs,2*pi*freq);
figure(1)
semilogx(freq,20*log10(mod));
xlabel('Freq (Hz)');
ylabel('Gain (dB)');
you will see on the graph that the -3 dB cut off point is at fc = 5 Hz
you can of course change Fs and fc to match your needs
all the best

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAnalog Filters についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by