I am designing an FIR filter.my specs are fs=300MHz, Fc=45MHz, Fs=75MHz, passband gain=3dB , stopband attn=>40dB. what parameters I values of a have to provide in firpm for the minimum order filter design. I am putting a=[0.01 0.01]. is it correct?


I suppose you want a low pass filter. Such a filter has one passband and one stopband, and accordingly you need an a vector with 4 elements:

  1. the desired magnitude at frequency $0$
  2. the desired magnitude at the passband edge ($f_c$)
  3. the desired magnitude at the stopband edge ($f_s$)
  4. the desired magnitude at Nyquist

If I understood your specs correctly, you should use a = [sqrt(2) sqrt(2) 0 0], and your f vector is f = [0 0.3 0.5 1] because you need to normalize $f_c$ and $f_s$ by the Nyquist frequency $f_s/2=150$MHz. I would suggest you just try some values of n until you reach the desired stopband attenuation. Since you didn't specify any maximum passband ripple, the response in the passband will be fine anyway. If not, you can add a weight vector to trade off maximum passband ripple with stopband attenuation. See the MathWorks documentation on how to do this.

  • $\begingroup$ the passband gain is mentioned but passband ripple is not mentioned in the problem. How can I decide the passband ripple? $\endgroup$ – Jayesh Parmar Oct 13 '14 at 12:01
  • $\begingroup$ I am using dev=[0.01 0.01] (not a=[0.01 0.01], done mistake in question) $\endgroup$ – Jayesh Parmar Oct 13 '14 at 12:04
  • $\begingroup$ I am using a=[1.41 1.41 0 0]. for 40dB attenuation in stopband, deviation shouldn't be 0.01? $\endgroup$ – Jayesh Parmar Oct 13 '14 at 12:06
  • $\begingroup$ @JayeshP: No, because you're approximating the desired value of zero in the stopband. The filter will have ripples in the stopband the maximum amplitude of which will end up being 40dB (after you've found the necessary filter order). $\endgroup$ – Matt L. Oct 13 '14 at 12:09
  • $\begingroup$ okay. what about a=[1.41 1.41 0.01 0.01] ? $\endgroup$ – Jayesh Parmar Oct 13 '14 at 12:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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