Why Does My Z-Transform Bode Plot Show Incorrect Amplitude for a Sine Wave?

Click For Summary
SUMMARY

The forum discussion addresses the issue of incorrect amplitude representation in a Bode plot for a z-transformed sine wave. The user, Bmalp, successfully visualizes the frequency but encounters discrepancies in amplitude. The discussion includes two methods for obtaining the frequency response using MATLAB, specifically the 'freqz' function and symbolic manipulation with 'ztrans'. The problem is attributed to the amplitude scaling in the Bode plot, which requires careful handling of the z-transform output.

PREREQUISITES
  • Understanding of z-transforms and their application in signal processing.
  • Familiarity with MATLAB, particularly the 'ztrans' and 'freqz' functions.
  • Knowledge of Bode plots and their significance in frequency response analysis.
  • Basic concepts of sine wave representation in discrete time systems.
NEXT STEPS
  • Explore MATLAB's 'ztrans' function for different signal types.
  • Learn about amplitude scaling in Bode plots and its implications.
  • Investigate the differences between continuous and discrete frequency response analysis.
  • Study the effects of sampling frequency on the z-transform results.
USEFUL FOR

Signal processing engineers, MATLAB users, and anyone involved in analyzing frequency responses of discrete-time systems will benefit from this discussion.

bmalp
Messages
1
Reaction score
0
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
 
Physics news on Phys.org
Last edited by a moderator:

Similar threads

Replies
5
Views
8K
  • · Replies 4 ·
Replies
4
Views
5K