HardwareHeaven.com

HardwareHeaven.com

Looking for the skin chooser?
 
 
  • Home

  • Hardware reviews

  • Articles

  • News

  • Tools

  • Gaming at HardwareHeaven

  • Forums

 

Go Back   HardwareHeaven.com > Forums > Hardware and Related Topics > kX Project Audio Driver Support Forum > Effects and the DSP


Reply
 
Thread Tools
Old Jan 23, 2011, 08:34 PM   #1
HardwareHeaven Newbie
 
Join Date: Dec 2009
Location: White Plains, NY
Posts: 17
Rep Power: 0
boris81 is on a distinguished road

Butterworth 3rd order

Hi,
I'm looking to implement a 3rd order Butterworth LowPass and HighPass.
I understand that in order to get a 3rd order filter I need to cascade a 2nd order with a 1st order.
A Q-factor look-up table can be found in this datasheet p58.
http://focus.ti.com/lit/ml/sloa088/sloa088.pdf

KX currently only implements a 2nd order filters. I found the formulas to compute the biquad coefficients for 1st order filters.
Cascade form IIR Filters | Comp.DSP | DSPRelated.com
Quote:
if it's an odd order Butterworth, you'll need an additional 1st order
section:

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


1st order LPF: H(s) = 1/(s+1)

b0 = sin(w0)
b1 = sin(w0)
a0 = cos(w0) + sin(w0) + 1
a1 = sin(w0) - cos(w0) - 1


1st order HPF: H(s) = s/(s+1)

b0 = cos(w0) + 1
b1 = -(cos(w0) + 1)
a0 = cos(w0) + sin(w0) + 1
a1 = sin(w0) - cos(w0) - 1

I've been trying to compute and replace these coefficients into the "EQ Lowpass" filter but I can't get it to work.

Does what I'm trying to do seem right?

I don't quite understand how the "EQ Lowpass" biquad implementation uses the coefficients and I have some questions.

- Are all of the coefficients divided by 2?
- From the EQ-Cookbook a0 = 1 + alpha doesn't come up to 1, does that mean that the rest of the coefficients must be offset by -alpha?
- Can I type decimal fractions into the Dane editor or do I need to convert to hex?
boris81 is offline   Reply With Quote


Old Jan 24, 2011, 12:56 AM   #2
HardwareHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 5,563
Rep Power: 62
Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!

Re: Butterworth 3rd order

I cannot answer all yor questions, but...

Quote:
Originally Posted by boris81 View Post
- Are all of the coefficients divided by 2?
I do not have kX or the SDK installed at the moment, so I cannot look at the code for that plugin, but:
Often a scale factor is used to ensure that the coefficients do not exceed 1 under all possible settings (with filters that have adjustable settings), etc. IIRC, that plugin does use a scale factor of 2 (the coefficients are divided by 2, and then in the DSP, the output of the filter is multiplied by 2 to correct for it).

Quote:
Originally Posted by boris81 View Post
- From the EQ-Cookbook a0 = 1 + alpha doesn't come up to 1, does that mean that the rest of the coefficients must be offset by -alpha?
To normalize, all coefficients should be divided by a0 (i.e. 1 + alpha).
(a0 thus becomes 1, as it is divided by itself)

Note: In some cases, a coefficient might be made negative or positive to work with the DSP instruction that you want to use (where the result would be the same... e.g. (a - b) is the same as (a + (-b)) ).

Quote:
Originally Posted by boris81 View Post
- Can I type decimal fractions into the Dane editor or do I need to convert to hex?
Yes, you can use decimals in the Dane editor.

Last edited by Russ; Jan 24, 2011 at 01:25 AM.
Russ is offline   Reply With Quote
Old Jan 24, 2011, 05:22 PM Threadstarter Thread Starter   #3
HardwareHeaven Newbie
 
Join Date: Dec 2009
Location: White Plains, NY
Posts: 17
Rep Power: 0
boris81 is on a distinguished road

Re: Butterworth 3rd order

Thank you, Russ!

I wasn't able to find the plugin code in the SDK at first. After your comment I was inspired to search harder.

I will probably have some further questions about compiling a *.kxl plugin.
boris81 is offline   Reply With Quote
Reply

Thread Tools