Problem with Trace Arithmetic?

cookiedivine

Registered
Thread Starter
Joined
Jul 10, 2021
Messages
8
Hi all,

I've been having some trouble with the trace arithmetic function in REW.
I'm trying to generate a graph showing the difference between the left & right speakers so I can determine the optimal mixing position. Here are the SPL curves for both speakers:
SPL (L,R) 1_24.jpg

And here's what I get when I do 'A / B' where L & R are A & B respectively:
SPL (L,R Difference).jpg
From around 200Hz upwards the difference curve seems to be slowly rising. Normally, this would indicate that the L speaker is louder than the R speaker in the mid-high freqs, but look at the first image. That clearly isn't the case (in fact, from around 2KHz and above, R is clearly louder)

So I generated a (B / A) graph and compared it to the original (A / B) curve:
A_B, B_A.jpg
(B / A) should be an exact flip of (A / B) around the 0dB line, but it isn't. From around 200Hz upwards the 'reflection line' seems to be rising, with both curves fluctuating around it.

So I multiplied (A / B) by (B / A) and it pretty much confirmed my suspicions:
(AB)(BA).jpg
This line should be completely flat at 0dB, no? A curve should be completely cancelled out by its inverse.

I suspect this is a problem with the current version of REW as I tried re-creating a difference graph from 2017 using the same .mdat file and my version has the same weird rise from around 200Hz upwards:
SWIM--LR--FR--dif-compare--20-20k.jpg when i try to do it.jpg
(My one is the 2nd one)
Can anyone help me out with this? Am fairly new to all this so pls be gentle :hide:
(Have attached the .mdat file)
 

Attachments

  • cookiedivine baseline test.mdat
    10.9 MB · Views: 7
Last edited:

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,314
It is an artefact of the way smoothing works, here is the L/R * R/L trace with no smoothing:

43341


and with 1/48 octave smoothing:

43342


The apparent rise as smoothing is increased is because smoothing is applied to the underlying power data (squared amplitudes) so peaks have a stronger effect than dips. A few years ago smoothing was incorrectly being applied to the raw data rather than squared data, that was fixed.
 

cookiedivine

Registered
Thread Starter
Joined
Jul 10, 2021
Messages
8
It is an artefact of the way smoothing works, here is the L/R * R/L trace with no smoothing:

1626003916536-png.png

But even then surely this line should be completely flat at 0dB, if it's unaffected by smoothing? If (R/L) is an exact inverse of (L/R) then they should completely cancel each other out, no? What's with all the craziness above 200Hz?

The apparent rise as smoothing is increased is because smoothing is applied to the underlying power data (squared amplitudes) so peaks have a stronger effect than dips. A few years ago smoothing was incorrectly being applied to the raw data rather than squared data, that was fixed.

I'm very confused. Does this mean every smoothed curve has an apparent gradual rise? Does this not defeat the point of smoothing? In order to accurately interpret the data do I have to avoid smoothing from now on?
For example, in the case of my LR difference graph, smoothing it results in a curve that seems to misrepresent the data. R is louder from 2KHz upwards (even when un-smoothed), but the difference graph shows L as being around 5dB louder. Is it??

Is it just the graphs generated by trace arithmetic that have this problem? Or are all my SPL curves affected in this way by smoothing?

Apologies if I'm being dim...
 

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,314
The root of the problem is that you are working with listening position room measurements. The measurements contain a lot of reflections, and the combined effect of those reflections and the direct signal means that areas of the response are not minimum phase. The linked article talks more about that, but one of the consequences of a system which is not minimum phase is that it is not invertible. That is problematic for division, since A/B = A*(1/B) so we are effectively inverting one of the responses, which just won't work as we would like with such a measurement.

To illustrate the difference, we can window the responses to exclude all the reflections. Here are the results of using 1ms windows, then dividing those windowed responses, and the product of the two divisions, which is flat at 0 dB. The traces start at 1 kHz since the window width sets a lower bound on the frequency response.

43345


Probably more like you would expect to see.

Even the listening position measurements can give something a little more like we would expect, though somewhat counter-intuitively by making the windows as wide as they can go. It also helps if the measurements are made with sweep settings of 0 Hz to sample rate/2, though your measurements aren't too far off that. The product of the two divisions is again pretty flat except at the lowest frequencies where noise interferes, though the appearance of the smoothed ratios is likely no longer what you would expect above a few hundred Hz.

43347


That brings us to the effect of fractional octave smoothing. Smoothing acoustic responses is, approximately speaking, generating the rms (root mean squares) averages over frequency spans that cover an octave fraction. Because the squares of the values are being averaged, notches have less influence on the result than peaks (the squares of big numbers are much bigger than the squares of small numbers).This works well with acoustic responses and gives the results we would expect and that are in line with what we perceive. Applying smoothing to the ratio of responses which have reflections becomes problematic, however. The reflections contribute deep notches in the response, inverting one of the responses in the course of dividing by it turns those notches into high, sharp peaks. The rms average of those peaks will outweigh the notches of the numerator response of the ratio, so whichever way around the division is performed the smoothed result gets pulled up where there were deep notches in the denominator.
 

cookiedivine

Registered
Thread Starter
Joined
Jul 10, 2021
Messages
8
Thanks for all the info, John! I think I understand...

This works well with acoustic responses and gives the results we would expect and that are in line with what we perceive. Applying smoothing to the ratio of responses which have reflections becomes problematic, however. The reflections contribute deep notches in the response, inverting one of the responses in the course of dividing by it turns those notches into high, sharp peaks. The rms average of those peaks will outweigh the notches of the numerator response of the ratio, so whichever way around the division is performed the smoothed result gets pulled up where there were deep notches in the denominator.

Well I'm glad the acoustic responses are still usable, but this makes the difference graph I generated pretty much useless, right? Is there another way I can generate a difference graph that doesn't involve division (like simply subtracting the dB values at every freq)? Or will I have to settle for 'eyeballing' the acoustic responses & trying to get them as close to each other as poss?

At the moment I'm really only concerned with the direct signal from the speakers (i.e. not the reflections, yet), so if I windowed the responses to 1ms would the (L/R)*(R/L) difference curve be more usable/less problematic, like in your first image? You say it's limited to 1KHz and above, so how could I do it for freqs below 1K?
 

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,314
Measurements of the direct response of a speaker would usually be made nearer to the speaker (1m is typical) and with the speaker moved as far as possible from all boundaries. Measuring outside can work well in a quiet area on a still day, with the speaker elevated. The further away the boundaries are, the later the reflections arrive and the wider the window can be. On the IR windows dialog there is a frequency resolution figure, that shows the resolution and lower frequency limit determined by the right hand window width setting. You can see the effect of changing the window width more dynamically by using the impulse graph and selecting the option in the graph controls to "Show magnitude graph". Set an initial value for the right hand window to bring the R indicator within the span of the graph, then drag the indicator around to adjust the window and see how the magnitude response is affected. As the various reflections are excluded the response gets smoother.

An alternative, lower hassle option for your response ratio is to select the frequency dependent window window option, the default 15 cycle setting is probably fine. That has the effect of a variable window which gets narrower as frequency increases, greatly reducing the effect of reflections but preserving low frequency response. Here is how that looks, with the default 500 ms RH window:

43358
 

cookiedivine

Registered
Thread Starter
Joined
Jul 10, 2021
Messages
8
This looks like its exactly what I'm after! Thank you so much, John!

At some point down the line I will need to generate difference graphs that take reflections into account. What do you think is the best way of doing that?
The graph below isn't of much use to me if 1/48 smoothing is making it rise THAT much
 

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,314
At some point down the line I will need to generate difference graphs that take reflections into account.
Why? Our ears and brain are very good at separating the direct sound from the reflections above the bass range, if you were to start changing things based on responses including room reflections it would almost certainly be detrimental.
 

cookiedivine

Registered
Thread Starter
Joined
Jul 10, 2021
Messages
8
Why? Our ears and brain are very good at separating the direct sound from the reflections above the bass range, if you were to start changing things based on responses including room reflections it would almost certainly be detrimental.
I'm confused again...
What about room symmetry? If our brains can separate direct sound from reflected sound then wouldn't we position the speakers anywhere in the room completely disregarding symmetry, so long as the direct sound is balanced?
In fact, why even treat rooms at all if our brains disregard reflected sound?

What if I had absorbers on either side of the mixing position to absorb first reflections but one was way deeper than the other. You'd be able to see the effect on a (non-problematic) difference graph and remedy the problem, balancing the sound. So why would I NOT want to generate such a graph?

Maybe I'm misunderstanding you?
 
Last edited:

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,314
Please don't extrapolate my comments into something I have not said. You want to generate the ratio of left and right speaker responses including room reflections and presumably take some action based on that. I think that is a bad idea and will not provide useful information or a beneficial outcome. Let's leave it at that.
 

cookiedivine

Registered
Thread Starter
Joined
Jul 10, 2021
Messages
8
Sorry, I promise I'm not trying to twist your words. Clearly I'm misunderstanding you.
 

cookiedivine

Registered
Thread Starter
Joined
Jul 10, 2021
Messages
8
Well balance isn't the sole factor in what makes a good sounding room, but it's still important isn't it?
 

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,314
Imbalances in the direct sound from the speakers would likely be better corrected if they exist, but the remedy for problematic reflections on one side would be to deal with them as far as possible, not to try and create similarly problematic reflections on the other. A symmetric layout is generally a good thing, but better achieved with a symmetric room and a tape measure than response ratios.
 
Top Bottom