Parameter extraction from DFT results, possibly with leakage effects Let's start with a simple temporal law, that I want to analyze in the frequency domain :

$x(t)=\frac{1}{2}(A+Bcos(2\pi \nu_0 t+\phi_0))$, with :


$A=4$ 
$B=10$ 
$\nu_0=10^8$
$\phi_0=10^8$


I made a simple DFT (in Ruby) with $N=256$ samples at $f_s=6.10^8$ and got the following results, that are self explanatory, hopefully :

{:freq=&gt; 0, :ampl=&gt;1.9661708933907966, :phase=&gt;0.0}
...non significant amplitudes...
{:freq=&gt;41, :ampl=&gt;0.8468197908638829, :phase=&gt;0.502386551741981},
{:freq=&gt;42, :ampl=&gt;2.0871309982776522, :phase=&gt;0.5146361931223131},
{:freq=&gt;43, :ampl=&gt;4.115492878192129,  :phase=&gt;0.5268855235929356},
{:freq=&gt;44, :ampl=&gt;1.0144367909506748, :phase=&gt;0.5391345296503323},
...non significant amplitudes...


I clearly retreive A : $1.96 = \frac{A}{2}$ gives $A = 3.9 \approx 4$. Good.

As for $\nu_0$, this seems correct also :
$f_{analysis}(43)=\frac{43f_s}{256}=100781250.0\approx 10^8=\nu_0$.

For $B$ and $\phi_0$, things are more difficult, because (I guess) of DFT frequency leakage. Direct reading of my result gives $$2\times 4.11=8.22 \not\approx B=10$$

As experts, how would you get acceptable $B$ and $\phi_0$, from my results ?
Interpolation is one method used to estimate parameters of non-periodic-in-FFT-aperture signals.  Parabolic or, better yet, Sinc interpolation will help with estimating both the frequency and the amplitude peak B.  For phase interpolation, I find it easier to use something like a pre or post fftshift to move the phase 0 reference to the middle of your data, then interpolating an estimated phase from the fft, then offsetting the phase back relative to wherever using the frequency estimate.