How to - Distortion Measurements with REW

Member
Joined 2019
Paid Member
Beware of coherent averaging option without “Show phase of harmonics” checked
There is, what seems to me, an error with coherent averaging. :oops:

I first noticed that with certain sampling rate and FFT length ratios, when coherent averaging is turned on, measured signal and harmonics would start to jump down and up by several dB and up to 10 dB or more in some combinations. As a result, measured distortion would with averaging go down considerably.

However, if option “Show phase of harmonics” is checked, then signal and harmonics remain stable with any sampling rate/FFT length combination and only noise floor goes down reveling low level signals.

I wonder which is correct application behavior, suspecting it to be the latter.
 
Member
Joined 2019
Paid Member
I went to the official REW forum first to check if anyone has mentioned this. Nothing at all.
But, there is sad news that John’s wife has died last month, so I will not use e-mail option until spotting he is active on the forums again.

I was yesterday happily measuring my new amplifier and understood the problem only after posting the results.:mad:
Today’s measurement confirmed that error was from 4 - 6 dB, more on low levels. Looks insignificant, but It is a difference when you post 1W distortion as 0.00005% and have to amend this to real 0.00009%.
 
I first noticed that with certain sampling rate and FFT length ratios, when coherent averaging is turned on, measured signal and harmonics would start to jump down and up by several dB and up to 10 dB or more in some combinations. As a result, measured distortion would with averaging go down considerably.

However, if option “Show phase of harmonics” is checked, then signal and harmonics remain stable with any sampling rate/FFT length combination and only noise floor goes down reveling low level signals.
I also get my RTA plot randomly 'jumping' under certain circumstances. For me, the noise floor glitches high, then falls due to smoothing - the main signal level is not affected, but the calculated noise and harmonic levels are affected.

Afaik it is related to the driver and sample rate setting. My 'jumping' occurs at sample rates above 96kHz for the ASIO driver, but not the Java driver, and only for my desktop PC, not my laptop. I tried many software setting, powering, loopback, USB port, and driver buffer size permutations but with no conclusive outcomes. So my workaround is to deploy the laptop when measurements are impacted. And for clarity, your particular setting change related to coherent doesn't influence my particular 'jumping' issue.
 
It's good you have the same IN and OUT device. ASIO does not support different devices properly.

You may want to maximize the buffers in your chain (REW buffers). It's the most important parameter. Maybe you have some DPC latency issue in your windows system which causes long delays in serving interrupts - e.g. the DPC Latency Checker should help to investigate this.
 
Member
Joined 2019
Paid Member
This behavior can be there with any drivers and both ADCs I have, Focusrite Solo and Cosmos ADC.

How much harmonics and carrier will jump down depends on sampling frequency/FFT length combination. To easily spot that behavior, put averages to 8 and zoom in carrier or some harmonic peak. Here are values I found with Focusrite.

Harmonic’s phase turned off
  • ASIO driver -> 44.1 kHz/64K – carrier jumps 6dB, H2 jumps 12 dB
  • Java EXCL driver -> 44.1 kHz/64K – carrier jumps 6 dB, H2 jumps 12 dB
  • Java EXCL driver -> 44.1 kHz/128K – carrier jumps 12 dB, H2 stable
With option “Show phase of harmonics” turned on, any combination has stable levels. In example, depending on sampling rate and FFT length, I can bring measured distortion from 6 to 12 dB down. I understand now that once I got more than 20 dB of ‘improvement’.
 
Member
Joined 2019
Paid Member
Just measured signal generator distortion with Cosmos APU + Cosmos ADC using java EXCL driver 44kHz/256K FFT/32 averages, where no carrier jumping was apparent but harmonics did vary for 6 dB or more. With coherent averaging -145 dBc. Turning on phase of harmonics, results with measured -140 dBc.
 
Member
Joined 2019
Paid Member
Good news everyone. :D

John Mulcahy has fixed that behavior with coherent averaging and non FFT locked signals, as are those from external signal generators. It is confirmed that distortion values with coherent averaging were correct only with “Show phase of harmonics” option.
Fix will be available with next build.
 
  • Like
Reactions: 1 users
Hello,

I finished boxing Victor's oscillator. I wanted to ask you if the REW curve I'm putting out is correct for what it should be. I still have a small residue of 50Hz and its harmonics that I cannot make disappear.

Stef.
 

Attachments

  • spectrum-victor-boxed.jpg
    spectrum-victor-boxed.jpg
    394.6 KB · Views: 158
  • IMG_8293.jpeg
    IMG_8293.jpeg
    512.9 KB · Views: 159
  • IMG_8292.jpeg
    IMG_8292.jpeg
    829.5 KB · Views: 156
It is highly likely that your spectrum shows solely the performance of your Tascam interface. The latter is specified with a THD of 0.006%, but since the measurement conditions are not quoted it is not much worth.
On the other hand, the order of magnitude may still estimated: converting your THD result of 0.0016% dBFS to dBc I get 0.0035%, which is in the same ballpark as the 0.006% of your Tascam, but please not that this i just a rough estimate.
But even if your Tascam had a much lower THD, it can not be used to measure the THD of an oscillator capable of -150dBc, not even a top notch ADC like Cosmos can do that without a notch filter and an LNA.
 
The 50Hz residual seems to come from the Tascam interface. I looped the Tascam (output connected to input without signal) and I got the following.

My installation is made up of an old Intel NUC running Windows 10, the Tascam interface and a Hifime USB Isolator (480Mbps). All powered with a 24v battery pack which outputs 18V and 5V for the equipments. Without the isolator, the 50Hz rises to -85dB.

It may also come from the LCD screen. This is the only part that I didn't put on battery. As it's an old screen which works on 18Vdc, I'm going to try putting it on the battery too. I'm missing an adaptor cable to do it.

The Cosmos interface looks really nice but for now I have other, more urgent expenses to do. ;)

Quick question, what is an “LNA”?

Stef.
 

Attachments

  • Tascam-only.jpg
    Tascam-only.jpg
    396 KB · Views: 70
Last edited:
Looking at your current spectrum, the 1kHz peak is due to the USB interface, the 8 and 16kHz probably too.
I've had them in my setup too, sometimes it helps to physically separate the audio interface and the computer as much as possible.
Re. the mains spikes, I got rid of them by separating the oscillator from its PSU, the 30V cable between the PSU and the oscillator has double sheath.
My Victor is housed is an Al casing lined inside all around with mu-metal sheet.

LNA stands for Low Noise Amplifier, a very good one I've built years ago is described here:
https://www.diyaudio.com/community/...w-noise-measurement-amp-for-ikoflexer.175044/
 
Last edited: