image thumbnail

HARMFIT: Sinusoidal harmonic curve fitting

version (3.04 KB) by François Beauducel
Computes harmonics of a phase signal


Updated 28 May 2014

View License

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.
t = linspace(0,2*pi);
x = 2*cos(t + pi/2) - cos(3*t) + rand(size(t));

returns estimations of amplitudes/phases for the first four harmonics.

Cite As

François Beauducel (2022). HARMFIT: Sinusoidal harmonic curve fitting (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2014a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!