Simple FIR Filtering on some white noise
19 views (last 30 days)
Show older comments
Hi All,
A really stupid question for ya. I appologize in a advance that I am so confused on something this easy.
I am trying to get an FIR lowpass filter to work on some white noise I generated in Audacity. I have already gotten the IIR version of this filter to work using the "butter" command, but I can't seem to get the FIR one to work.
I call in the white noise using "audioread"
[signal,fs] = audioread('white.wav');
Wn = 60/(fs/2); %Cutoff frequency of 60 Hz (normalized)
and then do the following:
%FIR Filter [b_fir,a_fir] = fir1(4,Wn,'high');
signal_fir = filter(b_fir,a_fir,signal);
audiowrite('white_60Hz_fir.wav',signal_fir,fs);
The signal that comes out (signal_fir) doesn't seem to have anything done to it.....
Comments on what I'm doing wrong please.
Thanks in advance
3 Comments
Image Analyst
on 24 Aug 2014
WAJID - that kind of request rarely works. Why don't you read this and then post another question of your own. Reference this post and tell why the answers given here don't work for you. Supply your own data and any background information necessary to let people develop an answer for you.
WAJID
on 24 Aug 2014
in simulink i enter a white noise to a signal but how to filter it by fir filter?
Accepted Answer
Honglei Chen
on 19 Mar 2014
Edited: Honglei Chen
on 19 Mar 2014
Your command
fir1(4,Wn,'high')
designs a highpass instead of a lowpass. Also, for FIRs, I believe fir1 only returns one output, i.e., b_fir. The denominator is always 1 for FIRs, so you could do
filter(b_fir,1,signal)
HTH
5 Comments
Honglei Chen
on 26 Mar 2014
How strong is your signal below 60Hz and how are you comparing the signals? I wouldn't look at the time waveform for this. I would plot the spectrum as well as the filter's frequency response to make sure it is working as expected.
More Answers (0)
See Also
Categories
Find more on Statistics and Linear Algebra in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!