# How to manipulate attenuation in Parks MClellan algorithm?

I am using GNU Radio C++ source code in my app (pm_remez()) for generating FIR filters coefficients. Input parameters here are: bands[], des[] and weight[]. How I can manipulate stop band attenuation in pm_remez() function?

The stopband attenuation is controlled indirectly by the relation between passband and stopband weights. A large weight means a small error in the corresponding frequency band. E.g., if the passband weight is $1$ and the stopband weight is $10$, then the approximation error in the stopband will be $10$ times smaller than the approximation error in the passband. The actual value of the error (i.e. passband ripple and stopband attenuation) cannot be prescribed in the original version of the algorithm. The approximation error is an outcome of the algorithm, just like the filter coefficients. The only thing that can be prescribed is the ratio between the errors in the different frequency bands.

• Yep. Thank you. But what can i do if I really need to have for example -80 dB but i got only -50 dB? Google another implemenation of algorithm? – tty6 Mar 12 '15 at 15:12
• @tty6: If a larger passband error can be tolerated, you can increase the stopband weight (this will increase stopband attenuation at the expense of passband ripple). Otherwise, just increase the filter order, which will result in a smaller approximation error. – Matt L. Mar 12 '15 at 15:33