Register to reply

Plot spectral phase in Mtlab

Share this thread:
snatcos
#1
Mar12-12, 10:54 AM
P: 4
Hi everyone,

I have this Matlab code :

function PH = testing
close all;
x = [0:1e-3:10-1e-3];
ph = -(x-5).^2;
y = exp(-(x-5).^2./(0.2^2)).*exp(i*2*pi*ph);

Y = fft(y);
Y = fftshift(Y);
PH = angle(Y);
X = (x(2) - x(1))^-1*linspace(0,1,length(x));

figure
plot(x,ph);
figure
plot(X,PH);
end

I build a gaussian curve with quadratic phase and Fourier Transform it. I expect to have a quadratic phase (with opposite sign) in the spectral domain, but I cannot have it correctly. The plot of PH shows jumps between adjacent points. Even using unwrap.m I cannot plot it well.

Thanks in advance for any help
Phys.Org News Partner Engineering news on Phys.org
Hoverbike drone project for air transport takes off
Student develops filter for clean water around the world
Developing the next evolution in underwater communication

Register to reply

Related Discussions
Bode plot: positive phase Engineering, Comp Sci, & Technology Homework 3
Rasterized density plot + countour plot in Mathematica (to solve EPS issues) Math & Science Software 0
Bode Plot Question(Phase and Gain Margin) Engineering, Comp Sci, & Technology Homework 2
Using nullclines to plot phase portraits Differential Equations 0
Bode Phase plot of a second order system Electrical Engineering 4