SMOOTHING FUNCTION FOR FOURIER AMPLITUDE SPECTRUM
smoothSpectra offers various different window smoothing options for Fourier amplitude spectrum (FAS) including boxcar, triangle, Parzen, Hann, Hanning, Hamming, Gaussian. Default window function is Konno-Ohmachi (see Konno and Ohmachi (1998), page 234), which symmetric in log space. The smoothing is performed by convolving the window function with the FAS. Three examples are provided in demo.m file.
[smoothFAS] = smoothSpectra(Y,varargin)
Y = vector of Fourier amplitudes (1xn or nx1)
VALID PROP_NAME / PROP_VAL PAIRS:
'w' --> (1x1)-[numeric]-[default:40]
'b' --> (1x1)-[numeric]-[default: 20]
'method' --> [text]-[default: konno-ohmachi]
'debug' --> [text]-[default: False]
w = width of window function (e.g., 100)
b = bandwidth coefficient of konno-ohmachi window (e.g., 20)
method = window function (e.g., boxcar, gaussian, hamming, hann,
hanning, konno-ohmachi, parzen, triang)
debug = 'True' for print debug messages
smoothFAS = smoothed vector of Fourier amplitudes (1xn)
see demo.m file
smoothSpectra function does not require any MatLAB toolbox
In preparing this function, I benefitted from konv.m function written by Ali Jadoon.
If you find this code useful for your application, please don't forget to rate it.
For questions / suggestions / comments and bug reports: email@example.com
Dr. Erol Kalkan, P.E. (2019). SMOOTHING FUNCTION FOR FOURIER AMPLITUDE SPECTRUM (https://www.mathworks.com/matlabcentral/fileexchange/70217-smoothing-function-for-fourier-amplitude-spectrum), MATLAB Central File Exchange. Retrieved .
Create scripts with code, output, and formatted text in a single executable document.