THD+n measurement best fft configuration

Kvach

Registered
Thread Starter
Joined
Dec 11, 2023
Messages
2
More  
DAC
Tascam us-366 Roland edirol fa-66 Focusrite saffire pro 24
Front Speakers
Yamaha NSg 40 GRUNDIG FINE ARTS BX-1
Hi
I'm writing my own soft (online PHP) for measure soundcart by recordet file and I test different measure from different soft and my results were the same only with rew with fft Falt-top window , 1M Length - from generated distortion file
THD+N: 0,0012 %
vs teoreticaly
0.0011826877702029%
vs my method
0.001188020099145558%
file generated (32 bit int) with formula $db_to_abs(-1) * sin($n * $w)+ db_to_abs(-100)*sin($n * 2* $w) + db_to_abs(-110)*sin($n * 3* $w) + db_to_abs(-120)*sin($n * 4* $w) + db_to_abs(-130)*sin($n * 5* $w) + white noice (-140dB)
$w=2 * M_PI * 960 / $sampleRate; 960Hz best for dft transform frequency
noice log file in 32 bit integer
$fen=average noice from file log
formula THD+n = ( (sqrt(pow(db_to_abs(-100),2)+pow(db_to_abs(-110),2)+pow(db_to_abs(-120),2)+pow(db_to_abs(-130),2)) + $fen*sqrt(2)) /db_to_abs(-1)*100 );
energy of each sine equal amplitude^2/sqrt(2) where sqrt(2) in numerator and denominator are abbreviated

Are these REW parameters (fft Falt-top window , 1M Length) optimal and is it possible to focus on them?

My measure in attachment 32 bit int 192000 distortion.flac + distortion.log + distortion.mdat
 

Attachments

  • distortion.zip
    17.8 MB · Views: 5
Last edited:

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,403
No, flat top is not a good choice for measuring distortion if you need to resolve very low distortion levels as its sidelobes are relatively high. It also has a wide skirt, masking noise near the stimulus frequency. If output and input share the same clock and you choose a stimulus that is an FFT bin frequency you can use a rectangular window, otherwise Blackman-Harris 7, the Dolph-Chebyshev 200 and the Cosine sum 9-235 windows work well. THD+N results will depend on the bandwidth chosen for the calculation, interfaces will typically have issues/bandwidth limitations at very low and very high (near Nyquist) frequencies. You can validate results with REW's signal generator, it lets you add distortion harmonics at your preferred levels and phases.
 
Top Bottom