Register to reply

Matlab z-transform Bode plot

by bmalp
Tags: bode, matlab, plot, ztransform
Share this thread:
bmalp
#1
Jan4-07, 03:58 AM
P: 1
Hi,

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
Phys.Org News Partner Science news on Phys.org
World's largest solar boat on Greek prehistoric mission
Google searches hold key to future market crashes
Mineral magic? Common mineral capable of making and breaking bonds
Mesmer
#2
Jan7-07, 09:37 PM
P: 40
Why don't you try this site http://www.kluid.com/. It's pretty much dedicated to matlab :)


Register to reply

Related Discussions
Bode plot axes Electrical Engineering 4
Bode Plot Sketching Engineering, Comp Sci, & Technology Homework 4
Bode plot Electrical Engineering 2
Bode Plot... Plotting Engineering, Comp Sci, & Technology Homework 1
Circuits: Bode Plot Help Engineering, Comp Sci, & Technology Homework 1