This is the core formula of discrete Fourier transform: it simply computes the amplitude and phase shift of fundamental or harmonics of a phase signal.
Example:
t = linspace(0,2*pi);
x = 2*cos(t + pi/2) - cos(3*t) + rand(size(t));
harmfit(t,x,1:4)
returns estimations of amplitudes/phases for the first four harmonics.
François Beauducel (2021). HARMFIT: Sinusoidal harmonic curve fitting (https://www.mathworks.com/matlabcentral/fileexchange/46736-harmfit-sinusoidal-harmonic-curve-fitting), MATLAB Central File Exchange. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Create scripts with code, output, and formatted text in a single executable document.
Dear François Beauducel; I have made HARMFIT to my timeseries data set. I want to get the get the equation of this fitted equation. How can i get the equation of this fitted equation with all coefficients?