Hi,(adsbygoogle = window.adsbygoogle || []).push({});

I try to visualize a sine wave, z-transformed in a Bode plot. The frequency shows up correctly, but the amplitude is way off - why?

Thanks for your comments.

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))) % correct

if 0 % method 1

[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 % method 2

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)) % amplitude way too big

**Physics Forums - The Fusion of Science and Community**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Matlab z-transform Bode plot

Loading...

Similar Threads - Matlab transform Bode | Date |
---|---|

Matlab Plotting Coordinate Transformations in Matlab | Feb 12, 2018 |

Matlab Split-step Fourier method | Apr 4, 2016 |

Matlab Matlab syntax for 2-d fourier transform | Mar 21, 2016 |

Matlab Fourier transform of a 2D shape | Mar 21, 2016 |

Using the Fourier Transform on Partitioned Images | Dec 3, 2015 |

**Physics Forums - The Fusion of Science and Community**