0
$\begingroup$

I am running an fft on 60 seconds of data sampled at 1289Hz. The fft is run every second on a single channels fifo buffer which is also updated every second. The algorithm used is numpy rfft with a numpy blackman window. The fft output is normalized to the max fft value. This is all on a raspberry pi 4 with custom adc board that uses an AD4114. Am sampling 8 channels (16 in differential mode) as fast as the AD4114 can go which works out to 10.312kHz.

The following screen shots are with a 20Hz sign wave applied to one of the channels. Similar low magnitude peaks appear with real data a transducer attached to the input. There are low magnitude peaks centered exactly 1Hz apart right on top of each whole number. Is this normal? Like a normal artifact of the fft? Possibly something wrong with my data? I am a casual fft user and am hoping someone may have some advice for me. Thank you very much : ) zoomed_in less_zoomed_in normal_zoom

$\endgroup$
4
  • $\begingroup$ Booo, my window function was commented out. I should have known as there were no side lobes! With the window function in, the low magnitude peaks spaced evenly at 1hz disappeared. So I assume those were spectral smearing. But quite frankly, the smearing doesnt seem that bad compared to the quite large side lobes that I now get with the window... $\endgroup$ – chrismec Apr 10 at 1:37
  • $\begingroup$ I don't yet see how the spectral artifacts can be related to spectral smearing and are not actual artifacts of your data, nor should windowing increase the sidelobes (windowing will increase the width of the main lobe but significantly decrease the side-lobes). It sounds like you are experiencing the opposite: with the window you increase the dynamic range to see these low level artifacts and without it you would have large side lobes. Could you provide more details/ plots with and without your window and what your code looks like specific to doing that? $\endgroup$ – Dan Boschen Apr 10 at 11:28
  • $\begingroup$ Can you also plot your time domain data spanning several seconds-- the FFT is indicating that you have an impulse like artifact once per second in your data that may be large enough to actually see in the time domain. (And the DC offset although existing is not having any effect on this data you are seeing- that point can be confirmed by simply removing the mean value before the FFT and if my thinking is correct, you should see that the result will be the same, just without the large value at bin 0). $\endgroup$ – Dan Boschen Apr 10 at 11:30
  • $\begingroup$ Thank you for your comments Dan and the suggestion to plot in time domain. My buffer updates every second and in those updates I am getting random other channels polluting my data. Now the fun of tracking that down : ) Thank you again! $\endgroup$ – chrismec Apr 11 at 14:40
0
$\begingroup$

Is this normal?

No

Like a normal artifact of the fft?

No

Possibly something wrong with my data?

Yes. Could be a data problem, could be a hardware problem, could be a SW problem, could be real. You seem to have a very large DC offset in your data. Without knowing what exactly your data, is I can't tell whether that's expected or if it's a problem.

$\endgroup$
3
  • $\begingroup$ Thank you for answer. How can you tell there is a large DC offset? I dont recall the exact setup during those screen shots, I believe it was a 2Vp-p sine wave offset +2V or maybe +4V. I did discover my window function was commented out, so I assume those 1hz peaks I was seeing was spectral smearing. $\endgroup$ – chrismec Apr 10 at 1:42
  • $\begingroup$ Man I'm glad you mentioned noticing the large DC offset! That was the next issue I was going to look into. The large impulse around 0Hz is caused by DC offset apparently and that makes perfect sense, DC has no frequency so it shows up around 0. Thank you! $\endgroup$ – chrismec Apr 10 at 2:00
  • $\begingroup$ Thank you all for your help and steering me towards the issue! I still have some things to look at as far as side lobes and windowing, but the 1hz peaks I was seeing was indeed a data problem. Thank you Dan Boschen for suggesting the time domain plot! My troubles stemmed from me trying to run a real time process in Linux. My process started missing incoming data once I started putting higher loads on the cpu. My fix so far has been to move the adc process in the sched_fifo instead of sched_other. $\endgroup$ – chrismec Apr 21 at 15:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.