Plot the Intensity and phase of variation of electric field.

15 visualizaciones (últimos 30 días)
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.

Respuesta aceptada

Star Strider
Star Strider el 17 de Feb. de 2020
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 comentarios
dang khoa tran
dang khoa tran el 18 de Feb. de 2020
Ok.
Thank you very much for your time and your suggestion.
Star Strider
Star Strider el 18 de Feb. de 2020
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Spectral Measurements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by