Input parameters:
fDSAMPLE: sampling frequency
fDIN: input frequency
NRECORD: number of data points for FFT operation
SIGFIG: signal generator resolution, decimal places after MHz
Output parameters:
fCSAMPLE: calculation result, coherent sampling frequency
fCIN: calculation result, coherent input frequency
Input parameters:
fDSAMPLE:65(MHz)
fDIN:32.1(MHz)
NRECORD:8192
SIGFIG:4
Output parameters:
fCSAMPLE:64.7168
fCIN:32.1135
When performing FFT conversion, if coherent sampling is not used, some problems will occur, such as spectrum leakage. In order to avoid spectrum leakage, there are generally two methods, one is to take coherent sampling, the other is to use The window function compensates to reduce the spectral leakage, but it cannot be completely eliminated. There are different kinds of general window functions, and the appropriate window function can be selected according to the actual situation.
For coherent sampling, certain rules need to be followed: 1) The sampled signal needs to be divided into cycles; 2) Fs/N=Ft/M, Fs is the sampling frequency, N is the number of sampling points, and Ft is the frequency of the 3) sampled signal, M The number of cycles sampled for the sampled signal; 3) In addition, M and N need to be prime 4) numbers of each other and both need to be integers, which avoids repeated sampling and improves efficiency.
Powered by TorCMS (https://github.com/bukun/TorCMS).