Filtering of 60Hz noise signal - output not expected
19 views (last 30 days)
Show older comments
I'm trying to figure out why this stopband filter to remove 60Hz noise makes things worst.
d=designfilt('bandstopiir','FilterOrder',20','HalfPowerFrequency1',58,'HalfPowerFrequency2',62,'SampleRate',31500);
fvtool(d)
As you can see the response looks like what I would expect. However, upon applying it to my signal, the 60Hz harmonic looks worst:
out = filter(d,SAMPLE);
figure;plot(tt,SAMPLE,'r',tt,out,'b');xlabel('Time (sec)');ylabel('Amplitude (counts');
legend({'SAMPLE','out (filtered)'});
Even the power density plots imply that the 60Hz signal and surrounding frequencies were actually amplified:
[pSAMPLE,fSAMPLE]=periodogram(SAMPLE,[],length(SAMPLE),31500);
[pOut,fOut]=periodogram(out, [], length(out), 31500);
figure;plot(fSAMPLE,20*log10(abs(pSAMPLE)),'r',fOut,20*log10(abs(pOut)),'b');xlabel('Frequency (Hz)');ylabel('dB')
Now admittedly, I'm very new to DSP processing. But, can anyone point out what I'm doing wrong? Shouldn't the periodogram of the filtered signal essentially be SAMPLE's periodogram multipled by the filter (fvtool) response? Thanks for any help! -Scott
0 Comments
Accepted Answer
Star Strider
on 6 Feb 2016
Your filter order may be too high. I would use the 60 Hz notch filter example in the documentation: Remove the 60 Hz Hum from a Signal.
4 Comments
Star Strider
on 6 Feb 2016
My pleasure!
I learnt about filtfilt a while ago when I tried to design a Gaussian filter (phase-neutral analog design) only to learn that it was not phase-neutral as a discrete filter, and that filtfilt made all discrete filters phase-neutral. In my (admittedly not humble) opinion, filtfilt is a huge bonus in getting the Signal Processing Toolbox, and worth getting it for filtfilt alone!
More Answers (0)
See Also
Categories
Find more on Digital Filtering in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!