Calculate the frequency range and plot the unwrapped phase spectrum
Show older comments
I am given a DTFT, how can I calculate the frequency range where 65% of the total energy is contained? I did unwrap the phase, but I don't know if it's right(because my unwrapped plot looks the same as original). Can anybody help? I will appreciate it. Here it is my script:
% Read in the numerator and denominator coefficients
num = [0.1323 0.1323*0.1444 -0.1323*0.4519 0.1323*0.1444 0.1323];
den = [1 0.1386 0.8258 0.1393 0.4153];
% Compute the frequency response
w = 0:0.01:2*pi;
h = freqz(num, den, w);
% Plot the frequency response
subplot(2,2,1)
plot(w/pi,real(h));grid
title('Real part')
xlabel('\omega/\pi'); ylabel('Amplitude')
subplot(2,2,2)
plot(w/pi,imag(h));grid
title('Imaginary part')
xlabel('\omega/\pi'); ylabel('Amplitude')
subplot(2,2,3)
plot(w/pi,abs(h));grid
title('Magnitude Spectrum')
xlabel('\omega/\pi'); ylabel('Magnitude')
subplot(2,2,4)
plot(w/pi,angle(h));grid
title('Phase Spectrum')
xlabel('\omega/\pi'); ylabel('Phase, radians')
%unwrapping the phase
unwrap=unwrap(angle(h),0.8);
figure, subplot(211)
plot(w/pi,angle(h));grid
title('Phase spectrum');
xlabel('\omega/\pi'); ylabel('Phase, radians');
subplot(212);
plot(w/pi,unwrap);grid
title('Unwrapped phase spectrum');
xlabel('\omega/\pi'); ylabel('Phase, radians');
2 Comments
Honglei Chen
on 1 May 2012
Phase spectrum should not affect energy calculation. Also, this is a filter, not a signal, so what do you mean by energy?
Jimmy Lei
on 1 May 2012
Accepted Answer
More Answers (0)
Categories
Find more on Spectral Measurements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!