How to use this calculator
Estimate one known-frequency sinusoid in a sample block without requiring it to land exactly on a DFT bin.
- Enter Uniform samples (signal units), Sampling frequency (Hz), Known tone frequency (Hz). Match the units shown beside each field and review the result together with the assumptions below.
- Read the worked example below to check the expected input format and result.
- Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Known frequency sine amplitude phase fit explained
Fit a known-frequency sinusoid plus a DC offset to uniformly sampled data using linear least squares.
How the calculation works
x[n]≈a cos(2πfn/fs)+b sin(2πfn/fs)+c; A=√(a²+b²), φ=atan2(−b,a) for A cos(ωt+φ).
Solve a three-column linear least-squares problem including a DC term. The frequency is fixed; this is not a frequency search.
Set up the calculation
x— Uniform samples (signal units)- Chronological real samples; use a comma-separated list in the same signal units. Use comma-separated values in the stated order.
fs— Sampling frequency (Hz)- Uniform samples per second; must be positive.
f— Known tone frequency (Hz)- Positive fitted frequency below Nyquist.
Limits of this model
Poorly conditioned frequencies or records are rejected. The phase of an effectively zero fitted amplitude is numerically arbitrary.
Check this example
Uniform samples (signal units) = [1, 2.5, 1, -0.5, 1, 2.5, 1, -0.5]; Sampling frequency (Hz) = 8; Known tone frequency (Hz) = 2.
- Fitted peak amplitude: 1.5 signal units
- Cosine phase: -90 deg
- Fitted DC offset: 1 signal units
- Residual RMS: 1.66533454e-16 signal units
Fit a two-hertz tone of amplitude 1.5 around a DC level one in the default eight-sample record.
Reading the outputs
Phase follows a cosine convention; residual RMS includes every mismatch beyond the fitted tone and DC. A fitted amplitude below 1e−12 returns phase zero as an explicit numerical convention.
Frequently asked questions
Can the record contain a fractional number of cycles?
Yes; least squares does not require coherent DFT sampling.
Is amplitude RMS?
No; it is a sinusoidal peak amplitude.
Will extra harmonics bias the result?
They can, especially in short or noncoherent records.
How do I use the Known frequency sine amplitude phase fit calculator?
Enter Uniform samples (signal units), Sampling frequency (Hz), Known tone frequency (Hz). Match the units shown beside each field and review the result together with the assumptions below.
What is a worked example of Known frequency sine amplitude phase fit?
Uniform samples (signal units) = [1, 2.5, 1, -0.5, 1, 2.5, 1, -0.5]; Sampling frequency (Hz) = 8; Known tone frequency (Hz) = 2. Fitted peak amplitude: 1.5 signal units Cosine phase: -90 deg Fitted DC offset: 1 signal units Residual RMS: 1.66533454e-16 signal units Fit a two-hertz tone of amplitude 1.5 around a DC level one in the default eight-sample record.