FFT, PSD, and CSD
Version 1.0.3 (2.9 KB) by
Ayad Al-Rumaithi
Fast Fourier Transform, Powder Spectral Density, and Cross Spectral Density
function Result=FFT(x, Fs)
Fast (Discrete) Fourier Transform of a Signal
inputs
x : input sequence (1*Ndata)
Fs: sampling frequency
outputs
Result structure consists of
Result.f : frequency (1*NumUniquePts)
Result.MX : amplitude (1*NumUniquePts)
Result.Arg : Phase Angle (1*NumUniquePts)
------------------------------------------------------------------
function Result=PSD(x, Fs,window,N,p)
Power Spectral Density of a Signal (This function do the averaging for the spectral density)
inputs
x : input sequence (1*Ndata)
Fs: sampling frequency
window : window size
N: Number of windows
p: overlap ratio of windows
outputs
Result structure consists of
Result.f : frequency (1*NumUniquePts)
Result.MX : amplitude (1*NumUniquePts)
------------------------------------------------------------------
function Result=CSD(x,y,Fs,window,N,p)
Cross Spectral Density of a Signal (This function do the averaging for the spectral density)
inputs
x : input sequence 1 (1*Ndata)
y : input sequence 2 (1*Ndata)
Fs: sampling frequency
window : window size
N: Number of windows
p: overlap ratio of windows
outputs
Result structure consists of
Result.f : frequency (1*NumUniquePts)
Result.MX : amplitude (1*NumUniquePts)
Result.Arg : Phase Angle (1*NumUniquePts)
Cite As
Ayad Al-Rumaithi (2026). FFT, PSD, and CSD (https://uk.mathworks.com/matlabcentral/fileexchange/69634-fft-psd-and-csd), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2009b
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
Find more on Fourier Transform in Help Center and MATLAB Answers
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
