4

There's something I don't understand: I computes the spectral density of a signal (by computing its FFT) and that seems to work correctly but it keeps having some kind of background noise, although I'm doing it on a perfect sine wave with 2 frequencies (10 and 30Hz) that I generate myself.

Of course, the noise isn't really too annoying, because it is only visible with a logarithmic scale, but even, where does it come from ? Is that normal ? Do I have a bug in my signal, or anywhere ?

Energy spectral density of 10 + 30Hz sin wave

2
  • 1
    a complex transform is using cos+i*sin as basis functions, so it is exactly the same as using sin/cos separately (I mean, it is not an approximation). Mar 28, 2012 at 9:36
  • Thanks for correcting me ! In addition, thanks to your comment, I went to check and so understood many things about those fft algos for real inputs !
    – user978548
    Mar 28, 2012 at 16:52

1 Answer 1

5

It is mainly quantisation noise, but there may also be a small amount of noise from floating point rounding errors etc in the FFT itself.

Your "perfect sine wave" can not be perfectly represented in digital form, since you will always have finite precision. The difference between the theoretical value of a waveform at the time that it is sampled and the actual sample value is called "quantisation error". For N bit integer data the error will typically be approximately evenly distributed over the range +/- 0.5 LSB and will be notionally "white", i.e. have a roughly flat spectrum. Obviously the greater the sample resolution (greater N), the smaller the quantisation errors, but since N can not be infinite, there will always be a finite amount of quantisation noise. For N=16 bits, as used in e.g. "CD quality" digital audio, the quantisation noise is typically around 96 dB below full scale.

2
  • Thanks for this perfectly understandable answer ! I was not very aware of those problems, but that will become essential for me to know that because I intend to work with signals containing relevant infos in high amplitudes as well as in very low. I'll look further into Dither (which, if I understood correctly, can help me avoid detecting false informations at such low amplitudes) Thanks again !
    – user978548
    Mar 26, 2012 at 14:20
  • 1
    Dithering will whiten (i.e. flatten) the noise floor, but it won't reduce it overall. This may still help you to avoid false positives, however. Also look into spectral averaging, ensemble averaging, etc.
    – Paul R
    Mar 26, 2012 at 15:56

Your Answer

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

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