How to - Distortion Measurements with REW

The general impression I've been getting from discussions here is to take 0.015 - 0.007 = 0.008% as the distortion?

I believe some members are doing this per HD, not at the THD level, and then adding them up to get the derived THD.

I'm new to this; I too am learning.


Doesn't work like that - distortions may be cancelling each other out or reinforcing each other or anything in-between, so that the actual distortion might be as bad as 0.015+0.007 = 0.021% (the amp's 0.021% distortion cancelled the loopback distortion and then some).


Its best to quote the amp figure and the loopback figure so that the uncertainty in the measurement is explicit.
 
I need a better sound-card, right?

Hmmm xkr971, If I'm reading the charts correctly, my built-in sound card is crap, right?
:eek:
 

Attachments

  • RTA_soundcard.PNG
    RTA_soundcard.PNG
    140.8 KB · Views: 597
The discussions on resistor distortion (What causes resistor distortion?) correlate with xkr971's comments in post #294 on the dummy load influence. When measuring low-distortion high-power output power amplifier performance, the tcr of the resistor and the voltage applied across it, may become quite influential to what is observed in a spectrum plot of harmonic distortions.

I will try and compare my test loads soon when I start testing a low distortion power amp of significant output voltage swing, as I have a variety test loads from tubular 150W wire-wounds to multiple series/parallel PRO3 resistors that divide down the voltage across resistors.
 
I am using REW in linux (Mint 19), works very good.

The startup script searches for available JDKs, looking for java 1.8. It is simple to add openjdk 8 to mint


Code:
sudo aptitude install openjdk-8-jdk
The package is available in all ubuntus Ubuntu – Package Search Results -- openjdk-8-jdk


I just tested REW works perfectly with the latest Oracle JDK14, only the JAXB API removed from java > 8 need to be copied to the REW directory (jakarta.xml.bind-api-2.3.2.jar) + simple change in the startup script. I have not tested JDK builds from other providers, but IMO there is no reason to not work.

I am happy for that because newer JVMs implement many performance improvements and especially feature the new low-latency garbage collector ZGC - REW runs great with it enabled. I get almost no stream discontinuities in RTA at 96kHz samplerate.

John, thank you, fantastic work!


Could you please kindly write what that "simple change in the startup script" is (related to Oracle JDK14), and into which file was it done and in which directory that file is. Reason: those performance improvements noticed by you sound great!
 
I have been using REW and a Behringer UCA222 to measure performance of a vintage amp I'm rebuilding. I know the UCA222 is not the best choice, but works fine in my application.

What I'm finding a little surprising is that if I forget to unplug my laptop from the charger when I take a measurement, the distortion products all rise substantially. I can understand the noise level going up due to the induced ground loop, but have been surprised that the distortion harmonics rise by maybe 10 dB. Why would that be? Is the added noise modulating the signal and creating more energy at the harmonics? I failed to get screen captures of the effect, but can in a couple days when yet more replacement parts arrive and I have to heft the 50-lb amp back up on my bench.

I had also noticed when I move the amplifier/heatsink assy from my bench into the housing (and thus closer to the 1.5kW transformer) the distorion rises, and now I'm wondering if that is just a measurement anomoly caused by increased 60Hz noise and not an actual rise in distortion.
 
Yeah, I probably should have waited until I got some screen captures to post. Typically I generate a 1k tone and look at the RTA screen. The discrete harmonics (2k, 3k, 4k, ...) all go up if I leave the charger connected. I never bothered to capture the effect - just disconnected the charger and made my measurement. But then I was getting frustrated with the distortion rise when I put the amp assy in the chassis and I started wondering about whether that rise was similar to the charger related distortion increase. I'll post some screen shots in a couple days.

On a good day the amp is doing 0.005% THD on one channel, about 0.008% on the other, driving 5W into an 8-ohm load. If I drive the load through the 70C thermal fuses on the heatsink the distortion goes up about 10x, dominated by third harmonic. Presumably the 45-year old contacts are oxidized. Tried to "clean" them by running a couple amps through them to no avail. New ones are on their way.
 
Doesn't work like that - distortions may be cancelling each other out or reinforcing each other or anything in-between, so that the actual distortion might be as bad as 0.015+0.007 = 0.021% (the amp's 0.021% distortion cancelled the loopback distortion and then some).


Its best to quote the amp figure and the loopback figure so that the uncertainty in the measurement is explicit.

Agreed, however REW does give you the phase of the distortion product, so if you were bound and determined to do some subtraction, you should do vector subtraction, not simple scalar subtraction. I would, however, not advise doing that since the distortion product is unlikely to be a simple vector, even though REW summarizes it as such. But yeah, simply subtracting the numbers is not valid.
 
Yeah, I probably should have waited until I got some screen captures to post. Typically I generate a 1k tone and look at the RTA screen. The discrete harmonics (2k, 3k, 4k, ...) all go up if I leave the charger connected. I never bothered to capture the effect - just disconnected the charger and made my measurement. But then I was getting frustrated with the distortion rise when I put the amp assy in the chassis and I started wondering about whether that rise was similar to the charger related distortion increase. I'll post some screen shots in a couple days.

On a good day the amp is doing 0.005% THD on one channel, about 0.008% on the other, driving 5W into an 8-ohm load. If I drive the load through the 70C thermal fuses on the heatsink the distortion goes up about 10x, dominated by third harmonic. Presumably the 45-year old contacts are oxidized. Tried to "clean" them by running a couple amps through them to no avail. New ones are on their way.

OK, replacement parts came early, put the amp back on my bench and figured it all out. In my defense I will mention that when I saw the increased distortion I did not study it, just quickly disconnected the charger and made my measurement. It was long after the fact that I began to be bothered by it. So this time I looked closely at the ground loop injected noise and saw all the 60 Hz harmonics, some of which fell right on top of the 1kHz harmonics (duh!). By moving the frequency from 1000 up to around 1015, the harmonics of the 60Hz ground loop no longer fell on the harmonics of 1015 and the distortion returned to the same level as without the ground loop - just residual noise as expected. :)
 
Member
Joined 2019
Paid Member
Getting Started - Totally New to This

I must have read this thread over 5 times end-to-end over the last 6 months or so. I thought I'd be all ready to go for when my Focusrite arrived.

I have a bit to learn about the setup still, obviously. Over time, I've learned that generally, my lack of measurement skills and some fundamental lack of understanding of even exactly what is being measured... and its meaning... has lead me astray.

So, I am trying to do this properly.

I am stuck on page one.

I have:

1) Successfully installed REW and made my donation
2) Installed the Focusrite "Control" software, although I don't think it's needed for this use. I did change the sample rate within Focusrite to 96k per some recommendations. If I understood properely.
3) Learned a bit about how to navigate within REW.
4) Found the main preferences menu - here and hit a roadblock.

Screen Shot 2020-04-29 at 6.17.01 AM.png

"Then choose your input device as your sound card and your output device as your sound card."

Got it. See pic.

"Choose input and output amplitude to be “Master” and set to amplitude of 1.0 - this lets the full signal be generated by the sine wave generator and the full signal be captured by the ADC."

Cannot find this anywhere. Am I in the wrong menu?

"On the input settings choose the channel where you will connect your amp’s load resistor. Channel 1 is typically the “Left” channel and channel 2 is “Right”."

I can't determine where this setting might be found either. For the Input - it will not me select anything other than default device or microphone. Since the amp's load resistor sees the input of the Focusrite, is that in the Focusrite control? If so, I didn't see that.

I went ahead to setting the RTA parameters per post #1. That seems successful.

Screen Shot 2020-04-29 at 6.31.16 AM.png

"At this point you can see what the inherent self noise of your sound interface is without anything connected. Click on the “RTA” button along the top. In this dialog, click on the gear to adjust the settings. I use something like this:"

Even though I haven't set the master volume yet, I wanted to try the measurement. Below is a screenshot of the RTA with only the 4i4 connected to USB and nothing else. - Note Macbook Air - Battery power

Screen Shot 2020-04-29 at 6.51.29 AM.png

Next up is to wire up the testing rig. I have some 22k1 and 2k21 resistors for my voltage divider. So as long as I can find where I hid my XLRs, RCAs, and banana plugs etc, I should be good to go.

Any help is appreciated.

Thanks again to XRK971 for this great resource!
 
Member
Joined 2019
Paid Member
I think I have a portion of it figured out, but not 100%, clearly. I can't even get a simple loopback measurement to work as intended. I found proper cabling in my parts bin. Fortunately, I had a TRS to XLR.

Verified wiring is -

TRS to XLR.gif

Corrections to above.

I learned a bit about the Focusrite Control software and its input / output routing - related to my blue / red posts above. I think that clearly was intended to be within the Focusrite software vs. within REW. :blush:

I still have not found the way to set something to "Master", and that could be part of my issue, but clearly I can send a "full range" digital signal that the Scarlett processes. BTW - not a bad little USB DAC/Amp! :D

Whether that signal is coming back fully in digital form to REW or not, I have no idea.

I am still stumped - but I read more ... and more.

In essence, I think what we're trying to accomplish (but please chime in if I'm off in outer space) is to determine through a loopback with a test tone what noise the Focusrite / Computer chain adds, so we don't mistake that for our amplifier distortion when the signals are combined.

1) Send the test tone from the computer (REW) to the Focusrite (DAC) over USB.
- Audio output on computer and within REW to Scarlett
- Play tone
- Verified functioning properly by listening to the tone through HPs on Scarlett and viewing meters in Control

2) Loop the signal (Loopback) - Send the analog output of the test tone to an analog input on the Focusrite - loop it
- Within Control Input settings (front) left at Line vs. Instrument - No PAD, No AIR
- In REW set output of generator to 1 (Left)
- In Output Routing - Changed Monitor Output 1 to Playback 1 (DAW) - Set to Mono
- Verified tone output goes through Monitor Output 1. Control showing signal
- Connected Line Out 1 (back of unit) to Analogue Input 1 (front of unit) with TRS to XLR
- Verified working with both physical monitor "volume" for output 1 and gain. They both function for Input 1 and indicate proper levels both within Control and showing relative signal level on front display (Red / Yellow / Green) as levels are adjusted.
- Also verified by using Output 3 (non-monitor / non-attenuated line output) looped to Input 1.


3) Send resulting signal from the Scarlett input back to the computer (REW) for analysis over USB after ADC processing from Scarlett and capture in REW RTA.
- Stumped!
- I see a lovely 1kHz signal being captured.
- When I set the test tone to -3dB, no matter how much gain or "monitor volume" using input 1 - I can't get the signal to rise above ~(-)110dBFS. I thought it should be right at -3dBFS if things were working as intended.

Some screenshots and a pic of setup. Running from output 3 non-attenuated to input 1.

Screen Shot 2020-04-30 at 7.53.15 AM.png

Screen Shot 2020-04-30 at 7.56.03 AM.png

Screen Shot 2020-04-30 at 7.56.26 AM.png

Screen Shot 2020-04-30 at 7.56.49 AM.png

Screen Shot 2020-04-30 at 7.59.25 AM.png

IMG_1906.jpg

Clearly, I am missing something fundamental. I've read and read. Any help in understanding how I'm either misinterpreting what's supposed to happen and/or how I may have set this up incorrectly would be be greatly appreciated.

With thanks in advance :D :cheers:
 
Don't leave the input and output set to default, select the actual input and output. When you have done that you will have the option to allow the OS input and output volume controls to be adjusted from the REW soundcard preferences. They should usually be set to 1.0.
Your REW soundcard preferences screenshot showed input channel set to 2, have you changed that to channel 1? Make sure your connections match the channels you have told REW to use.
Use a more current version of REW.
 
Member
Joined 2019
Paid Member
Thank you so much! I think I have it sorted, mostly. :D


Done, I didn't know if it was advisable to use Beta versions. Updated to latest.

Don't leave the input and output set to default, select the actual input and output. When you have done that you will have the option to allow the OS input and output volume controls to be adjusted from the REW soundcard preferences. They should usually be set to 1.0.

Where I get confused is that there is no option other than Default Output and Speaker, and Default Input and Microphone. However, it seems default works.

How do I set the input and output volume controls to 1.0? I just can't find that anywhere, or is there supposed to be another dropdown? I did notice that the physical monitor (output) volume knob on the Focusrite seems to now be disabled, but not the input gain.

See below for options.

Screen Shot 2020-04-30 at 9.32.19 AM.png

Screen Shot 2020-04-30 at 9.32.28 AM.png

Your REW soundcard preferences screenshot showed input channel set to 2, have you changed that to channel 1? Make sure your connections match the channels you have told REW to use.

AHA!!!!!! Sheesh, I am a goof. If I had just run it to the "right input" I'd have been golden. Fixed. Now for some reason every time I open the software the input moves to Microphone. I'll just have to remember to switch it. It makes sense since the software is used for room correction.

More importantly - It seems to be working! :D Below are screenshots while running the test tone per the screenshot.

Screen Shot 2020-04-30 at 9.43.25 AM.png
Screen Shot 2020-04-30 at 9.44.01 AM.png
Screen Shot 2020-04-30 at 9.49.53 AM.png

Once again, thank you! I knew it had to be something foolish.

For anyone else with this model Focusrite that is struggling - there ya go! Don't be a dolt like me :joker:

Now to calibrate REW with the Focusrite and play a bit. :D
 
Member
Joined 2019
Paid Member
@JohnPM - Apologies. I had to step away last night.

Now I admit that I am even more confused. If the output is the speaker and the input is the microphone on the laptop... how does the computer get the signal from the Focusrite? I tried it anyway.... no joy. No signal either into (and thus out from) the Focusrite.

When I had input and output devices set to Focusrite and input and output set to default (two separate dropdowns) it seemed to work properly. I was adjusting the level within the Focusrite Control software and it seemed to work properly. Am I mistaken re: how it is supposed to work? :confused:

I hate to ask ridiculous questions, but something absolutely is not clicking.

I read most of the REW manual this morning... I thought I had it right. Are the plots and screenshots in the previous post not correct? It calibrated properly (I think) this morning.

Perhaps I should try it on my PC - I'd prefer to use the laptop for battery power etc, but maybe the PC software is easier to use. I donated for two copies, so I don't think that would be uncool.
 
If the output is the speaker and the input is the microphone on the laptop... how does the computer get the signal from the Focusrite? I tried it anyway.... no joy. No signal either into (and thus out from) the Focusrite.
"Speaker" and "Microphone" are just generic labels for the device I/O, they have nothing at all to do with the laptop audio connections. Leave the Input Device and Output device as the Focusrite. If the Input and Output selections only work if left as Default then perhaps the Focusrite software is doing something strange with the I/O. It isn't a big problem to leave them as default for stereo connections, but it would be a problem for multichannel interfaces.