# Using rew from a wav file.



## Sylberg (Dec 23, 2008)

I would like to record a test session, save it in a WAV file and make the REW analysis directly from the wav file at a later date. Is this possible? Do I need some sort or virtual soundcard that emulate an additional card. 
I am running under Vista 32bit on a laptop that as no Input line, so no way to loop back the audio card. 
Thanks all


----------



## glaufman (Nov 25, 2007)

Well, I WAS going to suggest looping back the line out to the line in, BUT...
I also was going to ask exactly what you hope to see? When you say a "test" session, exactly what type of signal? What type of analysis?
You might be able to do this (with the loopback) in RTA or Spectrum mode, but it won't really work if you're trying to plot a sweep.
I'm also running Vista32 on a laptop with no input line... as with many, I bought an external USB soundcard that adds the line in/out connections, not very expensive, and works well.


----------



## JohnM (Apr 11, 2006)

No, you cannot do that with REW currently though it is on the features list for a future release. If you need to process responses acquired offline you might want to try HolmImpulse http://www.holmacoustics.com/holmimpulse.php


----------



## Sylberg (Dec 23, 2008)

Thanks John for the link. Looks interesting. Already downloaded. I will give it a try.

I don't have a dedicated listening room so I need to be alone to make my tests.
It would be great to record several measurement sessions and analyse them later. May be a next release of REW.


----------



## glaufman (Nov 25, 2007)

For the record, it takes no more time to save the sweep in REW than it would to a WAV file... the IR, Waterfall, and all the other calculated plots can get generated at a later time, it's just the intial measurement sweep that needs to be captured RT.


----------



## brucek (Apr 11, 2006)

> It would be great to record several measurement sessions and analyse them later.


You'll have to explain what this means? REW can save any measurement session and analyze it later, including saving the IR to wav for later analysis.

brucek


----------



## Martin_Cph (Oct 2, 2009)

I opened this thread because I have a different wav-file request. Would it/is it be possible to play e.g. a gun shot sound file and then measure for RT60 etc?

I am a very happy user of REW by the way.:T

Is this it?

_*Import Impulse Response Ctrl+Shift+I
Import an impulse response from a WAV file or a .pcm file (raw data) as produced by ETF from Full Range measurements using the File -> Write Impulse As *.pcm option. The sample rate must be specified manually for .pcm files as it is not contained in the file (ETF shows the sample rate in the pop-up which appears after exporting the response). WAV files cam be mono, stereo or multi-channel, the channel to be imported can be chosen when loading the file. Only Signed, little-endian PCM WAV files are supported, with 16, 24 or 32 bit samples. To re-scale the impulse response for a desired peak SPL figure in the frequency response use the Scale Response controls in the Impulse graph group. The path to the file is remembered for the next time the dialogue appears. N.B. Mic/Meter calibration, soundcard calibration and C weighting compensation are not applied to imported impulse responses.*_


----------



## glaufman (Nov 25, 2007)

You can have REW calculate the RT60 from the measurment sweep...


----------



## JohnM (Apr 11, 2006)

Yes, a wav file captured from a gunshot or balloon burst or similar is effectively an impulse reponse already, so you can just import and analyse it. However, the dynamic range requirements of the measurement system needed to capture the response tend to be orders of magnitude higher to approach the signal-to-noise levels of even a short sweep measurement.


----------



## Sylberg (Dec 23, 2008)

The real reason of this is to play to same recording session using different applications: REW for what it does well, TrueRTA, HOLMimpulse, Goldwave and others and see if the results are consistent or to make other types of observations and measurments.
Most of these programs require a real soundcard to be installed rather than reading a WAV file (exception of HOLMimpulse -- but it has a less fancy interface compared to REW). 

I will find out some sort of "virtual soundcard" driver at some point.

Thanks to all.


----------



## gazoink (Apr 17, 2013)

JohnM said:


> No, you cannot do that with REW currently though it is on the features list for a future release.


Is analysis of pre-recorded files still on the features list? Got a few off-line files I'd like to analyze. I looked at Holm...not something I really want to devote time to learning.


----------



## JohnM (Apr 11, 2006)

Still on the list, but not near the top, sorry.


----------



## mnaganov (Aug 28, 2014)

John, I really appreciate your time working on REW!

I also have the same need of being able to analyze a processed sweep from a file for frequency and phase responses, and for group delay. Unfortunately, HOLMImpulse lacks the ability to analyze GD. Are you aware of any software packets similar to HOLMImpulse that offer GD analysis?


----------



## JohnM (Apr 11, 2006)

ARTA is very comprehensive, though I don't know if it allows import of stimulus and response files to extract IR. You could also export the extracted IR from Holm and analyse it in REW.


----------



## mnaganov (Aug 28, 2014)

For the record, I came up with a couple of ways to achieve my goals (measuring frequency response, phase response, and group delay of a digital filter). First, I managed to perform the analysis in MATLAB. But it's too much geeky and DIY (although, very much educating).

Then, in order to check the results obtained from MATLAB, I've managed to "fool" REW and feed to it a pre-recorded processed response for a measurement sweep. For that, I used Rogue Amoeba Loopback in "pass-thru" mode (on Mac). I set up REW's input from the virtual device, and then I was simply playing the response .wav file in VLC into the loopback device while REW was doing a measurement. Worked like a charm!

And the third approach (to triple-check) was to set up the filter under investigation in "real-time" processing mode on one computer, and route REW's measurement sweep via a real soundcard connected criss-cross with the sound card on the computer running the filter. This produced the noisiest results, but in general they also agreed with the previous two.

One shortcoming I've encountered with REW is that is generally expects delays in milliseconds for GD (I guess, it's normal for acoustic systems), while my filter produces microsecond delays. Although REW is showing pretty similar numbers, they are not as precise as those I was able to calculate with MATLAB.

But it's great that it all worked and now I actually have understanding of how REW does its graphs! 

One thing I'm still amazed about REW is how fast it can perform 1/N-octave smoothing. :T I've found one packet for MATLAB that does that, but it's su-u-uper slow, I'm not sure why.

John, is it possible for you to give a hint how REW is able to perform smoothing so quickly?


----------



## JohnM (Apr 11, 2006)

mnaganov said:


> John, is it possible for you to give a hint how REW is able to perform smoothing so quickly?


Sure. Used to be multi-pass moving average filters (which can be implemented very efficiently, just need to take care of the fractional sample widths as the filter width varies). Each successive pass gets closer to a pure Gaussian kernel. Figured I could probably achieve the same result with zero phase (forward/backward) IIR filtering though, with less complication and better results near the ends of the data, so nowadays REW uses multi-pass, zero phase IIR filtering. For linearly-spaced data the filter time constant varies with the frequency (sample index). REW uses 8 forward/backward passes of a first order filter for a very close approximation to Gaussian filtering.


----------

