• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are daily reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

How much spectrum noise does your audio measurement software add?

scottd

Member
Joined
Jul 10, 2022
Messages
36
Likes
16
Location
Texas
Your audio measurement software probably introduces more noise into your measurements than you realize. Today's hardware usually doesn't have a high enough effective number of bits to make these software limitations noticeable. But it's getting close. It's time for software developers to embrace the efficient double precision hardware we all have sitting on our desks. Just say no to single precision accuracy. In the 1980's we said 'real programmers don't use floating point'. Those days are gone, except for some doing embedded system work.

Do you use software to generate PCM sine waves? It's all but certain to be less than perfect. Test software often uses a compiler supplied library function to calculate sine values. These library functions must balance speed against accuracy. Fortunately, today's library sine functions are pretty good. A decade or two ago, compiler libraries often used the x86 sine function, which is pretty flawed. But even so, using a modern library sine function for DFT calculation leads to easily noticeable inaccuracy. The popular FFTW library appears to avoid the problem of compiler sine function inaccuracy. FFTW is limited to double precision math, though double precision is more than enough for usual audio work. But going beyond double precision can be useful for learning and experiments.

One possible spectrum software noise test is to process a wav file of silence. REW crashes with such input, and Multitone Analyzer reports 'silence detected'.

A better test is to use a wave file that encodes a sine wave in a way that is free of noise harmonics. This is done by choosing a sample rate to sine ratio of 3:1, 4:1 or 6:1, as described here. If math isn't your thing, then just do a high precision FFT or DFT on such a file and see for yourself that they are free of harmonic noise.

So far I have found no free, well-known software that can graph a spectrum from a wav file with double precision accuracy. Spectrum Viewer for Windows can do it, but it's a simple manual spectrum viewer not suitable for the automated testing popular here.

REW is popular here, so I tested it, first using wav file sine4to1_0dB_100s.wav that reconstructs free of noise harmonics, and with a fundamental harmonic at exactly the maximum level of -3.01... dB = 10 * log (1/2). The wave file contains 4 samples, (1, 0, -1, 0) repeated over and over. REW has trouble with short files, so I expanded it to the 100 seconds. If I am interpreting the result correctly, REW is adding noise at levels -175 dB and below. That's unlikely to interfere with measurements of real hardware, but it falls short of the expected noise threshold of 53 * 6.02 = 319 dB for double precision floating point arithmetic:
rew1.png


Next, I tested using wav file sine5to1_0dB_100s.wav that contains a single noise harmonic. With this file, the noise harmonic is 106.37138686... dB below the fundamental, according to the FFTW double precision DFT. REW shows excellent accuracy for second harmonic value. But look at the noise it has introduced. It looks like there is false noise up to the -154 dB level:

rew2.png


What's going on with that? Here is SpectrumViewer for Windows showing how double precision processing reduces the introduced noise to less than -300 dB:
sv1.png



Next up, Multitone Analyzer using the same file sine5to1_0dB_100s.wav. Like REW, Multitone Analyzer measures the second harmonic correctly. For the introduced noise, Multitone Analyzer added noise is limited to -185 dB and below. That's better than the REW noise of -154 dB. But why can't it match the FFTW level of -300 dB? SpectrumViewer also limits noise to the expected double precision level of < -300 dB. It doesn't use FFT or any other kind of DFT. It used digital filters instead.
 

MaxwellsEq

Major Contributor
Joined
Aug 18, 2020
Messages
1,514
Likes
2,248
Interesting, thank you.
 

JohnPM

Senior Member
Technical Expert
Joined
Apr 9, 2018
Messages
338
Likes
897
Location
UK
You are seeing the effect of window functions, not the processing (assuming you have selected the 64-bit FFT in REW). For the signal which is periodic in the FFT length use a rectangular window. REW clips silence to 240 dB below the digital maximum sample value.

1672143023568.png


For the other signal use a window with a higher dynamic range, such as Cosine sum 9-235.

1672143103842.png
 

pkane

Master Contributor
Forum Donor
Joined
Aug 18, 2017
Messages
5,506
Likes
10,024
Location
North-East
So far I have found no free, well-known software that can graph a spectrum from a wav file with double precision accuracy. Spectrum Viewer for Windows can do it, but it's a simple manual spectrum viewer not suitable for the automated testing popular here.

Next up, Multitone Analyzer using the same file sine5to1_0dB_100s.wav. Like REW, Multitone Analyzer measures the second harmonic correctly. For the introduced noise, Multitone Analyzer added noise is limited to -185 dB and below. That's better than the REW noise of -154 dB. But why can't it match the FFTW level of -300 dB? SpectrumViewer also limits noise to the expected double precision level of < -300 dB. It doesn't use FFT or any other kind of DFT. It used digital filters instead.

You'll need to test it slightly differently with Multitone to avoid going through any audio driver that will truncate, dither or resample data. You can drop a WAV file onto the input device list and it'll get measured just as if it was captured from the ADC. Here's your first file spectrum:

1672147616965.png


And here's your second, with the added second harmonic:

1672147485723.png
 

DonH56

Master Contributor
Technical Expert
Forum Donor
Joined
Mar 15, 2016
Messages
7,757
Likes
16,323
Location
Monument, CO
Your audio measurement software probably introduces more noise into your measurements than you realize. Today's hardware usually doesn't have a high enough effective number of bits to make these software limitations noticeable. But it's getting close. It's time for software developers to embrace the efficient double precision hardware we all have sitting on our desks. Just say no to single precision accuracy. In the 1980's we said 'real programmers don't use floating point'. Those days are gone, except for some doing embedded system work.

Do you use software to generate PCM sine waves? It's all but certain to be less than perfect. Test software often uses a compiler supplied library function to calculate sine values. These library functions must balance speed against accuracy. Fortunately, today's library sine functions are pretty good. A decade or two ago, compiler libraries often used the x86 sine function, which is pretty flawed. But even so, using a modern library sine function for DFT calculation leads to easily noticeable inaccuracy. The popular FFTW library appears to avoid the problem of compiler sine function inaccuracy. FFTW is limited to double precision math, though double precision is more than enough for usual audio work. But going beyond double precision can be useful for learning and experiments.

One possible spectrum software noise test is to process a wav file of silence. REW crashes with such input, and Multitone Analyzer reports 'silence detected'.

A better test is to use a wave file that encodes a sine wave in a way that is free of noise harmonics. This is done by choosing a sample rate to sine ratio of 3:1, 4:1 or 6:1, as described here. If math isn't your thing, then just do a high precision FFT or DFT on such a file and see for yourself that they are free of harmonic noise.

So far I have found no free, well-known software that can graph a spectrum from a wav file with double precision accuracy. Spectrum Viewer for Windows can do it, but it's a simple manual spectrum viewer not suitable for the automated testing popular here.

REW is popular here, so I tested it, first using wav file sine4to1_0dB_100s.wav that reconstructs free of noise harmonics, and with a fundamental harmonic at exactly the maximum level of -3.01... dB = 10 * log (1/2). The wave file contains 4 samples, (1, 0, -1, 0) repeated over and over. REW has trouble with short files, so I expanded it to the 100 seconds. If I am interpreting the result correctly, REW is adding noise at levels -175 dB and below. That's unlikely to interfere with measurements of real hardware, but it falls short of the expected noise threshold of 53 * 6.02 = 319 dB for double precision floating point arithmetic:
View attachment 252575

Next, I tested using wav file sine5to1_0dB_100s.wav that contains a single noise harmonic. With this file, the noise harmonic is 106.37138686... dB below the fundamental, according to the FFTW double precision DFT. REW shows excellent accuracy for second harmonic value. But look at the noise it has introduced. It looks like there is false noise up to the -154 dB level:

View attachment 252576

What's going on with that? Here is SpectrumViewer for Windows showing how double precision processing reduces the introduced noise to less than -300 dB:
View attachment 252577


Next up, Multitone Analyzer using the same file sine5to1_0dB_100s.wav. Like REW, Multitone Analyzer measures the second harmonic correctly. For the introduced noise, Multitone Analyzer added noise is limited to -185 dB and below. That's better than the REW noise of -154 dB. But why can't it match the FFTW level of -300 dB? SpectrumViewer also limits noise to the expected double precision level of < -300 dB. It doesn't use FFT or any other kind of DFT. It used digital filters instead.

And this is why the choice of frequencies is so important when creating (or measuring) signals with an FFT... Look up "spectral leakage" and "windowing" with respect to FFTs. Then pick up a copy of one of the IEEE Standards to help with signal selection (e.g. 1057 for waveform recorders, the grandfather, 1241 on ADCs, 1658 on DACs), or look to the AES (as @pkane noted a while back, they have some differences, though generally get to the same place in the end).
 
Last edited:

KSTR

Major Contributor
Joined
Sep 6, 2018
Messages
2,603
Likes
5,855
Location
Berlin, Germany
Your audio measurement software probably introduces more noise into your measurements than you realize.
It doesn't unless we have an "error 40" incident (the error is sitting 40cm behind the monitor ;-)
 
OP
S

scottd

Member
Joined
Jul 10, 2022
Messages
36
Likes
16
Location
Texas
Thanks a lot Pkane for the Multitone Analyzer help. That did the trick. Full double precision processing for the spectrum view of a 64-bit wav file is working for me. Your app is the only one I have encountered that can both read and process, and also export 64-bit double precision wave files.
Yesterday and today I have been gathering test tone files and studying them for quality. The results are quite interesting, and there is lots of room from improvement. I will put some results on a suitable thread. Thanks for the help.
 
Last edited:
OP
S

scottd

Member
Joined
Jul 10, 2022
Messages
36
Likes
16
Location
Texas
Thanks a lot John for the REW help. I ended spending too much time with Multitone Analyzer and have not played with the REW spectrum view enough. I ended up looking at test tone quality and will add some measurements and comments to a different thread.
 
Top Bottom