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=> 0, :ampl=>1.9661708933907966, :phase=>0.0}
...non significant amplitudes...
{:freq=>41, :ampl=>0.8468197908638829, :phase=>0.502386551741981},
{:freq=>42, :ampl=>2.0871309982776522, :phase=>0.5146361931223131},
{:freq=>43, :ampl=>4.115492878192129, :phase=>0.5268855235929356},
{:freq=>44, :ampl=>1.0144367909506748, :phase=>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 ?