Simple FIR Filtering on some white noise

19 views (last 30 days)
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
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
WAJID on 24 Aug 2014
in simulink i enter a white noise to a signal but how to filter it by fir filter?

Sign in to comment.

Accepted Answer

Honglei Chen
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
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.
Sushma Chandran
Sushma Chandran on 31 Mar 2014
Since it's white noise the signal is about the same everywhere. I have attached a picture of what's happening. The first one is a picture of the white noise I am creating in audacity. The second one is after I apply my filter. For these pictures I ended up going with 50 Hz HPF. I think everything is working?

Sign in to comment.

More Answers (0)

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!