diyAudio

diyAudio (https://www.diyaudio.com/forums/index.php)
-   Software Tools (https://www.diyaudio.com/forums/software-tools/)
-   -   Howto - Distortion Measurements with REW (https://www.diyaudio.com/forums/software-tools/338511-howto-distortion-measurements-rew.html)

xrk971 29th May 2019 09:12 PM

Howto - Distortion Measurements with REW
 
2 Attachment(s)
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:
https://www.diyaudio.com/forums/atta...-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:
https://www.diyaudio.com/forums/atta...ohm-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:
https://www.diyaudio.com/forums/atta...-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:
https://www.diyaudio.com/forums/atta...37c60b96a3-png

Here is a sketch of how to connect your load resistor to the sound interface and the PC:
https://www.diyaudio.com/forums/atta...8adb1a49a-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:
https://www.diyaudio.com/forums/atta...-10khz-fft-jpg

poseidonsvoice 29th May 2019 10:57 PM

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.

xrk971 30th May 2019 12:01 AM

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.

poseidonsvoice 30th May 2019 12:28 AM

Quote:

Originally Posted by xrk971 (https://www.diyaudio.com/forums/software-tools/338511-howto-distortion-measurements-rew-post5806637.html#post5806637)
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.

AKSA 30th May 2019 12:48 AM

Thank you X!
This is a great primer for digital/analog distortion measuring. So much cheaper than a AP2.......

Hugh

xrk971 30th May 2019 12:56 AM

Quote:

Originally Posted by poseidonsvoice (https://www.diyaudio.com/forums/software-tools/338511-howto-distortion-measurements-rew-post5806660.html#post5806660)
So when you say you measure at 48khz, do you mean through the REW Preferences tab and setting the sample rate?

Best,
Anand.

Yes

poseidonsvoice 30th May 2019 02:31 AM

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.

Russellc 30th May 2019 03:26 AM

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

poseidonsvoice 30th May 2019 03:54 AM

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

https://i.imgur.com/qo9ozON.jpg

https://i.imgur.com/tNUUe8Z.jpg

Best,
Anand.

xrk971 30th May 2019 06:15 AM

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


All times are GMT. The time now is 09:42 AM.


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

Wiki