ΣSigmaStudio Ask AI Русский Log in

question about "Calculating Filter Coefficients to Store in a Microcontroller"

SigmaDSP & SigmaStudio zhangzq71 Jul 14, 2011 00:00 19 replies Original on forum ↗
Thread Summary

Thread Summary

The user asked how to calculate parameters for Linkwitz-Riley 36 and 48 crossover filters in a device using the ADAU1701 DSP. The final answer explained that Linkwitz-Riley 36 requires 3 sets of 5 coefficients per band (16 total for low-pass), and Linkwitz-Riley 48 requires 4 sets of 5 coefficients per band (20 total for low-pass). The user was directed to the FilterMathCalculations.pdf for specific equations and to use cascaded stages for higher-order filters, with the option to set some coefficients flat for lower-order filters.
AI Generated Content
Subscribe
zhangzq71 Question
Jul 14, 2011 00:00

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

ADIApproved Reply
Jul 25, 2011 00:00

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.

zhangzq71 Reply
Jul 25, 2011 00:00

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

ADIApproved Reply
Aug 3, 2011 00:00

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

zhangzq71 Reply
Aug 4, 2011 00:00

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

ADIApproved Reply
Aug 4, 2011 00:00

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

zhangzq71 Reply
Aug 4, 2011 00:00

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

ADIApproved Reply
Aug 4, 2011 00:00

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

zhangzq71 Reply
Aug 4, 2011 00:00

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

ADIApproved Reply
Aug 4, 2011 00:00

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.

ADIApproved Reply
Aug 4, 2011 00:00

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

zhangzq71 Reply
Aug 4, 2011 00:00

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

ADIApproved Reply
Aug 4, 2011 00:00

You can insert pictures in your post by clicking the photo icon.

You can also attach files like so:

948f62cb09d3e17b5155828c2205ed81.jpg
948f62cb09d3e17b5155828c2205ed81.jpg
948f62cb09d3e17b5155828c2205ed81.jpg-198x105.jpg
948f62cb09d3e17b5155828c2205ed81.jpg-198x105.jpg
b6a03b4194b50e45882287b2dbc6f869.jpg
b6a03b4194b50e45882287b2dbc6f869.jpg
b6a03b4194b50e45882287b2dbc6f869.jpg-317x74.jpg
b6a03b4194b50e45882287b2dbc6f869.jpg-317x74.jpg
zhangzq71 Reply
Aug 5, 2011 00:00

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

dc0609ecf44832e644c3b5bac66c381d.jpg
dc0609ecf44832e644c3b5bac66c381d.jpg
dc0609ecf44832e644c3b5bac66c381d.jpg-450x346.jpg
dc0609ecf44832e644c3b5bac66c381d.jpg-450x346.jpg
a3fa57086fdc11c342cfe60156f9de74.jpg
a3fa57086fdc11c342cfe60156f9de74.jpg
a3fa57086fdc11c342cfe60156f9de74.jpg-450x67.jpg
a3fa57086fdc11c342cfe60156f9de74.jpg-450x67.jpg
e4c990526b8aee74c9c8dc60befd8d51.jpg
e4c990526b8aee74c9c8dc60befd8d51.jpg
e4c990526b8aee74c9c8dc60befd8d51.jpg-450x157.jpg
e4c990526b8aee74c9c8dc60befd8d51.jpg-450x157.jpg
ADIApproved Reply
Aug 5, 2011 00:00

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.

zhangzq71 Reply
Aug 5, 2011 00:00

BrettG,

Thank you very much! I understand now, and will try it next Monday.

Regards,

ZhangZQ

zhangzq71 Reply
Nov 30, 2011 00:00

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

ADIApproved Reply
Dec 14, 2011 00:00

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

con Reply
Sep 27, 2017 00:00

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.

EZAdministrator Reply
Apr 29, 2019 00:00

This question has been closed by the EZ team and is assumed answered.