Plot spectral phase in Mtlab


by snatcos
Tags: fft, fourier transform, spectral phase, unwrap
snatcos
snatcos is offline
#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
A smart prosthetic knee with in-vivo diagnoses
Old tires become material for new and improved roads
Students take clot-buster for a spin

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