0
$\begingroup$

we've been working with the Spiral DFT Implementation on an FPGA and managed to get it working. Unfortunately we see these strange artifacts and have no idea where they come from. Our input is a perfect sine wave, generated by a python script and fed into the simulation as a text file.

We have 2 issues:

  1. Additional peaks in the frequency spectrum that should not be there.

  2. The main amplitude breaks down in the center of the peak.

--> we thought this is due to a value overflow but the phenomenon persists even if we decrease the amplitude of the input signal.

We should note that our DFT takes 16 bit values, which are the upper 16 bit of our 24 bit sample values.

Here are some examples:

Different Frequencies:

Frequency: 10kHz, Amplitude: (2**23-1)/14 Frequency: 10kHz, Amplitude: (2**23-1)/14

20kHz, Amplitude: (2**23-1)/14 Frequency: 20kHz, Amplitude: (2**23-1)/14

Frequency: 30kHz, Amplitude: (2**23-1)/14 Frequency: 30kHz, Amplitude: (2**23-1)/14

Changing the Amplitude results in following:

Frequency: 6.5kHz, Amplitude: (2**23-1)/10 Frequency: 6.5kHz, Amplitude: (2**23-1)/10

Frequency: 6.5kHz, Amplitude: (2**23-1)/13 Frequency: 6.5kHz, Amplitude: (2**23-1)/13

Our Sample Rate is 65.1 kHz.

If you have seen this phenomenon before or have suggestions on how to approach this issue, we're happy about any ideas! :)

$\endgroup$
7
  • 1
    $\begingroup$ Can you export the data being transformed and run it through a known-good DFT and see if the problems persist? $\endgroup$
    – endolith
    Jul 8, 2019 at 14:38
  • 2
    $\begingroup$ Do you check for overflows and saturation ? 16-bit is very poor resolution for 256 point FFT. Your FFT gain on a sine wave will be 50 dB. Depending on the scaling of your FFT you would need to crank the amplitude way down to avoid clipping $\endgroup$
    – Hilmar
    Jul 8, 2019 at 14:47
  • $\begingroup$ This is likely a quantization\overflow issue, whether in the twiddle factor or in the intermediate calculations. Are you sure your core is properly parameterized? $\endgroup$
    – Ben
    Jul 8, 2019 at 18:10
  • $\begingroup$ On the web site form they write " If unscaled arithmetic is chosen, the data will not be scaled, but overflow is possible." $\endgroup$
    – Ben
    Jul 8, 2019 at 18:20
  • 1
    $\begingroup$ so, your DFT is a fixed-point DFT? if so, you better check to see what it does with overflow. try taking your original data and scaling it down 18 or 24 dB (that's just an arithmetic shift right 3 or 4 bits). the noise floor should remain the same and the signal spectrum should be reduced by 18 or 24 dB, but the spurious lines should disappear. if they do, your problem is with nasty overflow issues in your fixed-point DFT. $\endgroup$ Jul 8, 2019 at 21:57

2 Answers 2

0
$\begingroup$

I think your sine have some sample(s) missing or is poorly sampled. Do you have a way to check that? You said that you use 65.1k to sample the sine, but what is its frequency?

$\endgroup$
2
  • $\begingroup$ I added the frequencies in plain text now, I didn't realize that the image description tag is not displayed. $\endgroup$
    – Ben Bezos
    Jul 8, 2019 at 21:17
  • $\begingroup$ What if the truncated value that you are using in the DFT is inserting high frequencies on your spectrum? $\endgroup$
    – Igor
    Jul 8, 2019 at 21:36
0
$\begingroup$

Thanks to everyone who commented on our question! We simply set the DFT to scaling and it solved all issues.

Frequency: 6510Hz, Amplitude: (2**23-1)/14, DFT with Scaling

Frequency: 6510Hz, Amplitude: (2**23-1)/14, DFT with Scaling

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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