Using Matlab - plotting frequency responses

AI Thread Summary
The discussion focuses on plotting the log magnitude and phase of the frequency response defined by H(e^(j*omega) = 1 + 1/2*e^(-j*omega) using Matlab's freqz function. The user has attempted to implement this by generating a frequency vector with omega=linspace(0,pi,1024) and calling freqz with coefficients, but is unsure if their approach is correct. They provide a code snippet that includes plotting the absolute value and angle of H, but seek confirmation on its effectiveness. The thread emphasizes the importance of correctly utilizing the freqz function for accurate frequency response visualization. Overall, the discussion highlights common challenges in using Matlab for signal processing tasks.
Rareform
Messages
1
Reaction score
0

Homework Statement



I am asked to plot the log magnitude and phase of the frequency response 1 + 1/2*e^(-j*omega). I am told to use the freqz function for this problem. I have tried using the help freqz feature in Matlab but I haven't been able to work it out.

Homework Equations



H(e^(j*omega) = 1 + 1/2*e^(-j*omega)

H(e^(j*omega) = (e^(j*omega) + 0.5)/(e^(j*omega))


The Attempt at a Solution



omega=linspace(0,pi,1024);
[H,W] = freqz(0.5,1,512);
subplot(2,1,1);
plot(omega,abs(H))
title('Log Magnitude (6.39a)');
subplot(2,1,2);
plot(omega,angle(H))
title('Phase (6.39a)');
 
Physics news on Phys.org
Does this help at all?

http://www.mathworks.com/help/toolbox/signal/freqz.html
 
Last edited by a moderator:
Back
Top