Amplitude estimation of sinusoid in known spiky spectral noise
The best fit time domain solution can be found by constructing two two basis vectors with your known frequency and calculate the coefficients directly.  The magnitude and phase can then be directly determined from these values.

Let C be a vector of cosine values over your frame and S be a vector of sine values.  You then want to find $(a,b)$ so that $aC + bS$ is a close as possible to your function.

$$ F = a C + b S $$

Dot this with the basis vectors.

$$ C \cdot F = a C \cdot C + b C \cdot S $$

$$ S \cdot F = a S \cdot C + b S \cdot S $$

Since the dot products are scalars, this is simply a linear system of two equations with two unknowns.  If you have a whole number of cycles in your frame then $ C \cdot S $ and $ S \cdot C $ become zero and the solution is trivial.

Note, this operation is the equivalent of a single bin in a DFT with the right parameters.  That is, pick a DFT frame with a whole number of cycles of your known frequency, and look at the corresponding bin.

The general case, without cycle alignment, can also be solved in the frequency domain with way fewer calculations.  See my blog article:


Phase and Amplitude Calculation for a Pure Real Tone in a DFT: Method 1


Do this for each of your peaks.  For better results, subtract out the peaks you have found before processing the others.