필터 지우기
필터 지우기

Plot the Intensity and phase of variation of electric field.

조회 수: 8 (최근 30일)
dang khoa tran
dang khoa tran 2020년 2월 17일
댓글: Star Strider 2020년 2월 18일
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
dang khoa tran
dang khoa tran 2020년 2월 18일
Ok.
Thank you very much for your time and your suggestion.
Star Strider
Star Strider 2020년 2월 18일
As always, my pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (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