# FFT Bin Problem with external 24 Bit ADC(FFT bins changing with time)

Currently I am working on one project that includes 24 Bit external MCP3919 and MCP3914 ADCs and Tiva C series 32 Bit MCU. I am trying to calculate harmonic values of input signal.

I am using CMSIS DSP Library in Code Composer Studio. FFT functions are working great I have no problem with implementation of these functions. I tested them with internal generated sin signal and modulated it. Results are expected.

• FFT_Size : 64 point
• Window_Size : 2*FFT_Size

I have a problem that when I read real world signal from signal generator, my FFT bins are changing with time in n*50Hz signals. When I increase the input signal to 50.9 Hz there is no problem. It is same with 150Hz, 250Hz, 350Hz. It seems like there is fixed frequency error related with 50Hz.

For example : FFT functions work great with 50.9 Hz signal instead of 50Hz (1*0.9Hz) 152.7 Hz signal instead of 150 Hz ( 3*0.9Hz) 254.5 Hz signal instead of 250 Hz (5*0.9Hz)

I am sharing my FFT Bin graphs

                       **Fig1 : 50.0 Hz and 250.0Hz**


                    **Fig2 : 50.9 Hz and 254.5Hz**


As a result, with frequency changing FFT bins are true. I need your experiences with this issue.

dredg

• 50Hz multiples sounds suspiciously like power line feedthrough - is your signal generator mains powered? (I am assuming you are in a country with a 50Hz power line). The specific signal generator model might help us understand. – Peter Smith Apr 30 '16 at 13:59
• Hello Peter. I am not thinking that It is related with it. Because it is supplied isolated power supply. And I observed from osciloscope too. – dredg Apr 30 '16 at 14:54

This happens when the input signal is not exactly periodic with input signal length, e.g. because the generated sine and the ADC clock are from different clock sources. Looking at a signal that we expect in bin 2 ($e^{2ix}$), and the result for bin 1:
• If the sampling period contains exactly two signal periods: $\int_0^{2\pi}\!{e^{2ix}e^{-ix}\ dx} = 0$
• If the signal is a bit lower in frequency: $\int_0^{2\pi}\!{e^{1.99ix}e^{-ix}\ dx} = -0.063 + 0.002i$, so quite a bit of energy is shown in this bin.