Why does spectral phase from the fft of gaussian pulse shows sawteeth?
Show older comments
Hello.
I'm interested in spectral analysis on laser pulse. I made a test code in which gaussian pulse is analyzed in FFT. The analytic answer is that the spectral amplitude is also gaussian profile while spectral phase is all zero.
clear; close all;
% Temporal profile
delta_t = 0.1; % Sampling interval.
t = -90:delta_t:90;
t_p = 35; wavelength = 790E-9; c = 3E8; k = 2*pi/wavelength; w = k*c; w = w*1E-15; % It is Just for getting normalized central frequency. Not imporant for this code.
E_field = exp(-1.38629*(t/t_p).^2).*cos(w*t);
figure(1); subplot(2,2,1); plot(t,E_field); title('Temporal envelope'); xlabel('Time(fs)'); ylabel('E-field');
% Spectral profile
N = 10*length(t); % number of FFT data points is 10 times data points of temporal signal.
spectrum = fft(E_field,N);
frequency = (0:N-1)/(N*delta_t);
figure(1); subplot(2,2,2); plot(frequency,abs(spectrum)); title('Spectrum'); xlabel('frequency(1*10^1^5 Hz)');
% Detailed spectral profile including phase
[pkv,pkl] = max(abs(spectrum(1:fix(N/2)))); % pkl is location of global maxima.
data_width = 50; % Data width over which a left peak is showed in details.
spectral_amplitude = abs(spectrum);
spectral_phase = angle(spectrum);
figure(1); subplot(2,2,3); plot(frequency(pkl - data_width:pkl + data_width),spectral_amplitude(pkl - data_width:pkl + data_width)); title('Detailed spectrum'); xlabel('frequency(1*10^1^5 Hz)'); figure(1);
subplot(2,2,4); plot(frequency(pkl - data_width:pkl + data_width),spectral_phase(pkl - data_width:pkl + data_width)); title('Spectral phase'); xlabel('frequency(1*10^1^5 Hz)'); phase = spectral_phase(pkl)
Number of FFT data points N are far larger than that of temporal signal and is also integral multiple of delta_t (= 1/sampling frequency) to avoid so called leakage problem.
It is found that the amplitude is really good however, phase profile is sawteeth shape far from what I expected.
I believe that there is no reason why phase continuously decreases thus phase jumps are occured.
Is it due to some numerical error? what kind of error should I consider? How can I solve this problem thus exact phase analysis is being made?
Accepted Answer
More Answers (1)
Dong-Gyu Jang
on 16 Aug 2012
Edited: Dong-Gyu Jang
on 3 Feb 2016
1 vote
3 Comments
TheMellow
on 12 May 2014
This is very helpful, thanks! Not sure whether you meant to do this but there is a bracketing error in your code. This is the fixed version:
y(1:mid_t_s) = exp(-1.38629*(t_s(1:mid_t_s)/t_r).^2).*cos(w*t_s(1:mid_t_s));
y(mid_t_s:length(t_s)) = exp(-1.38629*(t_s(mid_t_s:end)/t_f).^2).*cos(w*t_s(mid_t_s:end));
Jonathan
on 2 Feb 2016
The Fig. 1 plotted using this code looks strange.
Dong-Gyu Jang
on 3 Feb 2016
Categories
Find more on Spectral Estimation 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!