Hi,
Its a general question and not specific to any product.
How to calculate FFT for an ADC output as its output is digital codes.? How this digital codes can be used to calculate the FFT of an ADC?
Thanks in advance
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Generically speaking, the FFT calculation is not difficult to put together. It becomes a calculation that represents a signal power over a frequency band.
The ADC code represents a voltage. Depending on the part, you can find the conversion from code to voltage in the the datasheet of the ADC. However, in the calculation, we can represent the code as a function of the full scale of the signal.
Based on the data rate at which the part is operating, the FFT is calculated with the data rate as the sampling frequency.
Attached to this post is a screen shot from ADCPro, an ADC evaluation program created at TI. This shows the evaluation of an ADS1278 with the program. In this example, we have generated a 1kHz sine wave to measure, and measured it at a sampling rate of 105.469kSPS. In this example we can see the FFT measurement on the right side, showing a peak at 1kHz (which is the input frequency). Based on the code, the signal power is based on 0dB which is full scale.
If you are asking how to specifically calculate the FFT, the above example is created through a Labview utility. There are plenty of examples of how an FFT is coded if you search the internet. In the past, I have used one from "Numerical Recipes in C"
Joseph Wu
Thanks Joseph for your response,
Is that the voltage function that you mentioned is code = 2^bits - 1 / 2^bits * Full Scale. If this cannot be used as a general function, then can you give me an example for changing the captured digital codes into a voltage function a n-bit ADC whose output captured in a Logic Analyser?
Eagerly waiting for your reply.
The output calculation for the ADC will vary depending on the specific ADC. It will depend on many different things, such as the reference voltage and how it relates to full-scale, the gain if there is a PGA for gain, single-ended or differential configurations and output format.
In the example that I gave you, the output code for the ADS1278 is:
ADC voltage = (output code/((2^23)-1)) * VREF
Also noting about the ADS1278:
Code is in a two's complement notation for negative numbers.
VREF is the positive full scale.
It is a 24 bit ADC, with 2^(24-1) representing the positive full scale or one half of all codes.
The PGA gain is 1.
Again, the conversion from output code to voltage will depend on the specific ADC, so I'd consult the datasheets of any you are interested in.
Joseph Wu