>First and foremost, because a signal cannot have a response.
>
>Systems have responses, but systems are not responses. Responses are
>signals, not systems.
>
By definition - yes. But generally Matlabs freqz returns the Bode plot
correctly. The symbolic solution of the z-transform is correct also. So I
suspect more the evaluation of the signal or "response". I will compare
with a sampled signal instead of a symbolic one.
Reply by Tim Wescott●January 3, 20072007-01-03
bmalp wrote:
> Hi,
>
> below I have two methods to calculate the frequency response of a
> z-transformed sine signal. Neither of them gives the correct amplitude -
> why?
>
> Thanks,
> Bmalp
>
> Hi,
>
> below I have two methods to calculate the frequency response of a
> z-transformed sine signal. Neither of them gives the correct amplitude -
> why?
The z-transform of a sampled sine wave has a pole pair at exp(+ / - j
w0), where w0 is the frequency of the sine wave. Perhaps Matlab has
difficulties returning the value Infinity?
Regards,
Andor
Reply by bmalp●January 3, 20072007-01-03
Hi,
below I have two methods to calculate the frequency response of a
z-transformed sine signal. Neither of them gives the correct amplitude -
why?
Thanks,
Bmalp
function zdemo
format compact
syms w Ts n z phi t
Ts = 1
w = 0.1
phi = 0
vz = simplify(ztrans(sin(w*n*Ts+phi)))
if 0
[num,den] = numden(simplify(vz));
num = collect(num,'z')
den = collect(den,'z')
num1 = sym2poly(num)
den1 = sym2poly(den)
[h,w] = freqz(num1,den1,512,'whole');
else
fs = 1;
f = linspace(0,fs,256);
w = 2*pi*f;
ss = sqrt(-1)*w;
Z = exp(ss/fs);
h = double(subs(vz,z,Z));
end
plot(w,abs(h))