Separate/different simultaneous output signals for L and R.

jan.didden

New Member
Thread Starter
Joined
May 14, 2020
Posts
29
Hi, I want to output two different signals, one from the L channel and the other from the R channel.
I tried the two-tone generator setup but both tones are output to both :L and R. I need one tone to be output from L and the other tone from R, at the same time.
Is that possible with REW and how would I go about setting that up?

Jan Didden
 
No, REW can't be configured to do that. Easiest might be to save each tone to a mono WAV file and use an external utility to merge them into a stereo file and play that with your player of choice.
 
Thanks for the quick reply John!
I am attempting to measure microphone distortion
One known method is having the L and R speaker generate a different tone.
Those tones will not IM in the air but the mike recieving them will IM, so any IM you see in the received spectrum can only be from the mike.
If I generate the two signals from a dual signal generator separate from REW, will there be a sync problem in measuring the result with the RTA?

thanks,

Jan Didden
 
Shouldn't be, but you'll need to set up the same dual tone signal in the REW generator so REW knows what to analyse if you want REW to do the calculations.
 
PS: Someone came up with the idea to spawn two instances of REW, and each send a signal out to a different channel.
Then use either instance for the analysis.
I can try that but won't the two instances fight over access to the soundcard?

Edit: or use two soundcards.

Jan
 
I can try that but won't the two instances fight over access to the soundcard?

It wouldn't if you use WASAPI Shared. But I don't recommend it, WASAPI Shared sends everything through the Windows mixer. If all you are after is a test tone, it should be OK. But the Windows mixer does all sorts of horrible things to the signal - it's not bit perfect, it might resample the audio, the latency is all over the place (so completely unusable for timing measurements), and it might mix in other sounds, e.g. system notification beeps.

If you want WASAPI Exclusive or ASIO, your best bet is to use something like VB Audio Matrix. Set up two virtual inputs, and configure the Matrix to send both inputs to separate output channels on the sound card.
 
I set up two external different frequency sources for each speaker. I set up the same sources in the REW generator but they go nowhere.
Then do an RTA with REW. I got about what I expected, the mike IMD is at 500Hz (difference) and 4.5kHz (sum).
Next I need to figure out how to save and recal sigbnals in REW, and how to load them in the waveform math processor.

Jan
 

Attachments

  • rew im test1.png
    rew im test1.png
    225.5 KB · Views: 20
@jan.didden I don't have much experience with what you are doing, but I am curious about the appearance of your noise floor. It does not look like random noise to me, it looks like a clear pattern of tones about 20Hz apart that have that appearance of crowding together at higher frequencies due to the logarithmic scale. Count them - there are 5 spikes between 200-300Hz, and there are also 5 spikes between 700-800Hz.

Did you use WASAPI Shared? I would be suspicious that some kind of artefact has crept into your measurement?

Out of curiosity, how do you subtract the room noise floor from your measurement?

Your thread inspired me to do a bit of Googling. I found this nice article about microphone noise, and this article about microphone distortion. Now I am curious about testing the 3 microphones that I own!

Once again - I don't know the answer, I have no experience. If this appearance is what you expect, let me know.
 
@Keith_W, I have that paper as well. There doesn't seem to be any real data in it.
Microphone distortion numers are rare as hen's teeth - the best you can hope for is like "<2% at 160dB" or similar.
(My end goal is to measure the distortion of my electrostatic speakers down to -100dB).
I believe (not sure) that the regular noise pattern is caused by the fact that the sound sources being used are not at all synchronised with REW and/or the soundcard used (4i4).
Due to a limitation in REW I am using a separate hardware dual signal generator for the 2kHz and 2.5kHz sources feeding the speakers.
To tell REW what signals to expect, I set the REW generator also to 2kHz & 2.5kHz, but there's not any syncronisation between the REW generator and the external dual signal source.

The two speakers send out a single tone each, and they do not intermodulate in the air. However, the mike does, so by looking at the IM products I have a view of the mike (IM) distortion, without the speaker distortion interfering.

I measured a mems mike just now, and the IMD products (500Hz and 4.5kHz, D5L and D2H) are higher than in the previous measurement. As expected - the EMX7150 is more linear than the mems.

Jan
 

Attachments

  • rew im test1 BWmems.png
    rew im test1 BWmems.png
    140.3 KB · Views: 11
Last edited:
@jan.didden would you be able to share the method you are using to measure mic distortion?

After thinking about it, perhaps John's suggestion of merging two separate mono files into stereo might be the best solution. I have the ability to do this. If you tell me the parameters of your test tone, I can create a test signal and send you a link to download it. Screenshots of your Generator would be sufficient.

I am very interested in your experiment and I would like to do what I can to help :)
 
Well, normally you would take a clean source, measure that sound with a mic and see what distortion that mic adds..
The problem is that 'a clean source' has more distortion than the mic you want to measure so that's a dead end.
The method I use (which has been used, on and off, for decades) is to use two sources that are not particularly clean.
These two tone arrive at the mic without IMD because they do not intermodulate in the air (unless you go to 200dB SPL, air is nonlinear out there).
So the mic receives these two pure tones, they intermodulate in the mic and that's what I measure. See the previous posts.
So the issue of measuring mic distortion is sort of solved.

A couple of French scientists have developed a method to compensate for the mic distortion which is predominant 2nd harmonic.
They developed an algorithm that basically is to add to the mic signal a factor V^2/K0 (V^2 is of course the 2nd harmonic of the signal).
If you can find K0 with some accuracy, the 2nd can be decreased up to 40dB which is an important improvement.

So my plan was to use REW's Trace Arithmatic to develop V^2, divide that by a constant K0 and add that to the original signal.
I am very, very curious what the result will be!
My immediate worry is that I am pretty new to REW (last used it a decade or more ago) and I have no idea how to manipulate traces.
I mean, I'm here staring at the RTA spectrum, and now what? How to save that, in what format, then load that into a Trace arithmatic slot.
Probably load the original trace in both A and B then execute A*B. Then divide that by K0 (K0 is expected to be between 5 and 10, I'm still working it out).
Then add that to the original trace and look at that spectrum, hopefully with much decreased IM compared to the orinally measured trace.
It sounds so simple, I know!

Jan
 

Attachments

  • fig 5.png
    fig 5.png
    19.4 KB · Views: 16
OK, some progress. I found out that you can save a current measurement and it appears as a tile in a list next to the RTA window. I name it origA.
Then I move origA in both the A and the B slot in the Trace Arithmetic and calculate A*B, which gives me origA^2, named origSquared..
Next I need to divide origSquared by a number (say 8), but that seems not possible in the Trace Arithmetic. Or subtract 18dB which is the same as divide by 8, but that also is not available as an option.
How should I procede? I tried to enter a number in the Tools|Trace arithmetic slots but that's not accepted, only traces are.
Or is there a way to change a trace magnitude?
Appreciate any pointers from you power users!

Jan
 
Last edited:
Shouldn't be, but you'll need to set up the same dual tone signal in the REW generator so REW knows what to analyse if you want REW to do the calculations.
Hi John, see my previous post please.
My question: would it be possible to allow the user to enter a signed integer or fraction in one of the slots of the Trace arithmetic....?

Jan
 
Last edited:
Next I need to divide origSquared by a number (say 8), but that seems not possible in the Trace Arithmetic. Or subtract 18dB which is the same as divide by 8, but that also is not available as an option.
How should I procede? I tried to enter a number in the Tools|Trace arithmetic slots but that's not accepted, only traces are.
Or is there a way to change a trace magnitude?

Right click on the graph, choose "Align SPL", type in -18dB, then "Add to data".
 
@Keith_W - yes that should work!
I'm still struggling with the bookkeeping, selecting a folder to save results seems to block anything but the top folder.
But I know how to complete the process.

Jan
 
Made progress to my goal of measuring microphone distortion.
But some of REW's bookkeeping eludes me still.
I am doing an RTA, then I want to save that measurement as a .wav file.
The Help says Alt-O should convert current display into measurement, but there's no action when I press Alt-O.
I don't know where the Save current button is ...
Anyone can point me into the right direction please.

Jan
 
The save button is directly above the RTA graph. RTA measurements cannot be exported as .WAV files however, only impulse responses can be exported as .WAV.
 
The save button is directly above the RTA graph. RTA measurements cannot be exported as .WAV files however, only impulse responses can be exported as .WAV.
John, I assume you refer to the 'Current' button with the disk icon. When I click that, nothing happens as far as I can see.

BTW Spawning two instances of REW and use each to emit a different tone to a different channel does work to generate a two-tone IM so thanks for that solution!

Jan
 
Well there is sort of a way to export the RTA as a .WAV. Right click on it, make "Min Phase Copy", then save that as a .WAV.
Keith that would be great, but when I right-click in the RTA window the message I get is 'No action'...
What I do: I open two instances of REW, and set each Generator to a different frequency to a different channel. That way I get a 2-tone IM signal.
I switch on both generators.
I open RTA in one of the instances.I get exactly the spectrum I expect.
Then I click 'Current'- nothing apparently happens. I right-click in the graph - I get 'No action'.
I'm running beta 133.

Jan
 
1. After you take your RTA, click on the floppy disc icon to save the measurement into REW.

2. In the "SPL&Phase" tab, select your RTA on the panel on the left. Right clicking on the panel and not the graph, choose "Min phase copy".

3. Export the Min Phase copy as a .WAV.

I am running Beta 131. I am a bit lazy to keep up to date :)
 
Apparently there is some interaction between instances. If I open REW from scratch I do get the save action, showing the saved files panel to the left of the RTA window.
If I right click the graph I get the option Generate min phase|Generate but that saves the ,mdat, not the .wav. Is there a setting for the save format?

Edit: from the small panel version I do get 'Min phase copy' but that also saves the .mdat version, not the ,wav version..

Edit2: we xposted. I do get the Min Phase copy as you describe. But no choice of format - default .mdat.

Jan
 
Last edited:
There seem to be some misunderstandings arising, so I'll try and clear up a few things - forgive the over-explanation.
  • The RTA captures the spectrum of the input signal. That spectrum can be converted into a measurement by clicking the button above the graph:
    1787669906922.png
  • Clicking the button creates a new measurement that appears in the main REW window. It has a frequency magnitude response corresponding to the RTA capture.
  • Measurements can be saved as mdat files, REW's proprietary data format.
  • Measurement data can be exported in a variety of formats, the File - Export menu entries list the options.
  • Measurements that have impulse responses (usually sweep measurements) can be exported as .WAV, since the impulse response is a time record.
  • The frequency response of a measurement can be exported as text, a list of frequency and magnitude entries, with phase if it is available.
  • RTA measurements only have frequency response magnitudes. It is possible to force the creation of phase data using the "Min phase copy" action Keith mentioned, but that phase data is artificially generated using an assumption of minimum phase and may bear little relation to the phases of the original signal which was analysed to produce the RTA spectrum
  • The min phase copy contains an impulse response, which could be exported, but again that is not the time record that was analysed by the RTA and it is difficult to assign much meaning to it - it is a signal that produces the same magnitude response, but that's all it shares with the original signal.
I don't understand what you wish to achieve by generating a WAV file, or how it might be of use.
 
John, thanks for that overview.
My use of the .wav is to import it into Excel for further processing, like manipulating individual frequency components and do some goal seeking.

Jan
 
Text export is more easily imported to a spreadsheet and would have the spectrum magnitudes. If you wanted to do other analysis on the signal something like Audacity would easily capture it and can export the capture as a WAV file.
 
Back
Top