What should the order of my FIR filter be?
22 次查看(过去 30 天)
显示 更早的评论
Dear all,
I'm having difficulty deciidng on the order (labelled as x) of an FIR filter. I am creating speech-shaped noise using audio files with an Nfft = 4096 & a sampling rate = 22050. When doing the following:
FIR = fir2(x,NormFrqs,MagSpect);
If the order is < Nfft (as is suggested), then when subsequently trying to use pwelch:
[spect,frqs]=pwelch(SSN, win_, overlap*Nfft, Nfft, Fs,'power');
Pwelch does not run as the window (ie. hann(Nfft) or rectwin(Nfft)) is greater than the the input sample (noise filtered through the FIR filter). Does anyone know what the solution to this is? I have tried making the order of the filter > Nfft, however, the resulting speech file is has an entirely different duration to the original audio files.
Thank you!
0 个评论
回答(1 个)
Star Strider
2020-3-27
The fir2 function documentation appears to favour even-numbered filter orders. (The only MATLAB functions that I know of that calculate the order for FIR filters are kaiserord and firpmord.) It’s likely best to experiment to determine the lowest filter order that successfully matches the design requirements.
6 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Digital Filter Design 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!