DSPRelated.com
Forums

Small/easy Challenge

Started by niarn September 19, 2013
Working on some other problem the below coefficient expressions popped out
as a byproduct. I'm curious to know if the expressions are (well) known.
Hopefully you don't find it too lame that I post it as a challenge to
derive the expressions. I have no idea how easy it is.

A 3rd order Butterworth lowpass filter, H(z), can be realized as a parallel
connection of two allpass filters, one of order 1 and the other of order 2,
in the following way

H(z) = [A2(z) + A1(z)]/2

         b + z^(-1)                  v + u z^(-1) + z^(-2)
A1(z) = ------------    ,   A2(z) = -----------------------
        1 + b z^(-1)                1 + u z^(-1) + v z^(-2)

if fc is the cutoff frequency in Hz, fs the sample frequency in Hz and K =
1/tan(2*pi*fc/fs/2) can you then show that 

b = (1-K)/(1+K)
u = 2(1-K^2)(1+K)/(K^2+K+1)
v = (K^2-K+1)/(K^2+K+1)

How easy is this?	 

_____________________________		
Posted through www.DSPRelated.com
sounds more like homework than a challenge, and / or an exercise in
comparing coeffcients with a computer algebra system.	 

_____________________________		
Posted through www.DSPRelated.com
On Thursday, September 19, 2013 4:07:14 PM UTC-4, niarn wrote:
> Working on some other problem the below coefficient expressions popped out > > as a byproduct. I'm curious to know if the expressions are (well) known. > > Hopefully you don't find it too lame that I post it as a challenge to > > derive the expressions. I have no idea how easy it is. > > > > A 3rd order Butterworth lowpass filter, H(z), can be realized as a parallel > > connection of two allpass filters, one of order 1 and the other of order 2, > > in the following way > > > > H(z) = [A2(z) + A1(z)]/2 > > > > b + z^(-1) v + u z^(-1) + z^(-2) > > A1(z) = ------------ , A2(z) = ----------------------- > > 1 + b z^(-1) 1 + u z^(-1) + v z^(-2) > > > > if fc is the cutoff frequency in Hz, fs the sample frequency in Hz and K = > > 1/tan(2*pi*fc/fs/2) can you then show that > > > > b = (1-K)/(1+K) > > u = 2(1-K^2)(1+K)/(K^2+K+1) > > v = (K^2-K+1)/(K^2+K+1) > > > > How easy is this? > > > > _____________________________ > > Posted through www.DSPRelated.com
Easy! Use pencil, paper, and partial fraction decomposition. Clay
>Easy! Use pencil, paper, and partial fraction decomposition. > >Clay
Thanks for your input. That is not how I derived the expressions. Then there is another maybe not so easy approach using pencil, paper and solving 3 simultaneous equations in three unknowns. How do you obtain the transfer function on which you perform partial fraction decomposition? _____________________________ Posted through www.DSPRelated.com
On Friday, September 20, 2013 11:42:22 AM UTC-4, niarn wrote:
> >Easy! Use pencil, paper, and partial fraction decomposition. > > > > > >Clay > > > > Thanks for your input. That is not how I derived the expressions. Then > > there is another maybe not so easy approach using pencil, paper and solving > > 3 simultaneous equations in three unknowns. How do you obtain the transfer > > function on which you perform partial fraction decomposition? > > > > _____________________________ > > Posted through www.DSPRelated.com
First of all, you specified a 3rd order Butterworth filter, so that specifies the s eqn (z equ is easy to get from the s equ if you use a bilinear transform). You may look this up or know from analog filter theory that to construct a butterworth filter (3rd order) place 6 poles equally spaced around the entire unit circle with one of the poles on the negative x axis. Then just use the 3 poles on the left hand plane, you create two factors (one linear and the other quadratic) which when multiplied together yield the butter filter transfer function. (we are specifically making the denominator - the numerator is just = 1). Partial fraction decomp allows you to write the factored 3rd order s equation as a sum. Plug in your bilinear transform at this point and reduce the algebra. Simultaneaous equations for 3 unknowns is not hard (just tedious). I had those kinds of problems on more than one final exam. Gaussian elimination or yuck, you can evaluate 6 determinants. These methods should be familiar to engineering students. Clay
On Fri, 20 Sep 2013 11:29:11 -0700, clay wrote:

> On Friday, September 20, 2013 11:42:22 AM UTC-4, niarn wrote: >> >Easy! Use pencil, paper, and partial fraction decomposition. >> >> >> > >> >Clay >> >> >> >> Thanks for your input. That is not how I derived the expressions. Then >> >> there is another maybe not so easy approach using pencil, paper and >> solving >> >> 3 simultaneous equations in three unknowns. How do you obtain the >> transfer >> >> function on which you perform partial fraction decomposition? >> >> >> >> _____________________________ >> >> Posted through www.DSPRelated.com > > First of all, you specified a 3rd order Butterworth filter, so that > specifies the s eqn (z equ is easy to get from the s equ if you use a > bilinear transform). You may look this up or know from analog filter > theory that to construct a butterworth filter (3rd order) place 6 poles > equally spaced around the entire unit circle with one of the poles on > the negative x axis. Then just use the 3 poles on the left hand plane, > you create two factors (one linear and the other quadratic) which when > multiplied together yield the butter filter transfer function. (we are > specifically making the denominator - the numerator is just = 1). > > Partial fraction decomp allows you to write the factored 3rd order s > equation as a sum. Plug in your bilinear transform at this point and > reduce the algebra. > > Simultaneaous equations for 3 unknowns is not hard (just tedious). I had > those kinds of problems on more than one final exam. Gaussian > elimination or yuck, you can evaluate 6 determinants. > > These methods should be familiar to engineering students. > > Clay
It is interesting that it seems to decompose into a pair of all-pass filters. However, actually implementing your lowpass filter as a sum of all-pass filters is practically a written invitation to the Gods of Chaos to hand you back an algorithm that fails miserably at actually achieving a good stop-band. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
>First of all, you specified a 3rd order Butterworth filter, so that
specifi=
>es the s eqn (z equ is easy to get from the s equ if you use a bilinear
tra=
>nsform). You may look this up or know from analog filter theory that to
con=
>struct a butterworth filter (3rd order) place 6 poles equally spaced
around=
> the entire unit circle with one of the poles on the negative x axis. Then
=
>just use the 3 poles on the left hand plane, you create two factors (one
li=
>near and the other quadratic) which when multiplied together yield the
butt=
>er filter transfer function. (we are specifically making the denominator -
=
>the numerator is just =3D 1). > >Partial fraction decomp allows you to write the factored 3rd order s
equati=
>on as a sum. Plug in your bilinear transform at this point and reduce the
a=
>lgebra.
>Simultaneaous equations for 3 unknowns is not hard (just tedious). I had
th=
>ose kinds of problems on more than one final exam. Gaussian elimination or
=
>yuck, you can evaluate 6 determinants. > >These methods should be familiar to engineering students. > >Clay > >
Thanks again for your feedback, very informative. Partial fraction expansion was not on my radar when I made the first post and I'm slightly disappointed that I did not think of that myself. I can't see why it shouldn't give the same result. But be sure that I will check this when I have an empty time slot ;) Just so you know, I derived the result using these lines. Here u1 is the 1st order coefficient and v1 and v2 are the second order coefficients. S contains the expressions. Actually S contains 3 solutions but it is the real solution that I posted. syms a1 a2 a3 u1 v1 v2 syms K positive a3 = (1 - K^3)/(1 + K^3); a2 = 3; a1 = 3*a3; S = solve(u1+v1/v2-a1,1/v2+u1*v1/v2-a2,u1/v2-a3) _____________________________ Posted through www.DSPRelated.com
>It is interesting that it seems to decompose into a pair of all-pass >filters.
Yes it is.
>However, actually implementing your lowpass filter as a sum of all-pass >filters is practically a written invitation to the Gods of Chaos to hand >you back an algorithm that fails miserably at actually achieving a good >stop-band. >
Do you mean due to coefficient quantization? I'm not sure I follow. If its made properly It should give exactly the same stopband attenuation as the non-allpass decomposed form....
>-- > >Tim Wescott >Wescott Design Services >http://www.wescottdesign.com > >
_____________________________ Posted through www.DSPRelated.com
> >However, actually implementing your lowpass filter as a sum of all-pass >filters is practically a written invitation to the Gods of Chaos to hand >you back an algorithm that fails miserably at actually achieving a good >stop-band. >
Why? Whenever possible, I implement all filters using a sum-of-allpass structure. Regular hardware-friendly structure, low coefficient sensitivity, almost no bad fixed-point artifacts regarding data quantization, requires less multiplies...So much easier to deal with than standard SOS! Unfortunately, not all transfer functions are implementable, but standard odd-order lowpass certainly are. _____________________________ Posted through www.DSPRelated.com
On Fri, 20 Sep 2013 15:04:55 -0500, gretzteam wrote:


>>However, actually implementing your lowpass filter as a sum of all-pass >>filters is practically a written invitation to the Gods of Chaos to hand >>you back an algorithm that fails miserably at actually achieving a good >>stop-band. >> >> > Why? Whenever possible, I implement all filters using a sum-of-allpass > structure. Regular hardware-friendly structure, low coefficient > sensitivity, almost no bad fixed-point artifacts regarding data > quantization, requires less multiplies...So much easier to deal with > than standard SOS! Unfortunately, not all transfer functions are > implementable, > but standard odd-order lowpass certainly are. >
OK, I gotta think that through, some time when I'm not on the clock for a customer. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com