Numerical Fourier transforms of matrix?
13 views (last 30 days)
Show older comments
Somnath Kale
on 4 May 2022
Commented: Star Strider
on 25 Jun 2022
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!!
0 Comments
Accepted Answer
Star Strider
on 5 May 2022
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.
T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/987480/data.txt');
T1.Properties.VariableNames = {'Signal','Time'}
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 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!