REW: export smoothed impulse responses (.wav), but "measured" and not "minimum phase"...

Stewix

Registered
Thread Starter
Joined
Oct 17, 2023
Messages
11
Hi all!...

I wanted to ask a question, but I think that some background could be of help, because I'm not using REW for the usual things (I'm using it for music production)...

I learned how to use it when I had to measure my treated room, but then I've used it to create some impulse responses (of my treated "tracking room", but also of some analog gear) to use those in a convolution reverb plugin...

To make this post short I'll go straight to the point and then later, if it is needed, I can explain better what I'm trying to do, what are my goals, etc....

The question is: is there a way to export a smoothed impulse response (for example 1/48 or other settings), but not having to generate a "minimum phase" version of the impulse (aka exporting the "measured phase" response, but smoothed)?...

Like I said I can explain in more details why I would like to do so, but for now it is enough to say that I'm trying to preserve the "authenticity" of what I measured (especially the actual phase response), so that the "plugin emulation" can be the most realistic possible (but, at the same time, it would be better to export a smoothed version of what I measured)...

Thanks in advance!...
 

Stewix

Registered
Thread Starter
Joined
Oct 17, 2023
Messages
11
Instead of doing a simple "bump" I think it is better if I explain myself in more details...

In the case of emulating the ambiance of an actual space, it should be better to export the "measured" (not smoothed) response...

In fact, in this case, one is using the "unmodified" impulse response, which should be the most "faithful" in reproducing the sound of the measured room; and if this does not sound good, it probably is due to the fact that the room itself does not sound good (or that one has not recorded well the impulses)...

This is what I've done until now, and thanks to convolution plugins and to the wonderful REW, it works very well...

But if one has measured a real tape machine, to emulate both its frequency response and its crosstalk, things change a bit...

In fact, the measured frequency response of a tape machine, has a lot of fluctuations in the high frequencies, which are due to the wow & flutter of the machine...

In this case the impulse response contains this "static" wow & flutter which I prefer to "eliminate" (by smoothing the response), because I'm going to emulate the wow & flutter (and the saturation) with another plugin: this "static" plus that "dynamic" wow & flutter would actually be a bit of a mess (even if we don't hear too much of those high freq fluctuations phsychoacoustically)...

But, with REW, if one smooths the frequency response of an impulse, then it seems that one has to inevitably generate the "minimum phase" version of it to be able to export it...

The point is that, on the other hand, to emulate the (stereo) crosstalk of the tape machine, this could be detrimental: because between, for example, the left channel "normal signal" and the right channel crosstalk, exists a complex phase relationship which is, at least partially, responsible of that "width and depth" that we usually associate with tape (and the "minimum phase" version of the impulses, changing the actual "measured" phases, would probably change also that relationship)...

Of course, if crosstalk were "phase coherent" with the signal of the other channel, all that would result from it would be a slight narrowing of the stereo image (maybe an equalized narrowing, considering that tape crosstalk is more pronounced at low and high frequencies, but still); and in this case crosstalk wouldn't be a "good" thing (like a lot of folks argue)...

Anyway, if one wants to emulate it, based on actual measurements, it would be better to preserve the "measured phase"; but to do so it seems that one cannot export a smoothed version of the impulse (which would be useful to avoid the aforementioned "fixed" wow & flutter)...

That's why I opened this thread, because I think that this ability (if I simply didn't miss it) to export a smoothed, but actual measured, impulse response would be really useful, for those who are using REW in music production: maybe everytime one wants to smooth a too wild response, while preserving the real (even if smoothed) measured phase...
 

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,343
You can create an impulse response from a smoothed measurement, though it is a little fiddly. Whether that will achieve what you want is debatable, since fractional octave smoothing is a process which doesn't have a physical analogue. To do it, first export the smoothed measurement as text then load it using import frequency response. Make sure the imported response is the current selection, then create a perfect impulse response at the same sample rate as the imported data by going to the EQ window, selecting the Generic equaliser and using "Generate measurement from filters" (with no filters defined) in the Filter tasks pane. Then use the trace arithmetic A*B to multiply the imported response by the perfect impulse and the result will have an IR whose frequency and phase response are those of the imported data.
 

Stewix

Registered
Thread Starter
Joined
Oct 17, 2023
Messages
11
First of all, you (and your software) are awesome!... Many many thanks for the answer!...

Regarding the fact that it is "debatable": I tend to agree, because with smoothing one is already altering in some way the actual response, like you are confirming...
The alternative is to use the response as is, and live with those high freq. fluctuations, even if I'm going to use also another plugin to emulate the wow & flutter...

I guess these are those kind of things where one has to let the ears decide (and it is debatable also that one actually manages to hear the effect of crosstalk), but is really nice to have the chance to choose...

Regarding the version of REW: yes, I'm already using the early (5.20.14) version, no problem with that (thanks for the clarification)...

Regarding the process: I suspected that there was already a way (even if "a little fiddly"), and I'll try to follow your instructions, coming back here if I have some difficulties somewhere (but I'm confident that thanks to what you wrote, and to what is written in the manual, I'll succeed)...

Thanks again!...
 

Stewix

Registered
Thread Starter
Joined
Oct 17, 2023
Messages
11
Ok, following your instructions has been "a piece of cake", and I've been able to export a smoothed version of the measured impulse, thanks!...

If you don't mind I would like to ask another question which is strictly related to what I asked in the OT (otherwise I would open another thread)...

By default the impulses exported from REW start at 1 second, so one has to cut the first 999 milliseconds in the convolution plugin...

Anyway, I've noticed that if I export the "measured" impulse version (instead of the "minimum phase" version), sometimes (like in this case of the tape machine impulse) I have to pay attention to cut less milliseconds, because there is a little "portion" just before the "peak" of the impulse which is really important (if I cut that portion I get a really strange behaviour regarding the resultant frequency response of what passes throught the convolution plugin)...

This "little portion" makes me think about the so called "pre-ringing" effect of linear phase filters, but of course this is only the real, "measured" impulse, not a "linear phase version" of the impulse...

Is this normal? I mean: should I be worried about a similar effect to the so called "pre-ringing", or I simply have to pay attention to cut less milliseconds, and I'm good to go?...
 

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,343
You can control the exported portion by defining a suitable IR window and exporting the windowed response. The true start (t = 0) position of an impulse response can be difficult to locate precisely, but generally the peak will occur slightly after t = 0. The lower the system bandwidth the wider the peak and the further after t = 0 it occurs.
 

Stewix

Registered
Thread Starter
Joined
Oct 17, 2023
Messages
11
Ok, I think I get what you are saying, thanks!...

Just one (still related) last thing: can you elaborate a bit about the fact that "fractional octave smoothing is a process which doesn't have a physical analogue", please?...

Do you mean that, in my case, it would be better to use another kind of smoothing or, better yet, no smoothing at all?...

I thought that in these cases (tape machine or other gear impulses), considering that the "temporal factor" is excluded, the impulse is practically only like an "equalization curve": does it really matter so much that this "curve" is smoothed a bit? Does the smoothing alters so much the "nature" of the impulse?...

I ask because, if this is the case, if the smoothing leads to a significant change of the impulse (bigger than the one resulting from the generation of the minimum phase plot), then my concern to "preserve" the actual measured phase risks to become completely useless!...
 

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,343
Not sure what you mean by "temporal factor is excluded". The impulse response is a complete description of the system, it captures what the system does to any signal that passes through it. Smoothing the magnitude and phase plots derived from the impulse response may help our visual interpretation, but the smoothed plots are no longer an accurate depiction of the system behaviour so neither is an IR generated from them. If your aim is primarily to replicate the smoothed magnitude response then generating a minimum phase IR from that is a better approach. If you are trying to capture more subtle effects then the measured IR is the one to use.

How did you intend crosstalk to be included? Did you send the stimulus to both channels when measuring each? That may give a representation of what happens for mono content, but would not capture crosstalk behaviour in general. The IR is a single input, single output system description and effects like crosstalk should be handled separately.
 

Stewix

Registered
Thread Starter
Joined
Oct 17, 2023
Messages
11
Hi! First of all, many thanks for your time, that is really appreciated!...

By saying that the "temporal factor" is excluded, I simply mean that, in this case, one is measuring an analog piece (a tape machine, but if it was a preamp or compressor it should roughly be the same) which has no "reverb", or no "tail" at all; and so, the resultant response, is practically an "eq curve", with no "tail" as well (or at least this is my understanding)...

Regarding the fact that my aim is to replicate the smoothed magnitude response: I don't understand why, the smoothing that precedes the "minimum phase" generation, should be different from the smoothing that precedes the creation of the "measured" (smoothed) response; aren't those the same smoothing?

Shouldn't the minimum phase generation imply a bigger change, considering that one is applying first the smoothing and then also the phase change?

Of course I can be wrong, so I'm all ears!

But, just to be clear, my goal is not the exact replication of the tape machine in question; if this was my goal, I would have already failed with the saturator plugin: in fact I haven't been able to replicate the exact third harmonic curve with it, only to "approximate" it...

And in fact my goal is to approximate (using different plugins) the behavior of a tape machine and, in doing so, using as a "guide" the measurements of a real (well maintained) tape machine, to which I have had access.

That's why my reasoning, regarding the magnitude response, has been the following:

"measured magnitude response" minus "high freq. combing (due to wow & flutter)" ≈ "smoothed (1/48) magnitude response"

Does this make any sense?

Regarding the crosstalk: yes, you are perfectly right.

In fact this is what I did: I generated the mono sweep measurement file from REW (with a resolution of 2M)...
Then I created (in my DAW) a stereo file which had first that sweep on the left, and silence on the right, then that sweep on the right and silence on the left...

Then I recorded this stereo file on the stereo (2 channels) tape machine, while re-recording "simultaneously" (being a 3 head tape machine) the playback in the digital domain...

Then, from the resultant stereo file, I cut precisely the various "sections" I was interested in (considering that, where before there was silence, now there was the crosstalk), and imported these sweep recordings into REW which, having the excellent ability, given enough resolution, to "look practically inside the noise floor" (for a lack of a better expression), "calculated" not only the "normal signal" channels response, but also the crosstalk channels response perfectly fine!

Regarding the "phase" of the crosstalk channels (about which I'm just a bit more "meticulous"): I'm NOT interested to preserve the "absolute phase" of those channels (nor that of the "normal signal" channels); I'm interested to preserve (as best as I can) the RELATIONSHIP between the crosstalk channels' phase and the "normal signal" channels' phase...

To be more precise: the relationship between the RIGHT crosstalk channel's phase with the LEFT "normal signal" channel's phase (and viceversa).

Now, if my reasoning is correct, considering that the smoothing leads to the same "modification" on all the four phases (of the two "normal signal" channels and the two crosstalk channels), there is a chance that that relationship stays the same (?)...

While, and I've already tested it (with various sine tones at different frequencies), that relationship between "minimum phases" (not smoothed) responses (crosstalk vs normal signal) does not stays the same as the relationship between "measured phases" (not smoothed) responses (again, crosstalk vs normal signal): here and there it can be different...
 
Last edited:

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,343
I don't understand why, the smoothing that precedes the "minimum phase" generation, should be different from the smoothing that precedes the creation of the "measured" (smoothed) response
It isn't different. However, the smoothed magnitude and smoothed phase tend not to have a minimum phase relationship between them which means an impulse response generated from them can have significant acausal content (i.e. the response starts at negative time).
 

Stewix

Registered
Thread Starter
Joined
Oct 17, 2023
Messages
11
However, the smoothed magnitude and smoothed phase tend not to have a minimum phase relationship between them which means an impulse response generated from them can have significant acausal content (i.e. the response starts at negative time).
Like the actual "measured" (but NOT smoothed) one?...
 

Stewix

Registered
Thread Starter
Joined
Oct 17, 2023
Messages
11
No, the measured IR cannot have acausal content, though it may not be minimum phase.
Ok, perfect: now I think I understand better your "perplexities" regarding what I was trying to do...

Anyway, I've done some more tests (with various sine tones at different frequencies), and I've seen that, with the "measured" (but smoothed) impulses, the phase relationship between, for example, the Right "crosstalk channel" and the Left "normal signal channel", stays the same as that between the "measured" (but not smoothed) impulses...

Now, this was one of the "goals" I was interested with, and thanks to your "assistance" I can now put into effect what I had in mind, regardless if it is, or not, the best "strategy" (but feel free to expand on that if you want)...

I will try all three "approaches": 1) the "minimum phase smoothed", 2) the "measured not smoothed", and 3) the "measured smoothed", and I'll let the ears decide; but if it wasn't for your help I wouldn't have the chance to try the third "method"...

So a very big THANK YOU!...

Now, there is just a little "annoyance" left: if I export (as .wav, 32 bit float) the impulses created following your instructions (written in your first post), even if I choose not to normalize them, it seems that they end up being normalized anyway...

Is this an expected behavior (considering how the impulses have been created), or is the "early access" version (5.20.14) "misbehaving" a bit?

I can perfectly live with that (simply adjusting the levels in the convolution plugin)...

But, if I accidentally "discovered" a (minor) bug, I'm reporting it in the hope that, in doing so, I can be of help, even if only minimally, compared to how much helpful you have been...

Thanks again!...
 
Last edited:

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,343
Generating an IR from the smoothed responses may have produced a peak greater than one, that will be scaled on export to ensure values do not exceed one and so can be represented in the WAV format.
 

Stewix

Registered
Thread Starter
Joined
Oct 17, 2023
Messages
11
Generating an IR from the smoothed responses may have produced a peak greater than one, that will be scaled on export to ensure values do not exceed one and so can be represented in the WAV format.
Oh, ok; so it depends on how they were created...

Just out of curiosity: is there a way to restore/preserve their relative levels?...

If there is not, like I said, not a big deal: it is enough to adjust their levels elsewhere, using the "measured" (not smoothed) ones as a reference...
 

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,343
The Info panel includes the IR peak figure. You can adjust IR levels using the Action for the Impulse graph.
 

Stewix

Registered
Thread Starter
Joined
Oct 17, 2023
Messages
11
Great!... Thanks!...

Ok, sorry to bother you further, just one last thing (I promise): what if I want to use, for example, the "minimum phase" (smoothed) responses for the "normal signal channels", and the "measured phase" (not smoothed) responses for the "crosstalk channels"?...
How can I be sure that they are "time aligned"? Is it enough to let them as they are, because all the "peaks" are already aligned (and simply cut the same, appropriate amount of milliseconds before the peaks)?...

Or this "idea" doesn't make sense, for obvious reasons I'm missing?...
 
Top Bottom