Go Back   Home > Forums > >
Home Forums Rules Articles diyAudio Store Blogs Gallery Wiki Register Donations FAQ Calendar Search Today's Posts Mark Forums Read

Software Tools SPICE, PCB CAD, speaker design and measurement software, calculators

Howto - Distortion Measurements with REW
Howto - Distortion Measurements with REW
Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 29th May 2019, 09:12 PM   #1
xrk971 is offline xrk971  United States
Got Foam?
diyAudio Member
 
xrk971's Avatar
 
Join Date: Oct 2012
Location: Metro DC area
Howto - Distortion Measurements with REW
Default 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:
Click the image to open in full size.

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:
Click the image to open in full size.

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:
Click the image to open in full size.

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:
Click the image to open in full size.

Here is a sketch of how to connect your load resistor to the sound interface and the PC:
Click the image to open in full size.

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:
Click the image to open in full size.
Attached Images
File Type: png 5E111239-60DB-4589-852D-A737C60B96A3.png (763.2 KB, 1945 views)
File Type: jpeg A6089679-B353-4E2B-ABD2-B248ADB1A49A.jpeg (376.2 KB, 1934 views)
__________________
XRKaudio https://www.etsy.com/shop/XRKAudio

Last edited by xrk971; 3rd June 2019 at 02:23 PM.
  Reply With Quote
Old 29th May 2019, 10:57 PM   #2
poseidonsvoice is offline poseidonsvoice  United States
diyAudio Member
 
poseidonsvoice's Avatar
 
Join Date: Jul 2004
Location: North Carolina
Howto - Distortion Measurements with REW
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.
__________________
Science is not a democracy - Earl Geddes
DIYAudio is a journey not a destination!
  Reply With Quote
Old 30th May 2019, 12:01 AM   #3
xrk971 is offline xrk971  United States
Got Foam?
diyAudio Member
 
xrk971's Avatar
 
Join Date: Oct 2012
Location: Metro DC area
Howto - Distortion Measurements with REW
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.
__________________
XRKaudio https://www.etsy.com/shop/XRKAudio
  Reply With Quote
Old 30th May 2019, 12:28 AM   #4
poseidonsvoice is offline poseidonsvoice  United States
diyAudio Member
 
poseidonsvoice's Avatar
 
Join Date: Jul 2004
Location: North Carolina
Howto - Distortion Measurements with REW
Quote:
Originally Posted by xrk971 View Post
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.
__________________
Science is not a democracy - Earl Geddes
DIYAudio is a journey not a destination!
  Reply With Quote
Old 30th May 2019, 12:48 AM   #5
AKSA is offline AKSA  Australia
diyAudio Member
 
Join Date: Sep 2001
Location: Melbourne, Australia
Thank you X!
This is a great primer for digital/analog distortion measuring. So much cheaper than a AP2.......

Hugh
__________________
Aspen Amplifiers P/L (Australia)
www.aksaonline.com
  Reply With Quote
Old 30th May 2019, 12:56 AM   #6
xrk971 is offline xrk971  United States
Got Foam?
diyAudio Member
 
xrk971's Avatar
 
Join Date: Oct 2012
Location: Metro DC area
Howto - Distortion Measurements with REW
Quote:
Originally Posted by poseidonsvoice View Post
So when you say you measure at 48khz, do you mean through the REW Preferences tab and setting the sample rate?

Best,
Anand.
Yes
__________________
XRKaudio https://www.etsy.com/shop/XRKAudio
  Reply With Quote
Old 30th May 2019, 02:31 AM   #7
poseidonsvoice is offline poseidonsvoice  United States
diyAudio Member
 
poseidonsvoice's Avatar
 
Join Date: Jul 2004
Location: North Carolina
Howto - Distortion Measurements with REW
X,

Thanks. I see that REW offers 96khz sampling rate in Java and since the Focusrite 2i4 can at least do that, that means an even more extensive bandwidth. Good options to have 48khz and 96khz.

Best,
Anand.
__________________
Science is not a democracy - Earl Geddes
DIYAudio is a journey not a destination!
  Reply With Quote
Old 30th May 2019, 03:26 AM   #8
Russellc is offline Russellc  United States
diyAudio Member
 
Join Date: Mar 2003
Location: midwest
Howto - Distortion Measurements with REW
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
__________________
Pass B-1 preamp, Pass BA3 preamp, Wayne's 2018 LS, Pass F-5 Amp, Pass F-6 Amp, Pass BA-3 Amp, Pass M-2 amp, Pass Aleph J amp, Pass Pearl 2 Phono pre Tekton Enzo, Altec A7, Econowave JBL 2235H & B&C CD

Last edited by Russellc; 30th May 2019 at 03:45 AM.
  Reply With Quote
Old 30th May 2019, 03:54 AM   #9
poseidonsvoice is offline poseidonsvoice  United States
diyAudio Member
 
poseidonsvoice's Avatar
 
Join Date: Jul 2004
Location: North Carolina
Howto - Distortion Measurements with REW
Quote:
Another way is to use an independent reference frequency source. A dedicated low noise high precision generator from HP is expensive.
There are other options. For example I built from AKITIKA their 1khz 2 ppm oscillator. See here: 1 kHz Oscillator

Click the image to open in full size.

Click the image to open in full size.

Best,
Anand.
__________________
Science is not a democracy - Earl Geddes
DIYAudio is a journey not a destination!
  Reply With Quote
Old 30th May 2019, 06:15 AM   #10
xrk971 is offline xrk971  United States
Got Foam?
diyAudio Member
 
xrk971's Avatar
 
Join Date: Oct 2012
Location: Metro DC area
Howto - Distortion Measurements with REW
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).
__________________
XRKaudio https://www.etsy.com/shop/XRKAudio
  Reply With Quote

Reply


Howto - Distortion Measurements with REWHide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Distortion and Other Measurements ????? SyncTronX Equipment & Tools 8 29th April 2014 06:57 AM
Distortion measurements, THD, IMD-what card? Eugene Dvoskin Solid State 24 1st January 2011 06:11 PM
Distortion Measurements Nikon1975 Tubes / Valves 8 1st March 2010 12:57 PM
How to do IM distortion measurements? Conrad Hoffman Parts 1 28th May 2007 06:09 PM
Distortion measurements Vg Multi-Way 5 13th August 2004 11:32 AM


New To Site? Need Help?

All times are GMT. The time now is 03:08 AM.


Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 14.29%
vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
Copyright ©1999-2019 diyAudio
Wiki