question about "Calculating Filter Coefficients to Store in a Microcontroller"
Brett,
I read your document, https://ez.analog.com/docs/DOC-1819, it seems I can calculate the params for PARAM EQ, but I am also using CROSSOVER, I found the page 8 mention about this, but I don't understand, if I want the params for the "filter type" setting to Linkwitz-Riley 12, how to calculate?
Regards,
ZhangZQ
Hi ZhangZQ,
Sorry for the delayed response; I was in China last week and I did not have much time to check the forum.
Did you check the FilterMathCalculations.pdf file that is attached to the post your linked? On page 6, you'll find the equations for the Linkwitz-Riley 12 filters.
BrettG,
Yes, I can get the correct parameters for Linkwitz-Riley 12 and Linkwitz-Riley 24 now, but still do not understand how to get the Linkwitz-Riley 36 and Linkwitz-Riley 48 parameters. I want to know what is "[HigherOrder] orderindex"?
And I found from the capture windows of sigmastudio that there are more than 5 parameters was sent to ADAU1701 when setting Linkwitz-Riley 36/48. WHY?
Regards,
ZhangZQ
Hi ZhangZQ:
As you probably know already, the filters that you are refering on the crossover require additional filters to create the steeper rolloff in crossover filters. It is those additional filters the ones that you are seing in the data capture window being written.
Does this answer your question?
Miguel
Miguel,
Thank you very much for your answer, but I still don't understand, can you tell me how many parameters will be set when setting Linkwitz-Riley 36?
Regards,
ZhangZQ
HI ZhangZQ:
For a 2 way (high and low) crossover with 24 db/octave you need 2 sets of 5 coefficients per band. Total of 2x2x5 = 20 coefficients.
For a 2 way (high and low) crossover with 36 db/octave you need 3 sets of 5 coefficients per band. Total of 2x3x5 = 30 coefficients.
For a 2 way (high and low) crossover with 48 db/octave you need 4 sets of 5 coeffiicients per band. Total of 2x4x5 = 40 coefficients.
Hope this helps.
Miguel
Miguel,
I found from the capture window of SIGMASTUDIO,
1. when setting Linkwitz-Riley 24(only low), there are 10 coefficients
2. when setting Linkwitz-Riley 36(only low), there are 16 coefficients
3. when setting Linkwitz-Riley 48(only low), there are 20 coefficients
why?
Regards,
ZhangZQ
Hi ZhangZQ:
Here's some explanation on Linkwitz-Riley Fitler.
http://en.wikipedia.org/wiki/Linkwitz-Riley_filter
Can you describe a bit more your application and what your are doing? Perhaps we can help you out some other way?
Hope this helps.
Miguel
Miguel,
I am making a device that using ADAU1701, there is a MCU connects with ADAU1701 via I2C, and there are some key and knob connects to the MCU, some action on the key or knob will cause the MCU set the parameters of the ADAU1701 program. Most of the function had been done and work well, but I don't know how to set the parameter of crossover filter.
When the filter type set to Linkwitz-Riley 12 and Linkwitz-Riley 24, this device work well, but I don't know how to set the parameter when filter type is Linkwitz-Riley 36 or 48.
Regards,
ZhangZQ
Hi ZhangZQ.
It’s important to note that Linkwitz-Riley 12, 24, 36, and 48, are all different filter architectures and therefore have a different program code associated with them. So, by changing between filter types, you’ll not only have to update the parameters, but also the entire program RAM.
The higher-rolloff filters consist of cascaded stages (multiple filters in series), so you have to set parameters for each filter stage.
Hi ZhangZQ:
With some work on your side. You can use the higher order filters (48dB) and set some of the coefficients flat for the case where you need lower order filters (By the way, flat means. Coefficient B0 = 1 and the rest are 0). This way you don't have to create a different schematic and recompile ever time you need to change your crossover slopes. Although this might require some work on you side, I don't think it would be much and your products would be more flexible.
Best regards
Miguel
BrettG,
Can I sent you the email, I can't attach diagram here because I want to attach some diagram to describe my question.
Regards,
ZhangZQ
You can insert pictures in your post by clicking the photo icon.
You can also attach files like so:
BrettG,
I created a application contains a CROSSOVER FILTER, click the icon in the CROSSOVER filter prompt a window
I got this from capture window when changing the filter type to Linkwitz-Riley 12
As you can see, B0, B1, A1 was sent twice, and the MCU can calculate the result of B0, B1, A1 following your document, and the MCU sent the B0, B1, A1 twice as SIGMASTUDIO did, and the ADAU1701 works well.
when I changed the filter type to Linkwitz-Riley 36, I got this from capture window,
as you can see, 8 parameters was sent twice, my question is how to calculate these 8 parameters?
Regards,
ZhangZQ
From page 8 of the design document:
Linkwitz-Riley – 36 dB/oct = 2 cascaded 3rd order butterworths
3rd order butterworth is implemented by cascading a “HigherOrder” + 1st order
1st Filter: [HigherOrder] orderindex = 3, i = 0
2nd Filter: 1st Order Butterworth
3rd Filter: [HigherOrder] orderindex = 3, i = 0
4th Filter: 1st order Butterworth
So, there are 4 filters. The first filter has 5 coefficients, the second filter has 3 coefficients, the third filter has 5 coefficients, and the fourth filter has 3 coefficients.
For the first filter, use the calculations for either LOW PASS HIGHER ORDER or HIGH PASS HIGHER ORDER (these equations are on page 8).
For the second filter, use the calculations for 1st Order Butterworth (these equations are on page 6).
For the third filter, use the calculations for either LOW PASS HIGHER ORDER or HIGH PASS HIGHER ORDER (these equations are on page 8).
For the fourth filter, use the calculations for 1st Order Butterworth (these equations are on page 6).
That will give you 16 total coefficients.
BrettG,
Thank you very much! I understand now, and will try it next Monday.
Regards,
ZhangZQ
BrettG,
How to calculate the coefficents for each "filter type" in crossover filter setting? In your document only show how to calculate the filter type of "Linkwitz", how different for other types?
Regards,
ZhangZQ
Hi ZhangZQ,
I was pulled into several high-priority, time-critical projects at work over the past few weeks and unfortunately I had to de-prioritize my participation in the forum as a result. So, I apologize for making you wait so long for an answer. I am going to try to respond to everybody's questions within the next few days.
The filter types available in the crossover are:
Linkwitz-Riley 12
Linkwitz-Riley 24
Linkwitz-Riley 36
Linkwitz-Riley 48
Butterworth 12
Butterworth 18
Butterworth 24
Bessel 12
Bessel 18
Bessel 24
All of these filters are explained in the FilterMathCalculations.pdf that was provided on the forum.
The Butterworth and Bessel calculations are on page 9.
Message was edited by: BrettG - added details about page number
I have changed a spreadsheet already posted and created another one for different tests,
based on the pdf file posted here, it might help other users who need to calculate more complex filters.
This question has been closed by the EZ team and is assumed answered.
Please log in to reply.









