Howto - Distortion Measurements with REW

I have been using the excellent and free software package called REW and a sound interface card (or DAC/ADC) to measure my amps for years now. It’s fast, easy and really costs nothing if you have a sound interface already. REW is normally used for measurement of speakers with microphones, however, it’s interface, GUI, and math engine are top-notch and lend themselves to an excellent amp measurement tool. I have been asked numerous times via PM’s to assist DIYA members make their own measurement setup using REW. Recently, I was asked again in the M2X thread when I chimed in that one doesn’t need expensive dedicated distortion analyzers from HP/Agilent/etc. all you need is a decent sound interface and REW. Plus a dummy load resistor and some wiring.

First of all, I want to thank member John Mulcahy, the author of REW - what a wonderful gift he has given to the DIY community. He is also always there to answer as technical question on REW.

So what can a sound card and REW do for you in terms of audio distortion measurement? Here is a typical FFT spectrum that I took using a $99 Focusrite Solo USB sound interface and REW with the Alpha 20 amp. This is 2.83vrms into 8ohms:
661737d1518324741-aksa-lender-mos-hybrid-aleph-alpha-amplifier-alpha-20-2-87vrms-8ohms-fft-png


The plot above tells us several things about this amp: it has a dominant second harmonic distortion signature (sweet sounding), it has a little third order (gives it some bite), it’s devoid of higher orders, or higher odd orders specifically, which can sound fatiguing; it has an overall low level of total harmonic distortion (as seen in onset window); the mains noise at 60Hz and 120Hz is essentially zero - that is, it is very quiet and hum free; finally, the noise floor is about -110dB below the signal so it has very black blacks.

How hard is it to take this data? Well that’s the purpose of this thread. To show you how easy it is to do.

Another example of how REW can tell you how to tune your amp to achieve a harmonic distortion profile of interest. Some amps have this variable knob that lets you tune the type and level of distortion to your liking:

DLH Amplifier: The trilogy with PLH and JLH amps

Here is an example of measuring a preamp driving a 7k ohm load, this is the Aksa Lender putting out 20Vpp into 7kohms:
654180d1514879318-aksas-lender-preamp-40vpp-ouput-gb-aksa-lender-pre-melf-20vpp-7kohm-fft-rt-png


So where to begin? Let’s start with getting a copy of REW on your computer. Works on PC or Mac but I am only familiar with the PC version. Go here to download REW, and while you are at it, please donate some funds to John Mulcahy to continue his excellent work.

REW - Room EQ Wizard Room Acoustics Software

Once you install it, install software or drivers for your sound interface. I have used even the built in sound card in a PC to do this and it can work. However, those are generally very noisy and you won’t get the nice -130dB noise floor that some standalone interfaces can achieve. I personally use a Focusrite Solo (2nd gen) and 2i4 (2nd gen). They both have the same ADC’s but the 2i4 has a front end that is more flexible. I also think it has slightly better low noise characteristics. But you can use any sound card as long as it is supported by REW - and that includes any Java supported card. I haven’t found one that is not supported yet.

Next step is to connnect your interface by plugging in the USB cable, for example. Some of you might have other interfaces. The go into the setup menu and configure the sound interface. I typically the non-ASIO interface as I find that more finicky to work. Then choose your input device as your sound card and your output device as your sound card. 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.

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”.

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:
759469d1559065630-diyaudio-watt-m2x-rew-rta-setup-jpg


You can try other settings. Making the averages smaller like 0.88 exponential and choosing 32k points will give you almost real-time updates to the FFT. You need to click on the span button to set your range of measurement from say 20Hz to 20kHz. On the vertical scale button on upper left click on dBFS. Then click on the red button to acquire your FFT spectrum.

You will see a relatively flat spectrum (hopefully) but this will tell you what the noise floor of your setup is. A cheap built in sound card on my pc only gets -110dB. The Focusrite get -130dB. There are ways to achieve better noise floor and much is discussed in threads elsewhere. For many of our SS amps around here the typical noisefloor of the Focusrite is fine as distortion is typically no lower than -100dB abd typically -80dB or so.

This is all fine and good but how do we measure distortion in our amps? Well we first need to make a dummy load resistor to simulate your speaker load. You need a power resistor with the same impedance as your amp that you are testing. Typically 8ohms or 4ohms. It also needs to handle the amp’s power output. A good one is a metal shelled 25w resistor mounted to a heat sink.

Here is an example of one with the wires you will need to make to connect it to a sound interface:
759760d1559165648-howto-distortion-measurements-rew-5e111239-60db-4589-852d-a737c60b96a3-png


Here is a sketch of how to connect your load resistor to the sound interface and the PC:
759761d1559165648-howto-distortion-measurements-rew-a6089679-b353-4e2b-abd2-b248adb1a49a-jpeg


For measurements of amp power up to 1w (8Vpp) it’s ok to connect the dummy load to your sound card directly. However, if your amp ever had a burp and hits the interface input preamp with too much voltage it can fry the input stage. I would recommend adding a ~10:1 voltage divider using a 20k and 2k resistor and taking the middle node attenuated output as the signal to your sound interface.

Depending on your sound interface, they may be good for 20v max input so that would give you pretty good protection. Never put full 25wrms (40Vpp) into your sound interface unless you want to fry it.

Now you need a way to generate your 1kHz (or whatever frequency you like) excitation sinewave. You can use the audio output of your sound card and the built in generator in REW. Then connect the audio out of the sound interface to your amp’s input. Adjust the level using the amp’s volume knob if you have one or the knob built into the Focusrite or the level in the generator interface.

Another way is to use an independent reference frequency source. A dedicated low noise high precision generator from HP is expensive. You can use a digital audio player with a good DAC as your source. I use a Cayin N3 which has the excellent AKM4490 DAC. Create a 1kHz sound file in lossless flac format using a program like audacity. Then play that into your amp as the excitation source. Those has the benefit of decoupling your source from your measurement to avoid ground loops. Especially if the source is a battery powered DAP. It’s also typically quieter.

So now connect your audio source to your amp, connect your amp to your dummy load, connect your audio interface to the dummy load, and connect a DVM to the dummy load and set to AC volts. Increase or decrease the amplitude of the 1kHz sine wave until the DVM reads 2.83vac. That’s same as 1w into 8ohms. A typical standard at which distortion measurements are taken.

That’s all for now. I will update later as I did this post with my phone and will get back with more details. But this should get many of you started.

Update June 3, 2019: Here is a loopback using Focusrite Solo gen2 and Akitika 2ppm 1kHz oscillator at 1.0Vpp into 10k:
859503d1594364639-howto-distortion-measurements-rew-akitika-2ppm-loopback-solo-jpg


Update Sept 24, 2020: member Wtnh made a very nice and useful schematic and connection diagram for us to use. Although he used an EMU sound interface, a lot of it applies to other sound interfaces as well (like Focusrite, or any other with combo XLR/TRS balanced inputs):
877780d1600788493-howto-distortion-measurements-rew-emu-setup-png
 

Attachments

  • 5E111239-60DB-4589-852D-A737C60B96A3.png
    5E111239-60DB-4589-852D-A737C60B96A3.png
    763.2 KB · Views: 13,026
  • A6089679-B353-4E2B-ABD2-B248ADB1A49A.jpeg
    A6089679-B353-4E2B-ABD2-B248ADB1A49A.jpeg
    376.2 KB · Views: 13,412
Last edited:
XRK,

Questions for you.

What is your measurement bandwidth here and how does that affect the accuracy of the measurements in the upper frequencies? Can you change that within REW?

Do you recommend the Focusrite 2i4 for those of us that have amplifiers with true differential or balanced inputs?

As you state, this method seems appropriate for many diyaudio based amplifiers, although there are a few commercial and diy ones where this method may not cut it, i.e. measuring a Benchmark AHB2, Tom Christiansen's Modulus 286/686, Hypex NCore series of amplifiers, etc...all of these amps seem to challenge even some of the finest Agilent/HP distortion analyzers out there today.

Thanks,
Anand.

Thanks,
Anand.
 
I measure at 48kHz which should be good for 24kHz based on Nyquist. The Focusrite is capable of higher - in ASIO (192khz I think). Which would be good for 96kHz. Although I am not sure what the Focusrite’s input bandwidth is.

To measure ultralow distortion amps, there are tricks to play. But if one is serious about sub ppm THD, maybe get an AP etc. for most DIY amps, it’s quite adequate. What we are interested here are the 0.001% to 1% range. There are lots of great sounding amps in the 0.05% range but it’s not the abosolute level, it’s the spectrum and where the harmonica are.
 
I measure at 48kHz which should be good for 24kHz based on Nyquist. The Focusrite is capable of higher - in ASIO (192khz I think). Which would be good for 96kHz. Although I am not sure what the Focusrite’s input bandwidth is.

.....

So when you say you measure at 48khz, do you mean through the REW Preferences tab and setting the sample rate?

Best,
Anand.
 

Russellc

Member
Paid Member
2003-03-06 12:59 am
midwest
A pic of this wiring interface actually hooked up would clear things up a little for me. Looking at back of Focusrite, I see the USB jack, which would connect to computer USB, simple enough.

Then a standard RCA interconnect goes from one of the two focusrite's RCA to one of the two RCA inputs on the amp/DUT.

That leaves the output on the amp/DUT, and -, the multimeter and the Focusrite line input.
Remaining wires from the interface wiring are 2 banana jacks, and two insulated spade lug connectors......unclear how the remaining connectors are fitted.

Also, what is the small black square thing that appears to hold 2 resistors, which I assume are the 20k and 2k resistors that form the voltage divider? Where do the two spade lugs and two banana plugs go? Sure would clear it up to see a pic of it hooked up, if possible.

Maybe one banana plug in Multimeter and one in focusrite's input? ( cant tell what kind of plug it is from the pic) Two spade lugs attached to matching spades with connectors to the amp/DUT outputs?

Thanks,

Russellc
 
Last edited:
That’s a nice oscillator for $79. I might just get one. I use this function all the time.
Thanks, Anand.

Russellc, sure - I will show this all hooked up. The funny little black connector is a 3.5mm female TRS jack. That let’s me use a 3.5mm male to RCA to go to Focusrite input via a RCA to 1/4 in guitar plug.

The banana and female spade let me connect to the amp outputs. Banana for back panel on amp and spade for directbto the PCB amp outputs - useful when amp is on bench and not even installed on a chassis (most of the time my amps have no chassis).
 
For the Solo there is not a TRS balanced input. Just XLR, so you will need an XLR to RCA adapter. However, I have noticed that sometimes using the balanced input gives better noise performance. That is, connect your dummy load across the pins 2 and 3 of the XLR and leave off the ground (drain) pin 1. You cannot do this with a XLR to RCA adapter as those have the RCA GND to pin 1 and bypasses the differential input feature.



On the 2i4, the XLR jack has a central hole that allows you to use a stereo TRS 1/4in plug. You can use a blank plug (designed tonsolder your own wires) and connect your dummy load to the tip and ring, leave the sleeve not connected.

The differential mode input seems to have better results from extraneous noise. Another tip, sometimes the PC power supply adds noise or causes hum or ground loops. You can try disconnecting PSU from laptop and run in battery mode.

These are all the sorts of things that require trial and error to see what works best for you. I highly recommend and independent 1kHz excitation source though.
 
This is a very handy thread.

I've been wondering how to get started measuring using REW or some other software.

Its appealing since I have been looking at low cost options that don't rely on me manually reading off harmonic series values from the DSO at work, and then typing into a calculation sheet to give a % value.

Seeing as I have been looking at cheap solutions, the following questions occurs to me?

Can you tell us, what advantage the use of a Ext USB SFX card has over something of similar price - picoscope 2200 scope?

Off the top of my head the Pico is 8 bit ADC, and only 10Mhz (I can't recall the kS/s data rate) so perhaps amplitude resolution is limited (though they do use some form of ETS to increase the resolution nearer 12bit)

Now a soundcard (focusrite, behringer, alesis all the basically the same card IIrC) is 24bit depth, much less BW.

What would be interesting is how to/what level loopback THD is measured in REW using a typical budget USB sound card set up, such as yours (or mine, when I get round to buying a new card)

I imagine the Picoscope measurement floor is perhaps higher, discriminating 0.25% THD and 0.05% may be impossible.

whether it necessary to make that discrimination is something I'm not sure about.
 

6L6

Moderator
Paid Member
2010-10-22 6:43 pm
Denver, Colorado
Fantastic writeup!! My sincere thanks - I've been looking for a simple solution like this, I was using some Mac only software and an old computer (that still had analog mic input!) and that machine bricked after a too-new OS update.

Tried a loopback of the software generator though my Focusrite 2i2 getting decent results. Need to attach a power amp and see what can be seen. :)
 

Russellc

Member
Paid Member
2003-03-06 12:59 am
midwest
That’s a nice oscillator for $79. I might just get one. I use this function all the time.
Thanks, Anand.

Russellc, sure - I will show this all hooked up. The funny little black connector is a 3.5mm female TRS jack. That let’s me use a 3.5mm male to RCA to go to Focusrite input via a RCA to 1/4 in guitar plug.

The banana and female spade let me connect to the amp outputs. Banana for back panel on amp and spade for directbto the PCB amp outputs - useful when amp is on bench and not even installed on a chassis (most of the time my amps have no chassis).


Much appreciated will look forward to additional photos.

Very much appreciated!

Russellc
 
Here is a photo of a typical measurement setup. The dummy resistor is connected to the amp outputs via the banana plugs. The dummy load is connected to a voltage divider which is connected to the Focusrite input via a 3.5mm to RCA cable and RCA to XLR adapter. The DVM (yellow Fluke 101) used for measuring the AC volts is connected directly across the dummy resistor with alligator clips. The output RCA of the Focusrite is connected to the amp RCA in.
 

Attachments

  • 5A577D91-8B43-47E7-BB4D-0C4F116E6FA6.jpeg
    5A577D91-8B43-47E7-BB4D-0C4F116E6FA6.jpeg
    310 KB · Views: 2,574
Can you tell us, what advantage the use of a Ext USB SFX card has over something of similar price - picoscope 2200 scope?

Off the top of my head the Pico is 8 bit ADC, and only 10Mhz (I can't recall the kS/s data rate) so perhaps amplitude resolution is limited (though they do use some form of ETS to increase the resolution nearer 12bit)

These tools are for different purposes. One is to really see transient features, the other is to record high resolution (in amplitude) but lower frequency. Can you use REW with the USB OScope to get the FFT?

The new Behringer UC2 for $38 really makes “cost” a moot point. Based on reviews I would imagine it will work just fine. Even at $99 for the Focusrite Solo, the cost is not unreasonable as the unit in itself is an excellent DAC for playing music as a source.
 
Thank you for pointing me to REW as distortion analyzer software, xrk971 !

Because I already had the Focusrite 2i2 and a self-built attenuator box (-6 dB to -30 dB in 6 dB steps), and making use of the opportunity that today is a holiday in our part of Germany, I could do some quick measurements of my SissySIT.

The results I have posted here:

https://www.diyaudio.com/forums/pass-labs/326536-sissysit-79.html#post5807668

I also did some measurements of my Wayne BA 2018 linestage and a quick check of my Aikido tubed linestage, but I need to do a write-up of these measurements first before showing the pictures.


I find REW easier to use than ARTA, which I have used so far. For me (WIN7) the ASIO drivers worked better than the Java drivers - might be because I had used ARTA before and drivers were still loaded at some Windows interface point or another ...

Here is the self-noise of the Focusrite 2i2:


attachment.php


And here the loop-back with the level control of the Focusrite optimized for lowest distortion - that give near to the lowest noise as well. Digital output level is - 3dBFS, analog output level is 0.707 V. These settings I have used for all my distortion measurements so far:


attachment.php


Note also the small 50 Hz hump (European mains frequency). These measurements were done with my laptop and the Focusrite on the sofa, totally battery-powered, no electrical outlet nearby, and no significant current draw in the whole room.:rolleyes: I believe some of the 50 Hz noise I will show on some preamp measurements later is probably pick-up from other equipment nearby or the mains cables in the wall.


Here is the switchable attenuator I built, also using green protection LEDs against overvoltage:

attachment.php


The design of the attenuator I picked up from Dan Joffe. He started it all in this thread:
https://www.diyaudio.com/forums/equ...ment-soundcard-arta-software.html#post5183956

The 1 kHz oscillator (post #12 in the thread above) had already been mentioned in this thread at #9. On the Akitika website, towards the bottom of the page with the 1 kHz oscillator, is a link to a document describing the attenuator. That's what I referred to to build it. ;)

1 kHz Oscillator


All the best, Claas
 

Attachments

  • FR 2i2 Self-Noise 96 kHz 190530.png
    FR 2i2 Self-Noise 96 kHz 190530.png
    89.4 KB · Views: 4,183
  • Loopback 1 - gen -3 dB old default level.png
    Loopback 1 - gen -3 dB old default level.png
    59.3 KB · Views: 4,167
  • Attenuator and 2i2 small.jpg
    Attenuator and 2i2 small.jpg
    421 KB · Views: 4,067
Hi Chede,
Thanks so much for trying this out. Your Focusrite 2i2 shows excellent performance on the loopback. I just ordered the 1kHz ppm oscillator - seems essential to reach the 0.0008% THd figure that you got.

I’m curious if you used the balanced differential input to the Focusrite or just single ended using and XLR to RCA adapter?

I recently tried the ASIO driver and it works fine on Win10.

Your SissySIT amp measurements look great too. The profile on that amp must sound wonderful. I see a forest of noise from the mains though. You might consider an SLB to help smooth some of that out.
Cheers,
X
 
Last edited: