Register to reply

Plot spectral phase in Mtlab

Share this thread:
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));


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
Tricorder XPRIZE: 10 teams advance in global competition to develop consumer-focused diagnostic device
Study shows local seismic isolation and damping methods provide optimal protection for essential computing equipment
New filter technology uses inert gas to bore holes in high-quality steel

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