Fit Sinusoidal Model Explorer

Live Script that explores a two-step method to fit data to a sum of sinusoidal signals.
8 Downloads
Updated 3 Mar 2025

View License

A common signal processing challenge is to fit a data vector corresponding to independent variable values to a sum of sinusoidal signals of different frequencies assuming normal uncorrelated stationary noise. This Live Script illustrates a two-step method of solution based on separable regression. The data model in the form is linear in the amplitude vector but nonlinear in the elements of the frequency vector . The least squares solution for has an exact expression in terms of the data and frequencies. Using this expression, may be expressed in as a nonlinear function of and and a numerical method used to minimize to obtain an estimate by first locating peaks in the periodogram to provide an initial estimate. The amplitude vector estimates may then be computed as .
This educational Live Script may interest students and instructors of physics and other STEM fields. 'Try this' suggestions and coding 'Challenges' along with hyperlinks and references are included for further exploration.

Cite As

Duncan Carlsmith (2025). Fit Sinusoidal Model Explorer (https://uk.mathworks.com/matlabcentral/fileexchange/180280-fit-sinusoidal-model-explorer), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2024b
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!

FitSinusoidalModelExplorer folder

Version Published Release Notes
1.0.0