R/E/P Community

Please login or register.

Login with username, password and session length
Advanced search  

Pages: [1]   Go Down

Author Topic: So I have my coefficients - now what do I do?  (Read 3587 times)

locosoundman

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 65
So I have my coefficients - now what do I do?
« on: December 03, 2005, 09:02:33 AM »

I am not an EE, nor do I have a good math background but I am trying to teach myself filter design.  Really - stop laughing.

I worked my way through the transfer function for a Butterworth low-pass filter and have found the proper order for my filter and so forth.  How do I turn these coefficients into an IIR filter?

Thanks in advance for your insights.

Best,
Rob
Logged
What does this little red button do?

bobkatz

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 2926
Re: So I have my coefficients - now what do I do?
« Reply #1 on: December 04, 2005, 01:08:49 PM »

locosoundman wrote on Sat, 03 December 2005 09:02

I am not an EE, nor do I have a good math background but I am trying to teach myself filter design.  Really - stop laughing.

I worked my way through the transfer function for a Butterworth low-pass filter and have found the proper order for my filter and so forth.  How do I turn these coefficients into an IIR filter?

Thanks in advance for your insights.

Best,
Rob



One word: Matlab.

BK
Logged
There are two kinds of fools,
One says-this is old and therefore good.
The other says-this is new and therefore better."

No trees were killed in the sending of this message. However a large number of
electrons were terribly inconvenienced.

locosoundman

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 65
Re: So I have my coefficients - now what do I do?
« Reply #2 on: December 05, 2005, 05:14:55 PM »

Hello all:

Thanks for your reply - I do have Octave, which is like MATLAB.  But my difficulty is getting the translation from analog to digital right.

I am working on a second order low-pass Butterworth filter.  I guess my question is, what do I need to do make the coefficients in the s-domain, which I know how to use to figure out capacitor values, translate into the z-transform function of my IIR?

Maybe it is better said:

If I have 1 / (s^2 + 1.414s + 1) as my transfer function, how will it look within the z-transform:
H(z) = a0z + a1z^-1... / 1+ b1z^-1+ b2z^-2

the carrots showing exponents.

Again, I don't have a great math background so it is probably something really simple that I am just not seeing.  If anyone could just shed some light on the rigt path to go down...

Best,
Rob

Logged
What does this little red button do?

danlavry

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 997
Re: So I have my coefficients - now what do I do?
« Reply #3 on: December 05, 2005, 06:34:31 PM »

locosoundman wrote on Mon, 05 December 2005 22:14

Hello all:

Thanks for your reply - I do have Octave, which is like MATLAB.  But my difficulty is getting the translation from analog to digital right.

I am working on a second order low-pass Butterworth filter.  I guess my question is, what do I need to do make the coefficients in the s-domain, which I know how to use to figure out capacitor values, translate into the z-transform function of my IIR?

Maybe it is better said:

If I have 1 / (s^2 + 1.414s + 1) as my transfer function, how will it look within the z-transform:
H(z) = a0z + a1z^-1... / 1+ b1z^-1+ b2z^-2

the carrots showing exponents.

Again, I don't have a great math background so it is probably something really simple that I am just not seeing.  If anyone could just shed some light on the rigt path to go down...

Best,
Rob




The short answer is - get some good DSP book.

The specific answer is: You need to perform a transformation from the s domain to the z domain. There is more then one way to do that. In your case (and most cases) you need to take your trandsfer function, and do the bilinear transformation as follows:  

Start with
T(s)=1 / (s^2 + 1.414s + 1)

Next you need to figure the 3dB cuttoff frequency, say we call it wp. This fp is the cutoff in the analog domain (wp=2*pi*fp)

Next you need to prewarp the frequency as follows:
Wp=tan(wp*T/2). Pay attention to W (capital) an w (small)

Next you need to substitute Wp for wp as follows:

T(s)=1/ [(s/Wp)^2 +1.414*(s/Wp)+1]

Next substitute s=K*(z-1)/(z+1) for each and every s
That yields a transfer function of z, namely T(z)
Just set K=1 or 2/T

Juggle it around to a form:

T(Z)= (n1+n2*Z^-1+n2*Z^-2)/(1+d1*z^-1+d2*z^-2)

The numerator yields the feedback, the denominator yield the forward coefficients...

But, if you really want to learn, you need a DSP book...

Regards
Dan Lavry
www.lavryengineering.com
Logged

locosoundman

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 65
Re: So I have my coefficients - now what do I do?
« Reply #4 on: December 07, 2005, 09:56:00 AM »

Wow - thanks.  Is there a specific book you would recommend?

Best,
Rob
Logged
What does this little red button do?

Bogic Petrovic

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 73
Re: So I have my coefficients - now what do I do?
« Reply #5 on: December 07, 2005, 12:04:28 PM »

Hi Rob,

locosoundman wrote on Wed, 07 December 2005 15:56

Wow - thanks.  Is there a specific book you would recommend?

Best,
Rob


you can try this one for free:
http://www.dspguide.com/

Best regards

Boggy

locosoundman

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 65
Re: So I have my coefficients - now what do I do?
« Reply #6 on: December 07, 2005, 12:25:29 PM »

"Next substitute s=K*(z-1)/(z+1) for each and every s
That yields a transfer function of z, namely T(z)
Just set K=1 or 2/T

Juggle it around to a form:

T(Z)= (n1+n2*Z^-1+n2*Z^-2)/(1+d1*z^-1+d2*z^-2)"

Here is part of the source of my confusion - is this Z the complex representation of s = a+jb?  In other words - in this case since my poles are at =/-0.707 jb and -.707a would the value of Z in this case be a^2 +/- jb^2?

Best,
Rob
Logged
What does this little red button do?

danlavry

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 997
Re: So I have my coefficients - now what do I do?
« Reply #7 on: December 07, 2005, 02:12:12 PM »

locosoundman wrote on Wed, 07 December 2005 17:25

"Next substitute s=K*(z-1)/(z+1) for each and every s
That yields a transfer function of z, namely T(z)
Just set K=1 or 2/T

Juggle it around to a form:

T(Z)= (n1+n2*Z^-1+n2*Z^-2)/(1+d1*z^-1+d2*z^-2)"

Here is part of the source of my confusion - is this Z the complex representation of s = a+jb?  In other words - in this case since my poles are at =/-0.707 jb and -.707a would the value of Z in this case be a^2 +/- jb^2?

Best,
Rob


Regarding a book, it depends on your "style and orientation".
Some books are very "mathematical", others tend towards the "practical". What is your "style"?

Regarding the question above - Z is not a complex representation of S. The powers of Z represent the transfer function in terms of time delay. Z^-1 represents one "delay segment" T. Z^-2 represents twice that delay (2*T). Z^-n represents n*T delays.

The numerator (n0+n1*Z^-1+n2*Z^-2) represents the forward signal path (just like an FIR filter). Say the input is VI(z)
and the output is VO(z).
The forward path is the sum as follows: n0*VI(z) with no delay + n1*VI(z) with one delay T plus n2*VI(z) with 2 input delay (2*T delay).        
The feedback path is the sum as follows: d1*VO(z) with one delay T plus d2*VO(z) with 2 delay (2*T delay)....

Clearly, the denominator does not have a 0 delay component, because one needs to have at least 1*T to get from the input to output. That is why you juggle the form to scale the first denominator term to be 1.

I really believe that you could use a good DSP book...

Regards
Dan Lavry          
Logged

locosoundman

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 65
Re: So I have my coefficients - now what do I do?
« Reply #8 on: December 08, 2005, 12:35:59 PM »

Thanks Dr. Lavry:

As far as a style of book goes, I probably need to start with a "practical" style and work my way up to a mathematical style.  Since I do not properly understand (or remember) the math, a book that showed a step by step transformation from analog transfer functions (with capacitor and resistor values) to digital transfer functions - FIR and IIR.  If I see it done once step by step with a few different examples, I can get it.

Thanks for your time - and thanks also for the white papers on your website - I have found them to be an excellent "starting point" in trying to understand digital filters.

Best,
Rob
Logged
What does this little red button do?

danlavry

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 997
Re: So I have my coefficients - now what do I do?
« Reply #9 on: December 09, 2005, 01:49:40 PM »

locosoundman wrote on Thu, 08 December 2005 17:35

Thanks Dr. Lavry:

As far as a style of book goes, I probably need to start with a "practical" style and work my way up to a mathematical style.  Since I do not properly understand (or remember) the math, a book that showed a step by step transformation from analog transfer functions (with capacitor and resistor values) to digital transfer functions - FIR and IIR.  If I see it done once step by step with a few different examples, I can get it.

Thanks for your time - and thanks also for the white papers on your website - I have found them to be an excellent "starting point" in trying to understand digital filters.

Best,
Rob


Try to get your hands on:
Digital Signal Processing
A practical Approach
by: Emmanuel Ifeachor and Barrie Jevis
An Addison Wesly publication 54413
(published 1993).

Regards
Dan Lavry
www.lavryengineering.com  
Logged

wa Edwards

  • Newbie
  • *
  • Offline Offline
  • Posts: 35
Re: So I have my coefficients - now what do I do?
« Reply #10 on: December 16, 2005, 03:34:13 PM »

I also like:
"The Scientist and Engineer's guide to Digital Signal Processing" 1998, Steven W. Smith.  

It goes in and out of print, and parts of it have been spotted on the Web.  Try the Analog Devices Website.
Not terribly rigourous on the math, but shows "how it works".  Reading this one made a lot of concepts fall into place.

W
Logged

locosoundman

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 65
Re: So I have my coefficients - now what do I do?
« Reply #11 on: December 17, 2005, 09:49:39 AM »

Thanks again everyone - I do have another question related to the transfer function:

On a higher-order filter, should all of my coefficients sum to 1 (1 = a0 + a1 + a2 + b1 + b2), or does that only hold on first order filters?

Best,
Rob
Logged
What does this little red button do?
Pages: [1]   Go Up
 

Site Hosted By Ashdown Technologies, Inc.

Page created in 0.061 seconds with 19 queries.