|
|
Frequency response from Z transform
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?
|
|
0
|
|
|
|
Reply
|
analog_fever
|
6/28/2010 6:06:30 PM |
|
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).
|
|
0
|
|
|
|
Reply
|
Tim
|
6/28/2010 6:30:12 PM
|
|
On Jun 28, 2:30=A0pm, 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 transf=
er
> > function. I know about the freqz function in Matlab. The problem is tha=
t 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?
>
> Calculate w =3D exp(2 * %pi * %i * your_frequency / your_sample_rate) for
> a number of frequency points. =A0(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. =A0Given a vector of w
> values, you should be able to compute
>
> h =3D (w .^ (-0.5)) .* (1 - w .^ (-1)) .* (1 - w .^ (-1));
>
> and get a vector of frequency response values. =A0Note 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) =3D (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
|
|
0
|
|
|
|
Reply
|
Dirk
|
6/28/2010 7:35:45 PM
|
|
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
|
|
0
|
|
|
|
Reply
|
HardySpicer
|
6/28/2010 8:18:35 PM
|
|
>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.
|
|
0
|
|
|
|
Reply
|
analog_fever
|
6/28/2010 9:52:52 PM
|
|
|
4 Replies
513 Views
(page loaded in 0.096 seconds)
|
|
|
|
|
|
|
|
|