calculate psd using fft2 for 2-D matrix
4 views (last 30 days)
Show older comments
I am trying to calculate the PSD using fft2 for 2D matrix, but I am not sure how to calculate the PSD from fft2
I have used the following lines when calculating the PSD for pressure time history data (p) using fft (1-D fast fourier transform)
fs=1/delta_t;
n = length(p);
FFT = fft(p);
FFT= FFT(1:n/2+1);
psd1 = 2*abs(FFT).^2/(n*fs);
f = fs*(0:(n/2))/n;
In case of having the pressure time history as 2-D array, I used fft2 but I not not sure how to calculate PSD
fs=1/delta_t;
nx=size(p,1);
ny=size(p,2);
FFT=fft2(p);
FFT=FFT(1:nx/2+1,1:ny/2+1);
psd1= 2*abs(FFT).^2/(nx*fs*ny*fs);
fx= fs*(0:(nx/2))/nx;
fy= fs*(0:(ny/2))/ny;
0 Comments
Answers (0)
See Also
Categories
Find more on Fourier Analysis and Filtering in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!