Plot the Intensity and phase of variation of electric field.

12 次查看(过去 30 天)
Hello everyone.
I have a set of data : "y_spectrum" shows the electric field amplitude and "t_spectrum" shows the time.
Is there anyway to plot the Intensity of this variation and its phase?
Also, after doing Fourier transform , is it possible to obtain its distribution and its phase?
Thank you very much.

采纳的回答

Star Strider
Star Strider 2020-2-17
The Fourier transform is easy enough to calculate and plot:
t = dlmread('t_spectrum_11480.txt','',1,0);
E = dlmread('y_spectrum_11480.txt','',1,0);
Fs = 1/mean(diff(t)); % Sampling Frequency
[Er,tr] = resample(E,t,Fs); % Resample To Uniform Sampling Interval
L = numel(t); % Length Of Signal
Fn = Fs/2; % Nyquist Frequency
FT_E = fft(E)/L; % Fourier Transform
Fv = linspace(0,1,fix(L/2)+1)*Fn; % Frequency Vector
Iv = 1:numel(Fv); % Index Vector (One-Sided Spectrum)
figure
plot(tr, Er)
grid
title('Time Dommain')
figure
subplot(2,1,1)
plot(Fv, abs(FT_E(Iv))*2)
grid
ylabel('Amplitude Units')
title('Amplitude')
subplot(2,1,2)
plot(Fv, angle(FT_E(Iv)))
grid
xlabel('Frequency (Hz?)')
ylabel('Radians')
title('Phase')
figure
subplot(2,1,1)
plot(Fv, abs(FT_E(Iv))*2)
grid
ylabel('Amplitude Units')
title('Amplitude')
xlim([0 1E+15])
subplot(2,1,2)
plot(Fv, angle(FT_E(Iv)))
grid
xlabel('Frequency (Hz?)')
ylabel('Radians')
title('Phase')
xlim([0 1E+15])
The first plot is the time domain of the resampled signal, the second is the full Fourier spectrum, and the third is the ‘zoomed’ Fourier spectrum.
  10 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Spectral Measurements 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by