# Real Sequence As Rational Function in e^-jw

1. Feb 15, 2005

### dduardo

Staff Emeritus
How do I convert a piece wise function like this:

y[n]=

{1 -N<=n<=N
{0 otherwise

to something like this:

p0+p1e^(-jw)+...+pMe^(-jwM)
------------------------------
d0+d1e^(-jw)+...+dNe^(-jwN)

Basically, what formula do I need to use to calculate the coeffients?

 I'm trying to use the matlab function FREQZ, but requires the formula to be in the above format.

Last edited: Feb 15, 2005
2. Feb 15, 2005

### learningphysics

Well, that looks the frequency response of a discrete time system.

I might be wrong, but I'd first get the z-transform of your sequence:

z^N + z^(N-1) + z^(N-2) + .....+ 1 + z^(-1) + z^(-2) + ....z^(-(N-1))+z^(-N)

then plug in z=e^(jwdt)

dt is the time between samples.

e^(jwdtN) + e^(jwdt(N-1)) + .....+ 1 + e^(-jwdt) + e(-jwdt2) + .... e^(-jwdtN)

So that would be your numerator, and the denominator is just 1. Is that form acceptable?

Last edited: Feb 15, 2005