Four-Parameter Sinefit

Least squares sinusoid fit.
Updated 4 Jan 2019

View License

IEEE Standard for Digitizing Waveform Recorders (IEEE Std 1057): Algorithm for least squares fit to sinewave data using matrix operations:
- three-parameter (known frequency, non-iterative) and
- four-parameter (general use, find frequency iteratively).

Added features:
- Complex sinusoid fit enabled.
- Alternative 4-parameter fit by using the function fminbnd.

Cite As

Marko Neitola (2024). Four-Parameter Sinefit (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2018b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Curve Fitting Toolbox in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes

Improvements and bug-fixes

A feature update: fitting extended to complex sinusoids.

Fixed a bug in input parameter handling (varargin behavior).

Improved iteration convergence: the accuracy for the initial frequency guess is more relaxed.

A feature update: added a possibility to fit non-iteratively.

A minor bugfix in the plotting operation: now ALL samples are included in modulo-time plots.