필터 지우기
필터 지우기

Numerical Fourier transforms of matrix?

조회 수: 3 (최근 30일)
Somnath Kale
Somnath Kale 2022년 5월 4일
댓글: Star Strider 2022년 6월 25일
Hi
I was tryaing for the numerical fourier tranform of the function u(z,t) (real space) where u and z as per the attachments:
The fourier transform u~(q,t) (reciprocal space) is recognised as; u~(q,t) = (I/L)*Integration(dz u(z,t)exp(-iqz)
how can I take care of this?
Thank you in advance!!

채택된 답변

Star Strider
Star Strider 2022년 5월 5일
I have no idea what you want. I would not suggest integrating the individual sine and cosone coefficients using numerical integration. The Fast Fourier Transform calculates the coefficients much more efficiently.
This calculates and plots the fast Fourier transform (fft) of that signal —
T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/987480/data.txt');
T1.Properties.VariableNames = {'Signal','Time'}
T1 = 1024×2 table
Signal Time __________ __________ 3.0967e-06 3.418e-09 3.0967e-06 6.8359e-09 3.0967e-06 1.0254e-08 3.0967e-06 1.3672e-08 3.0967e-06 1.709e-08 3.0967e-06 2.0508e-08 3.0967e-06 2.3926e-08 3.0967e-06 2.7344e-08 3.0967e-06 3.0762e-08 3.0967e-06 3.418e-08 3.0967e-06 3.7598e-08 3.0967e-06 4.1016e-08 3.0967e-06 4.4434e-08 3.0967e-06 4.7852e-08 3.0967e-06 5.127e-08 3.0967e-06 5.4687e-08
figure
plot(T1.Time, T1.Signal)
grid
xlabel('Time')
ylabel('Amplitude')
L = size(T1,1);
Ts = mean(diff(T1.Time)); % Sampling Interval
Fs = 1/Ts; % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
FTSignal = fft(T1.Signal-mean(T1.Signal))/L; % Fourier Transform (Subtract Mean To Emphasize Peaks)
Fv = linspace(0, 1, fix(L/2)+1)*Fn; % Frequency Vector
Iv = 1:numel(Fv); % Index Vector
figure
plot(Fv, abs(FTSignal(Iv))*2)
grid
xlabel('Frequency')
ylabel('Amplitude')
xlim([0 5]*1E+7)
The coefficients of the cosine (real) terms are the real parts of ‘FTSignal’ and the imaginary parts are the coefficients of the sine terms for each frequency in the ‘Fv’ vector.
.
  댓글 수: 6
Somnath Kale
Somnath Kale 2022년 6월 25일
Thank you very much!
Star Strider
Star Strider 2022년 6월 25일
As always, my pleasure!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Discrete Fourier and Cosine Transforms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by