1
$\begingroup$

I am trying to filter an audio signal with kaiserord in MATLAB, but I'm having a problem. Here is my code:

fcuts=[50 100 20E+3 20.1E+3];
mags=[0 1 0];
devs=[0.05 0.01 0.05];
[n,Wn,beta,ftype]=kaiserord(fcuts,mags,devs, fs)  %fs from my audio signal
n=n+rem(2);
hh=fir1(n,Wn,ftype,kaiser(n+1, beta),'scale');
filtered=filter(hh,1,W) %W is my audio signal

I try to filter audio with $50\textrm{ Hz}-20\textrm{ kHz}$ bandpass filter but after applying filter; I realize that there is signal before $47\textrm{ Hz}$,

Where is my mistake?

$\endgroup$
0

1 Answer 1

-1
$\begingroup$

Your filter is a stop band attenuation of about 40 dB. Frequencies outside your passband will be attenuated by at least 40 dB but they will not go down all the way to zero.

The FIR filter is very long (2000 or samples). It takes that many samples for the filter to reach "steady state". In other words, you should throw away the first 2000 samples of your filtered signal before doing any analysis on it.

$\endgroup$
3
  • $\begingroup$ Thank you, I add silence to my file, filter this, and finally remove the silent part from file, And the result is ithe same, How can I fix it? $\endgroup$
    – M.Dio
    Commented Jan 20, 2017 at 8:25
  • $\begingroup$ How much 47 Hz are you seeing? $\endgroup$
    – Hilmar
    Commented Jan 20, 2017 at 14:38
  • $\begingroup$ only 1 . What may be the problem? $\endgroup$
    – M.Dio
    Commented Jan 23, 2017 at 5:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.