How to do digital filtering in Matlab with a specified cut off frequency?
Mostra commenti meno recenti
Hello all,
I am relatively new in Matlab for doing signal processing.
I have a time series of 30 min duration having the sampling frequency of 10 Hz. So I have 18000 points in the time series and and the highest resolvable frequency of 5Hz. Now in order to avoid the high frequency noise , I want to eliminate all the frequency above 2 Hz using the FFT.
In order to do that shall I take the FFT of the time-series in Matlab and then put zero for all the complex coefficients above 2 Hz and then take the Inverse FFT of that? Will by doing this I will eliminate all the frequency contribution above 2 Hz?
Please help me in this regard. Thanks to all in advance.
Risposta accettata
Più risposte (1)
Chad Greene
il 14 Dic 2015
I wrote a function called filter1 to make frequency filtering a little more user friendly. If your 10 Hz measurements are in an array called y and you want to low-pass filter-out the frequencies higher than 2 Hz, syntax is
y_filt = filter1('lp',y,'fc',2,'fs',10);
where 'lp' means low-pass, 'fc' means cutoff frequency, and 'fs' means sampling frequency.
1 Commento
Pablo Estuardo
il 27 Lug 2020
Modificato: Pablo Estuardo
il 27 Lug 2020
Dear Chad, can you please help me with some problem here...
I have a hourly resolution current velocity time series. So, the sampling interval is 3600 seconds, or 1/3600 hertz, and I want to filter the data in the band of energy between 19 and 22 hours (remove all from 0 to 19 hours and from 22 to 24 hours)
y_filt = filter1('bp',y,'fc',[1/(19*3600) 1/(22*3600)],'fs',1/3600);
But the sonsole send me this error....I will apreciate any suggestions.
Best regards
Categorie
Scopri di più su Butterworth in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!