A simple LowPass Filter

조회 수: 43 (최근 30일)
NDKA
NDKA 2012년 5월 4일
편집: ES_Thorny 2019년 2월 25일
Hello everyone, I just want to create a simple Low Pass Filter in the mfile, with a Cut-off frequency of 3Hz and sampling frequency of 100Hz.
My input signal is just an array of [1000x1] i.e. 1000 rows and 1column. And I want to pass this data through a LPF of cutoff freq of 3Hz and fs = 100Hz, and see the output signal.
Can anyone please advice how can I do this? I'm pretty new to matlab and filters. I tried FDAtool and other methods, but they have several no. of filter types, and many more filter parameters. So, its getting difficult for me to understand.
All I want to do is to just allow the signals below 3Hz and reject them above 3Hz using my m-file.
Thank You
  댓글 수: 2
Walter Roberson
Walter Roberson 2012년 5월 4일
Please do not use your email address as a tag. A "tag" should be relevant to the subject category, such as "lowpass filter". Tags are used by people to find other messages that might be of relevance to them.
NDKA
NDKA 2012년 5월 4일
Oh, I completely misunderstand about "tag". Sorry about that, I don't do that again. And thanks for your advice, otherwise I would have not know about this.

댓글을 달려면 로그인하십시오.

채택된 답변

Wayne King
Wayne King 2012년 5월 4일
Do you have the Signal Processing Toolbox?
d = fdesign.lowpass('Fp,Fst,Ap,Ast',3,5,0.5,40,100);
Hd = design(d,'equiripple');
output = filter(Hd,input);
where input is your input signal and output gives the filtered output.
You can use
fvtool(Hd)
to see your filter response and
plot(psd(spectrum.periodogram,output,'Fs',100))
to see the spectrum of your signal aftering filtering.
I've specified 40 dB of attenuation in the above, that may or may not be enough or too much depending on your data.
  댓글 수: 1
NDKA
NDKA 2012년 5월 4일
Wayne,
Thank you very much for your help.I think your code will help me to understand Filter parameters using Matlab environment more easily.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2012년 5월 4일
A "simple" low-pass filter will never have a sharp cut-off at a particular frequency, especially not if it has to be a "streaming" filter. If you do not have any time constraints then you can use the more complex filtering of fft, zeroing coefficients, fft back.
  댓글 수: 1
ES_Thorny
ES_Thorny 2019년 2월 25일
편집: ES_Thorny 2019년 2월 25일
The idea of filtering like that is the most natural. Why is it not commonly used? Just a curiosity ...

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Analog Filters에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by