# Coherent sampling

Fast Fourier Transform (FFT) is a common tool to investigate performance of data converters and other sampled systems. Coherent sampling refers to a certain relationship between input frequency, $f_{in}$, sampling frequency, $f_s$, number of cycles in the sampled set, $M_{cycles}$, and number of samples, $N_{samples}$. With coherent sampling one is assured that the signal power in an FFT is contained within one FFT bin, assuming single input frequency.

The condition for coherent sampling is given by

$\frac{f_{in}}{f_{s}} = \frac{M_{cycles}}{N_{samples}}.$

Where $N_{samples}$ value must be a power of 2 and $M_{cycles}$ value must be an odd or prime number.

If we have $N_{samples} = 2^{11} = 2048$ and $f_s = 100e6$ and we want an input frequency close to $f_s/2$, let's say $f_{in} = 44MHz$, then $M_{cycles} = 901.12$ which is close to an integer, so we could round it down to $M_{cycles} = 901$ and we would get $f_{in} = 43994140.625Hz$. This is an input frequency that satisfies coherent sampling and makes sure that we get an integer number of cycles.

This integer number $M$ can be chosen to be a Prime number (except for 2). This ensures that the same FFT samples will not be repeated across any two input signal cycles of the sampled signal[1]. For example, if N=32 and M=6 (non-prime) then there will be N/M=5.33 samples per cycle of the input frequency, so three cycles of the input will take exactly 16 samples, and so the first 16 samples will be identical to the second 16 samples. Usually, no additional information is gained by repeating with the same sampling points and so generally a non-prime M should not be used.