Incorrect THD with big FFT?

vasiliy

New Member
Thread Starter
Joined
Jul 10, 2021
Messages
13
I'm getting expected results with low and medium size FFT sizes, but when i go 1-4M FFT size - THD goes wild. Check this out - i made intentional harmonic distortion at -80db using the generator and made an RTA measurement using 128k and 4M FFT. The results are drastically different. Screenshots attached. THD is different and the level of 2nd harmonic you can see on the screen is definitely not correct. Am i doing something wrong?..

REW is the latest version 5.30.9.
 

Attachments

  • 4M.PNG
    4M.PNG
    133.5 KB · Views: 19
  • 128k.PNG
    128k.PNG
    129.3 KB · Views: 19

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,337
Uncheck "Get fundamental from generator". The slight difference in the replay and capture device clocks is enough to shift the fundamental peak into a different bin with a 4M FFT, that's why the "1" for the fundamental is not at the peak of the input. Using the generator for the fundamental frequency is fine if replay and capture are the same device, if not best to let REW work things out from what's coming in.
 

vasiliy

New Member
Thread Starter
Joined
Jul 10, 2021
Messages
13
It helped. Thanks a lot.
 

Attachments

  • THD.png
    THD.png
    28.2 KB · Views: 7

vasiliy

New Member
Thread Starter
Joined
Jul 10, 2021
Messages
13
Uncheck "Get fundamental from generator". The slight difference in the replay and capture device clocks is enough to shift the fundamental peak into a different bin with a 4M FFT, that's why the "1" for the fundamental is not at the peak of the input. Using the generator for the fundamental frequency is fine if replay and capture are the same device, if not best to let REW work things out from what's coming in.
it helped with single sine, but... :) it's always some "but..." :))
similar problem with multitone. 512k fft - no problem, 1m - it goes wild.
 

Attachments

  • 1M.PNG
    1M.PNG
    209.4 KB · Views: 13
  • 512k.PNG
    512k.PNG
    206.4 KB · Views: 15

phofman

Member
Joined
Jun 26, 2019
Messages
137
Maybe it's more difficult to keep track of the frequency shift and especially adjust the calculation accordingly for multitone than for a single sine. IMO these long precise measurements are better to do with synchronized generation/capture.
 

vasiliy

New Member
Thread Starter
Joined
Jul 10, 2021
Messages
13
Maybe it's more difficult to keep track of the frequency shift and especially adjust the calculation accordingly for multitone than for a single sine. IMO these long precise measurements are better to do with synchronized generation/capture.
ok. how do i do that?
 

phofman

Member
Joined
Jun 26, 2019
Messages
137
As John has already noted - using a device with common clock for playback and capture. Or using devices which can have their clocks synchronized externally. None of that is the case of your Cosmos ADC.

But maybe the clock drift tracking can be done in REW for multitone somehow too, that's a question for John.
 
Last edited:

vasiliy

New Member
Thread Starter
Joined
Jul 10, 2021
Messages
13
got it.
i though with big FFT we suppose to get better precision, not dramatically less :)) i guess i am missing something :)
 

phofman

Member
Joined
Jun 26, 2019
Messages
137
Long FFT means :

* the overall frequency band gets split into more bins and
* more samples are required for the calculation

Now the problem of asynchronous playback/capture is that as time passes the sampling may drift against the generation. E.g. the generator outputs e.g. 1kHz (as measured by its clock), but the ADC samples e.g. 1.0001kHz. If the DAC and ADC sampling frequencies are very stable, i.e. their ratio is constant in time, the signal at the beginning of the FFT samples will be 1.0001 kHz and at the end also 1.0001 kHz. No problem for the FFT, it will just measure the fundamental at 1.0001kHz instead.

FFT 1M requires 1M samples which takes 10 secs to collect at 96kHz. Now if within those 10 secs the two clock frequencies shift against each other by 1ppm, the fundamental frequencies will be shifted by one bin between start and end of the FFT samples stream. If this bin shift within one FFT buffer is not compensated somehow (a rather complex task), the calculation for the initial bin will be way off (because the measured signal energy has moved to another bin within the single FFT buffer). And 1ppm is not much.
 
Last edited:
Top Bottom