# Math Help - DSP; Difference equation from a transfer function

1. ## DSP; Difference equation from a transfer function

Hi,

This is a question relating to DSP. I wasn't sure what section to put it in. (move it if you so wish)

I have the transfer function:

0.5 - 0.3 z-1
------------- = H(z)
1 + 0.25 z -1

I need to obtain a difference equation ( i.e in the form y(z)= )

My problem is I cant find in text books, or on the web, a simple explanation for converting said transfer function to a difference equation. (please note this is a difference equation not a differential equation).

I found the following link to be the most useful thing so far, (if you explore the site a bit). But I still don't understand how the process is done.
[ http://ccrma.stanford.edu/~jos/fp3/Z_Transform_Difference_Equations.html ]

Thanks for any help anyone can provide,

Bob

2. Originally Posted by 1bob1
Hi,

This is a question relating to DSP. I wasn't sure what section to put it in. (move it if you so wish)

I have the transfer function:

0.5 - 0.3 z-1
------------- = H(z)
1 + 0.25 z -1

I need to obtain a difference equation ( i.e in the form y(z)= )

My problem is I cant find in text books, or on the web, a simple explanation for converting said transfer function to a difference equation. (please note this is a difference equation not a differential equation).

I found the following link to be the most useful thing so far, (if you explore the site a bit). But I still don't understand how the process is done.
[ http://ccrma.stanford.edu/~jos/fp3/Z_Transform_Difference_Equations.html ]

Thanks for any help anyone can provide,

Bob
$H(z)=\frac{0.5-0.3z^{-1}}{1+0.25 z^{-1}}$

Write:

$y(n)=H(z)x(n)$

or:

$(1+0.25 z^{-1})y(n)=(0.5-0.3z^{-1})x(n)$

or:

$y(n)+0.25y(n-1)=0.5x(n)-0.3x(n-1)$

rearranging:

$y(n)=0.5x(n)-0.3x(n-1)-0.25y(n-1)$

That is $z^{-1}$ may be considered to be the unit delay operator.

CB

3. Thanks for that, makes things a bit clearer. I'l keep staring at it, it'l click soon.

4. ## DSP: difference equation to Z-domain transfer function to bode plot

I've implemented a filter in a DSP and now wish to get its bode plot. I need some help determining first the z-domain transfer function (I've done this once but would like a second opinion), and then I would like to get a bode plot from that transfer function - how do I do this?

Thanks Dave

The difference equation is:-

y(n) = [ intError(n-1) + { Igain }{ x(n) } ] + [ { Pgain }{ x(n) } ]

where

intError(n) = [ intError(n-1) + { Igain }{ x(n) } ]
Igain is a constant
Pgain is a contstant

Originally Posted by CaptainBlack
$H(z)=\frac{0.5-0.3z^{-1}}{1+0.25 z^{-1}}$

Write:

$y(n)=H(z)x(n)$

or:

$(1+0.25 z^{-1})y(n)=(0.5-0.3z^{-1})x(n)$

or:

$y(n)+0.25y(n-1)=0.5x(n)-0.3x(n-1)$

rearranging:

$y(n)=0.5x(n)-0.3x(n-1)-0.25y(n-1)$

That is $z^{-1}$ may be considered to be the unit delay operator.

CB