# Filter coefficient calculation in Sigma studio

Started by February 9, 2010
hi....
i'm currently working on Analog Devices Dsp processor ADAU 1701..
Sigma studio is the software we are now on,in that i have some queries in the way you people calculate filter coefficient.

- main specification we needed to design a filter
1)Type[LPF,HPF, etc]
2)frequency
3)Q
4)Gain

I want a 2nd order LPF with
Frequency= 1000
Q=0.5
Gain=1

The given below derivation is the one which i got from sigma studio help window.

->ω0 = 2*pi*f0/Fs
->gainLinear = 10^(gain/20)

->Lowpass

->Transfer Function
->H(s)=1/(s^2+(s/Q)+1)

->Coefficients
->alpha = sin(ω0)/(2*Q)
->a0 = 1 + alpha
->a1 = -2*cos(ω0)
->a2 = 1 - alpha
->b0 = (1 - cos(ω0)) * gainLinear / 2
->b1 = 1 - cos(ω0) * gainLinear
->b2 = (1 - cos(ω0)) * gainLinear / 2

After compiling we'll get coefficients a1,a2,b0,b1,b2 in hex format in CAPTURE WINDOW of software.
when i did manual calculation using the expression provided in software i'm not getting, proper answer.
with regards
rammya
Howdy Rammya,

I'm betting you have the same answer - but the representation of the
numbers is different. What is the format of the hex output? I've never
used the ADAU 1701, so I don't know how they mash the bits around to get
what they need. But I would think it's in a manual somewhere.

Patience, persistence, truth,
Dr. mike

On Mon, 8 Feb 2010, r...@ymail.com wrote:

> hi....
> i'm currently working on Analog Devices Dsp processor ADAU 1701..
> Sigma studio is the software we are now on,in that i have some queries in the way you people calculate filter coefficient.
>
> - main specification we needed to design a filter
> 1)Type[LPF,HPF, etc]
> 2)frequency
> 3)Q
> 4)Gain
>
> I want a 2nd order LPF with
> Frequency= 1000
> Q=0.5
> Gain=1
>
> The given below derivation is the one which i got from sigma studio help window.
>
> ->ω0 = 2*pi*f0/Fs
> ->gainLinear = 10^(gain/20)
>
> ->Lowpass
>
> ->Transfer Function
> ->H(s)=1/(s^2+(s/Q)+1)
>
> ->Coefficients
> ->alpha = sin(ω0)/(2*Q)
> ->a0 = 1 + alpha
> ->a1 = -2*cos(ω0)
> ->a2 = 1 - alpha
> ->b0 = (1 - cos(ω0)) * gainLinear / 2
> ->b1 = 1 - cos(ω0) * gainLinear
> ->b2 = (1 - cos(ω0)) * gainLinear / 2
> After compiling we'll get coefficients a1,a2,b0,b1,b2 in hex format in CAPTURE WINDOW of software.
> when i did manual calculation using the expression provided in software i'm not getting, proper answer.
> with regards
> rammya
>
Hi, it's me again.

Do not forget to normalize the filters' coefficients (divide them all by a0, then ignore a0 itself since it is an 1.0 internally), and invert the sign for a1 and a2. This is such a common cause of failure!

Regards,

Jaime Andrés Aranguren Cardona
j...@ieee.org
j...@computer.org

________________________________
Von: Mike Rosing
An: r...@ymail.com
CC: a...
Gesendet: Dienstag, den 9. Februar 2010, 15:03:20 Uhr
Betreff: Re: [adsp] Filter coefficient calculation in Sigma studio

Howdy Rammya,

I'm betting you have the same answer - but the representation of the
numbers is different. What is the format of the hex output? I've never
used the ADAU 1701, so I don't know how they mash the bits around to get
what they need. But I would think it's in a manual somewhere.

Patience, persistence, truth,
Dr. mike

On Mon, 8 Feb 2010, rammya_tv@ymail. com wrote:

> hi....
> i'm currently working on Analog Devices Dsp processor ADAU 1701..
> Sigma studio is the software we are now on,in that i have some queries in the way you people calculate filter coefficient.
>
> - main specification we needed to design a filter
> 1)Type[LPF,HPF, etc]
> 2)frequency
> 3)Q
> 4)Gain
>
> I want a 2nd order LPF with
> Frequency= 1000
> Q=0.5
> Gain=1
>
> The given below derivation is the one which i got from sigma studio help window.
>
> ->ω0 = 2*pi*f0/Fs
> ->gainLinear = 10^(gain/20)
>
> ->Lowpass
>
> ->Transfer Function
> ->H(s)=1/(s^ 2+(s/Q)+1)
>
> ->Coefficients
> ->alpha = sin(ω0)/(2*Q)
> ->a0 = 1 + alpha
> ->a1 = -2*cos(ω0)
> ->a2 = 1 - alpha
> ->b0 = (1 - cos(ω0)) * gainLinear / 2
> ->b1 = 1 - cos(ω0) * gainLinear
> ->b2 = (1 - cos(ω0)) * gainLinear / 2
> After compiling we'll get coefficients a1,a2,b0,b1, b2 in hex format in CAPTURE WINDOW of software.
> when i did manual calculation using the expression provided in software i'm not getting, proper answer.
> with regards
> rammya
> ------------ --------- --------- ------
__________________________________________________
Hi,

A couple recent discussion on Analog Devices' EZ (Engineer Zone) will provide you with the aid you need:

Hope this helps,

Jaime Andrés Aranguren Cardona
j...@ieee.org
j...@computer.org

----- Ursprüngliche Mail ----
Von: "r...@ymail.com"
An: a...
Gesendet: Dienstag, den 9. Februar 2010, 5:25:06 Uhr
Betreff: [adsp] Filter coefficient calculation in Sigma studio

hi....
i'm currently working on Analog Devices Dsp processor ADAU 1701..
Sigma studio is the software we are now on,in that i have some queries in the way you people calculate  filter coefficient.

- main specification we needed to design a filter
1)Type[LPF,HPF,  etc]
2)frequency
3)Q
4)Gain

I want a 2nd order LPF with
Frequency= 1000
Q=0.5
Gain=1

The given below derivation is the one which i got from sigma studio help window.

->ω0 = 2*pi*f0/Fs
->gainLinear = 10^(gain/20)

->Lowpass

->Transfer Function
->H(s)=1/(s^2+(s/Q)+1)

->Coefficients
->alpha = sin(ω0)/(2*Q)
->a0 =  1 + alpha
->a1 =  -2*cos(ω0)
->a2 =  1 - alpha
->b0 =  (1 - cos(ω0)) * gainLinear / 2
->b1 =  1 - cos(ω0)  * gainLinear
->b2 =  (1 - cos(ω0)) * gainLinear / 2
After compiling we'll get coefficients a1,a2,b0,b1,b2 in hex format in CAPTURE WINDOW of software.
when i did manual calculation using the expression provided in software i'm not getting, proper answer.
with regards
rammya

_____________________________________

__________________________________________________
Hi Mike, Rammya,

SigmaDSP family from ADI is 28-bit fixed point and uses a 5.23 representation to store numbers; as Mike correctly pointed out there is a manual available when you install the tools, however it is important to read it carefully since is not state-of-the-art documentation, so to say, but surely the guys at ADI are taking good note of that and working hard to improve it.

Nevertheless, it is important to look at the datasheets of the family members' theirselves, since they have quite a lot interestign information on number format and its handling for those small, nice and powerful audio DSP engines.

Regards,

Jaime Andrés Aranguren Cardona
j...@ieee.org
j...@computer.org

________________________________
Von: Mike Rosing
An: r...@ymail.com
CC: a...
Gesendet: Dienstag, den 9. Februar 2010, 15:03:20 Uhr
Betreff: Re: [adsp] Filter coefficient calculation in Sigma studio

Howdy Rammya,

I'm betting you have the same answer - but the representation of the
numbers is different. What is the format of the hex output? I've never
used the ADAU 1701, so I don't know how they mash the bits around to get
what they need. But I would think it's in a manual somewhere.

Patience, persistence, truth,
Dr. mike

On Mon, 8 Feb 2010, rammya_tv@ymail. com wrote:

> hi....
> i'm currently working on Analog Devices Dsp processor ADAU 1701..
> Sigma studio is the software we are now on,in that i have some queries in the way you people calculate filter coefficient.
>
> - main specification we needed to design a filter
> 1)Type[LPF,HPF, etc]
> 2)frequency
> 3)Q
> 4)Gain
>
> I want a 2nd order LPF with
> Frequency= 1000
> Q=0.5
> Gain=1
>
> The given below derivation is the one which i got from sigma studio help window.
>
> ->ω0 = 2*pi*f0/Fs
> ->gainLinear = 10^(gain/20)
>
> ->Lowpass
>
> ->Transfer Function
> ->H(s)=1/(s^ 2+(s/Q)+1)
>
> ->Coefficients
> ->alpha = sin(ω0)/(2*Q)
> ->a0 = 1 + alpha
> ->a1 = -2*cos(ω0)
> ->a2 = 1 - alpha
> ->b0 = (1 - cos(ω0)) * gainLinear / 2
> ->b1 = 1 - cos(ω0) * gainLinear
> ->b2 = (1 - cos(ω0)) * gainLinear / 2
> After compiling we'll get coefficients a1,a2,b0,b1, b2 in hex format in CAPTURE WINDOW of software.
> when i did manual calculation using the expression provided in software i'm not getting, proper answer.