Forums

Frequency response from Z transform

Started by analog_fever June 28, 2010
I am trying to plot the frequency response of a system given its transfer
function. I know about the freqz function in Matlab. The problem is that my
Z transfer function has fractional order term in it.

H(z) = (z^-0.5)*(1-z^-1)*(1-z^-1)

How do I get the frequency response in Matlab?
On 06/28/2010 11:06 AM, analog_fever wrote:
> I am trying to plot the frequency response of a system given its transfer > function. I know about the freqz function in Matlab. The problem is that my > Z transfer function has fractional order term in it. > > H(z) = (z^-0.5)*(1-z^-1)*(1-z^-1) > > How do I get the frequency response in Matlab?
Calculate w = exp(2 * %pi * %i * your_frequency / your_sample_rate) for a number of frequency points. (Note that I'm using Scilab notation for pi and the square root of negative 1) Substitute w for z in your equation above. Enjoy. AFAIK there isn't a built-in function to do this -- you have to actually understand the math, and know how to use Matlab. Given a vector of w values, you should be able to compute h = (w .^ (-0.5)) .* (1 - w .^ (-1)) .* (1 - w .^ (-1)); and get a vector of frequency response values. Note the '.*' and '.^' operators -- those tell Matlab that you want to do the operation element-by element rather than as a matrix operation (which would fail as the vector dimensions are wrong).
On Jun 28, 2:30&#2013266080;pm, Tim Wescott <t...@seemywebsite.com> wrote:
> On 06/28/2010 11:06 AM, analog_fever wrote: > > > I am trying to plot the frequency response of a system given its transfer > > function. I know about the freqz function in Matlab. The problem is that my > > Z transfer function has fractional order term in it. > > > H(z) = (z^-0.5)*(1-z^-1)*(1-z^-1) > > > How do I get the frequency response in Matlab? > > Calculate w = exp(2 * %pi * %i * your_frequency / your_sample_rate) for > a number of frequency points. &#2013266080;(Note that I'm using Scilab notation for > pi and the square root of negative 1) > > Substitute w for z in your equation above. > > Enjoy. > > AFAIK there isn't a built-in function to do this -- you have to actually > understand the math, and know how to use Matlab. &#2013266080;Given a vector of w > values, you should be able to compute > > h = (w .^ (-0.5)) .* (1 - w .^ (-1)) .* (1 - w .^ (-1)); > > and get a vector of frequency response values. &#2013266080;Note the '.*' and '.^' > operators -- those tell Matlab that you want to do the operation > element-by element rather than as a matrix operation (which would fail > as the vector dimensions are wrong).
If the OP is only interested in the magnitude response, the magnitude response will be the same as for G(z) = (1-z^-1)*(1-z^-1) and he can use the tools he is familiar with. The phase response for G would only be off by a linear term corresponding to a delay of 1/2 sample. Dirk
On Jun 29, 6:06&#2013266080;am, "analog_fever" <usu_vlsi@n_o_s_p_a_m.yahoo.com>
wrote:
> I am trying to plot the frequency response of a system given its transfer > function. I know about the freqz function in Matlab. The problem is that my > Z transfer function has fractional order term in it. > > H(z) = (z^-0.5)*(1-z^-1)*(1-z^-1) > > How do I get the frequency response in Matlab?
Remember z=exp(sT) so that z^-0.5 => exp(-0.5jwT) =cos(wtT2)-jsin(wtT2) This has magnitude unity (so it doesn't effect the magnitude plot) and a phase shift of -wT/2 which you can subtract. Now the other two zeros are easy to sketch. when z=1 the mag is zero of course (this is dc).when z=-1 (half sampling) the gain is 4. Hardy Hardy
>On Jun 29, 6:06=A0am, "analog_fever" <usu_vlsi@n_o_s_p_a_m.yahoo.com> >wrote: >> I am trying to plot the frequency response of a system given its
transfer
>> function. I know about the freqz function in Matlab. The problem is that
=
>my >> Z transfer function has fractional order term in it. >> >> H(z) =3D (z^-0.5)*(1-z^-1)*(1-z^-1) >> >> How do I get the frequency response in Matlab? > >Remember z=3Dexp(sT) so that z^-0.5 =3D> exp(-0.5jwT) > >=3Dcos(wtT2)-jsin(wtT2) > >This has magnitude unity (so it doesn't effect the magnitude plot) and >a phase shift of -wT/2 which you can subtract. Now the other two zeros >are easy to sketch. when z=3D1 the mag is zero of course (this is >dc).when z=3D-1 (half sampling) the gain is 4. > > >Hardy > > >Hardy >
Thank you all.