NOTE: This is a "Community" forum. Please be mindful that community members are here to help as part of a community effort. We therefore appreciate your effort in keeping this forum a happy place!

If you have a specific issue (e.g. hardware, failure) and want help from our support team, please use our tech support portal (Support menu - > Contact Us).
Thanks a lot of your help in making a better community.
 Page:1

# TOPIC:

## How calculate biquad coefficients for 6dB filter 5 years 7 months ago #33049

 dreite Offline Platinum Member Posts: 1735 Thank you received: 765 What you're attempting to do is not uncomplicated and could get tedious. Take your time. Regarding the difference in coefficients, I'm not sure what you're referring to. Maybe you could elaborate further? Either utility, if programming the same filter at the same Fs, should generate the same set of coefficients. Yes, b2 and a2 coefficients would be zero in a first-order filter. Dave. Please Log in or Create an account to join the conversation.

## How calculate biquad coefficients for 6dB filter 5 years 1 month ago #35778

• JJ2106
• Offline
• Posts: 106
Sorry to restart this thread after such a long time.
The value computed by All-digital coeffs is the correct one.
I assume you took Fc=500Hz, Fs=48Khz.
If you enter Q=1/2^0.5, you will obtain b0 = 0.954774030661509 which is he final value.
For a quick check , I enclose a model which I wrote, and will give you the exact same value, even though the method is different.
This model also gives you the coefficients for first-order (6dB) filters, except first-order all-pass, wich i haven't included yet.
Please rename the file to ..xls, as this isn't a zipped file.
##### Attachments:
The following user(s) said Thank You: supersteff

## How calculate biquad coefficients for 6dB filter 5 years 3 weeks ago #35892

 supersteff Topic Author Offline New Member Posts: 14 Thank you received: 1 Hi. Nice with a little response. I did evaluate a 1000Hz, 12dB/oct BW High-Pass-filter with a 96000 Hz samplingfrequency, as that is what the PWR-ICE is working with. I guess you get the "same" result for b0 if you use 500 Hz and 48000Hz, two values that are half as much as mine!? I am going to have a look at your spreadsheet. I don't know much about filters and what distinguish them, but i know a bit of math, so that I can improvise a bit and play with things, to find out how it works. But I can not find a way to ask "All-digital-coefs v1.2 " for a 6 dB filter!? "All-digital-coefs v1.2 " only asks for corner frequency, Q and samplingfrequency in the inputsection, and then computes a 2. order filter. Well, thanks for now Steffen Please Log in or Create an account to join the conversation.

## How calculate biquad coefficients for 6dB filter 5 years 3 weeks ago #35895

 supersteff Topic Author Offline New Member Posts: 14 Thank you received: 1 Hi Dave Well, I actually figured out a way to make my filters by copying the bi-quad coefficients from the 2x4 HD plug in (also 96 kHz) and paste them in the PWR-ICE plug in. It is more safe to produce coefficients in a separate plug in, because switching between Basic to Advanced mode in the PWR-ICE Plug in created problems for me. But initially I thought I'd have to use "All digital...." to use the advanced mode in the PWR-ICE plug in. I will still use "All-digital...." to produce bi-quad coefficients for a Linkwitz transform. Steffen Please Log in or Create an account to join the conversation.

## How calculate biquad coefficients for 6dB filter 5 years 3 weeks ago #35909

 JJ2106 Offline Premium Member Posts: 106 Thank you received: 8 Hi Steffen, Here is an htm file which explains how to calculate first order coefficients for an allpass filter. Transposing this for lopass and hipass filters is trivial. JJ Pls: pls rename file xxx.htm before launching it The Bilinear Transform

The bilinear z transform

The bilinear transform is the most popular method of converting analog filter prototypes in the s domain to the z domain so we can implement them as digital filters. The reason we are interested in these s domain filters is that analog filter theory has been around longer than digital filter theory, so we have available to us a number of popular and useful filters in the s domain. The standard biquads used heavily in audio processing are direct implementations from the s domain using the bilinear transform.

The theory of the bilinear transform is well documented in DSP texts and on the web, so rather than spend time going into the theory, we'll cut to the chase and show how to do the transform, using a first order all-pass filter as an example.

The s domain transfer function of a first order all-pass filter is:

H(s) = (1 - s) / (1 + s)

To move to the z domain, we need to substitute for s in terms of z. At the same time, we "pre-warp" the response using the TAN function in order to wrap the infinite s plane onto the circular z plane. The combined substitution is:

s = (1 - z^-1) / (K*(1 + z^-1))
where:

K = TAN (p * Fc / Fs)

Fc is the desired corner frequency, and Fs is the sampling frequency.

Here's our z domain transfer function after substituting for s:

1 - (1 - z^-1) / (K*(1 + z^-1)) H(z) =  1 + (1 - z^-1) / (K*(1 + z^-1))

In order to solve for our filter coefficients, we need to get the equation into the form of a first order polynomial in the numerator (the zero) and another first order polynomial in the denominator (the pole). That is, we need it to look something like this:

b0 + b1*z^-1 H(z) =  a0 + a1*z^-1

We multiply the nominator and the denominator of the substituted transfer function by:

K*(1 + z^-1)

We obtain the following expression:

K*(1 + z^-1) - (1 - z^-1) H(z) =  K*(1 + z^-1) + (1 - z^-1)

We rearrange the numerator and the denominator in descending powers of z to obtain:

(K - 1) + (K + 1)*z^-1 H(z) =  (K + 1) + (K - 1)*z^-1

Our coefficients are now evident:

b0 = K - 1			b1 = K + 1			b2 = 0  a0 = K + 1      		a1 = K - 1       		a2 = 0

Because the (a0) coefficient is associated with y[n], the filter output, we divide everything by (a0) to normalize the filter:

K - 1 b0 =  b1 = 1  			b2 = 0 K + 1 K - 1 a0 = 1				a1 =  a2 = 0 K + 1

## How calculate biquad coefficients for 6dB filter 5 years 3 weeks ago #35910

 JJ2106 Offline Premium Member Posts: 106 Thank you received: 8 I resubmit because the previous version was not readable. Hope it will be better. Hi Steffen, Here is an htm file which explains how to calculate first order coefficients for an allpass filter. Transposing this for lopass and hipass filters is trivial. JJ Pls: pls rename file xxx.htm before launching it The Bilinear Transform

The bilinear z transform

The bilinear transform is the most popular method of converting analog filter prototypes in the s domain to the z domain so we can implement them as digital filters. The reason we are interested in these s domain filters is that analog filter theory has been around longer than digital filter theory, so we have available to us a number of popular and useful filters in the s domain. The standard biquads used heavily in audio processing are direct implementations from the s domain using the bilinear transform.

The theory of the bilinear transform is well documented in DSP texts and on the web, so rather than spend time going into the theory, we'll cut to the chase and show how to do the transform, using a first order all-pass filter as an example.

The s domain transfer function of a first order all-pass filter is:

H(s) = (1 - s) / (1 + s)

To move to the z domain, we need to substitute for s in terms of z. At the same time, we "pre-warp" the response using the TAN function in order to wrap the infinite s plane onto the circular z plane. The combined substitution is:

s = (1 - z^-1) / (K*(1 + z^-1))
where:

K = TAN (p * Fc / Fs)

Fc is the desired corner frequency, and Fs is the sampling frequency.

Here's our z domain transfer function after substituting for s:

H(z) =  [ 1 - (1 - z^-1) / (K*(1 + z^-1))]  /  [1 + (1 - z^-1) / (K*(1 + z^-1))]

In order to solve for our filter coefficients, we need to get the equation into the form of a first order polynomial in the numerator (the zero) and another first order polynomial in the denominator (the pole). That is, we need it to look something like this:

H(z) =   (b0 + b1*z^-1) / (a0 + a1*z^-1)

We multiply the nominator and the denominator of the substituted transfer function by:

K*(1 + z^-1)

We obtain the following expression:

H(z) = [K*(1 + z^-1) - (1 - z^-1)] / [ K*(1 + z^-1) + (1 - z^-1)]

We rearrange the numerator and the denominator in descending powers of z to obtain:

H(z) = [ (K - 1) + (K + 1)*z^-1] / [(K + 1) + (K - 1)*z^-1]

Our coefficients are now evident:

b0 = K - 1 b1 = K + 1 b2 = 0  a0 = K + 1 a1 = K - 1 a2 = 0

Because the (a0) coefficient is associated with y[n], the filter output, we divide everything by (a0) to normalize the filter:

b0= (K - 1) / (K + 1) b1 = 1 b2 = 0  a0 = 1 a1 = (K - 1) / (K + 1) a2 = 0

## How calculate biquad coefficients for 6dB filter 5 years 3 weeks ago #35912

 JJ2106 Offline Premium Member Posts: 106 Thank you received: 8 And now, an htm page for a second order lopass. Again, generalizing to other filter types is trivial, assuming the transfer function in s is known. JJ The Bilinear Transform

The bilinear z transform

The bilinear transform is the most popular method of converting analog filter prototypes in the s domain to the z domain so we can implement them as digital filters. The reason we are interested in these s domain filters is that analog filter theory has been around longer than digital filter theory, so we have available to us a number of popular and useful filters in the s domain. The standard biquads used heavily in audio processing are direct implementations from the s domain using the bilinear transform.

The theory of the bilinear transform is well documented in DSP texts and on the web, so rather than spend time going into the theory, we'll cut to the chase and show how to do the transform, using a second order lowpass filter as an example.

The s domain transfer function of a second order lowpass filter is:

H(s) = 1 / (s^2 + A*s + 1)

where (A) is the damping coefficient, i.e. the inverse of the filter's Q.

To move to the z domain, we need to substitute for s in terms of z. At the same time, we "pre-warp" the response using the TAN function in order to wrap the infinite s plane onto the circular z plane. The combined substitution is:

s = (1 - z^-1) / (K*(1 + z^-1))
where:

K = TAN (p * Fc / Fs)

Fc is the desired corner frequency, and Fs is the sampling frequency.

Here's our z domain transfer function after substituting for s:

H(z) = 1 /[(1 - z^-1)^2 / K^2*(1 +z^-1)^2) +  A*(1 - z^-1) / K*(1 + z^-1)  + 1]

In order to solve for our filter coefficients, we need to get the equation into the form of a second order polynomial in the numerator (the zeroes) and another second order polynomial in the denominator (the poles). That is, we need it to look something like this:

b0 + b1*z^-1 + b2*z^-2 H(z) =  a0 + a1*z^-1 + a2*z^-2

We multiply the nominator and the denominator of the substituted transfer function by:

K^2*(1 + z^-1)^2

We obtain the following expression:

K^2*(1 + z^-1)^2 H(z) =  (1 - z^-1)^2 + A*K*(1 - z^-1)*(1 + z^-1) + K^2*(1 + z^-1)^2

We expand the numerator and the denominator, and rearrange them in descending powers of z to obtain:

K^2 + 2*K^2*z^-1 + K^2*z^-2 H(z) =  (K^2 + A*K + 1) + 2*(K^2 - 1)*z^-1 + (K^2 -A*K + 1)*z^-2

Our coefficients are now evident:

b0 = K^2			b1 = 2*K^2			b2 = K^2  a0 = K^2 + A*K + 1		a1 = 2*(K^2 - 1)		a2 = K^2 - A*K + 1

Because the (a0) coefficient is associated with y[n], the filter output, we divide everything by (a0) to normalize the filter. Here we also note the relationships between the (b) coefficients:

K^2 b0 =  b1 = 2*b0			b2 = b0 K^2 + A*K + 1 2*(K^2 - 1)		     K^2 - A*K + 1 a0 = 1				a1 =  a2 =  K^2 + A*K + 1		     K^2 + A*K + 1

Original article: www.earlevel.com/Digital%20audio/Bilinear.html The following user(s) said Thank You: devteam Please Log in or Create an account to join the conversation.

## How calculate biquad coefficients for 6dB filter 5 years 3 weeks ago #35913

 supersteff Topic Author Offline New Member Posts: 14 Thank you received: 1 Hi JJ2206 Thank you for all that theory and where to find it. I see, my math is a bit rusty by now, so it's a bit over my head. But I think your contribution is a valuable resource for others too. My project is stuck right now, although I have got my digital signal chain up running. At the moment I'm only using one out of 4 channels on each side to drive my Visaton 200 b full range speakers. Steffen Please Log in or Create an account to join the conversation.

## How calculate biquad coefficients for 6dB filter 8 months 2 weeks ago #61315

 Immanuel Clark Offline New Member Posts: 1 Thank you received: 0 Thanks for the explanation. I am currently a university student and in addition to solving such technical issues as we are currently discussing, I am having trouble writing several research papers. It's cool that on the page eduzaurus.com/conclusion-generator/ I found a very high-quality conclusion generator that makes the task of writing a conclusion easier for me. Please Log in or Create an account to join the conversation. Last edit: by Immanuel Clark.
 Page:1
Moderators: devteam