What should the order of my FIR filter be?

조회 수: 34 (최근 30일)
Emilia Butters
Emilia Butters 2020년 3월 27일
댓글: Star Strider 2020년 3월 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!

답변 (1개)

Star Strider
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
Emilia Butters
Emilia Butters 2020년 3월 30일
Thank you for your help! I have in fact found the problem which was with the inputs to be pwelch function:
pwelch(x, window, noverlap, Nfft, Fs, 'power')
For the window, I was using hanning(Nfft) instead of hanning(length(data)) so that hanning(Nfft) was virtually always greater than x & prevented pwelch from functioning.
Star Strider
Star Strider 2020년 3월 30일
I appreciate the update.
I will delete my Answer in a few minutes.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Filter Analysis에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by