# Calculate Coefficients of Chebyshev and Notch-Filters

Hi everybody,

i have a question about the calculation of Chebyshev or Notch cofficients b0, b1, b2, a1 and a2. Where can i find the calculation? I've been looking in the SigmaStudio-Help but i found nothing about this topic.

Kind Regards

Eric

## Top Replies

Parents
• Can you give math for calculation of coefs. 4 order. like new algo in sigma(chebyshev 1 , chebyshev 2). i download form uc i need to calculate coeffs every tunihg(chenge of freeq...)

Children
•      Hello Alex,

Well here goes.  The best way to handle any four-pole filter with fixed-point math is split the four poles between two biquad (2nd Order) filters.  Thus, given the cutoff frequency, ripple, and gain of the desired filter, all we need is a formula or procedure to provide the corresponding gains, frequencies, and Qs of the biquads.  We already have the formulas for these.  Now, one would think that such info is readily available, but I couldn't find an explicit formula.  What is commonly available are charts that give normalized values for several ripple cases -- but no formula to compute these directly.  You can find such charts in this Analog Devices student publication.  The idea is that students can learn with the charts, while later on they'll end up using a filter design program in practice.  Fine -- but we need the magic that's in these filter design programs, which again I couldn't find.  So what can we do?

I gathered the data from the above reference and ran it through an online cubic curve fitting (regression) algorithm available at Wolfram | Alpha -- www.wolframalpha.com.  This allowed me to generate the spreadsheet attached below, which finds 4th order Type 1 Chebyshev lowpass and highpass coefficients for any allowable frequency and ripple values between 0.01 and 1.0 dB.  Due to this unusual derivation the formulas therein are neither physically significant nor canonical, but they work. The project shown below compares the Nth Order Filter, the two filter stages with Sigma-generated coefficients, and those with the spreadsheet coefficients: The highpass filter works equally well.  The shapes of the curves are identical, but the cutoff frequency doesn't line up because that for the Nth Order Filter is defined as when the ripple ends and the stopband begins, while the student charts my calculations are based upon use the traditional -3 dB point -- you can easily fix this if desired, by sliding the cutoff frequency a bit higher for the LP filter or lower for the HP filter.  You can extract the formulas in the spreadsheet for use in your microcontroller calculations.

Best regards,

Bob

Cheby_demo.zip

Chebyshev_4th-Order.zip

• thanks a lot. it very help me

• look at phase at high pass. something wrong maybe...

• Hello Alex239,

If you are asking about the sharp rise around 100Hz, this is because the signal is so far down in level that there is no signal to measure the phase. Once the signal is at a high enough level to measure the measurement begins. So ignore anything below that point of discontinuity.

Dave T

•      Thanks Dave!  I figured it was some issue with the measurement rather than the filter, since the observed phase discontinuity suggests an infinite, negative group delay at exactly this frequency.  Would this be the case, I would add an oscillator to the project and attempt some serious time travel.  You know where I'd like to go... Best regards,

Bob