What is the reliable way to parse the "impulse as txt" format?

3ll3d00d

New Member
Thread Starter
Joined
Jun 4, 2017
Messages
45
If I export an impulse as txt then I get something like

Code:
Impulse Response data saved by REW V5.19
IR is normalised
IR window has not been applied
IR is not the min phase version
Source: ASIO Focusrite USB 2.0 Audio Driver, Mic 1
Dated: 22-May-2018 09:59:37
Measurement: M H0
Excitation: 128k Log Swept Sine, 2 sweeps at -8.0 dBFS  Using a loopback as a timing reference
Response measured over: 20.1 to 24,000.0 Hz
0.0020157345570623875 // Peak value before normalisation
48000 // Peak index
131072 // Response length
2.0833333333333333E-5 // Sample interval (seconds)
-0.9960625 // Start time (seconds)

-8.732928E-4
-6.188466E-5
4.093998E-6

is the correct way to interpret this format "everything up until the first empty line is a comment, everything after it is data"?

if so, 3 comments/questions/enhancement requests...

1) it's a fairly long file by default, would be nice to have the option to create a shorter version (use case = quasi anechoic measurements which will pull the left and right gate in pretty tight)
2) would be nice if comments were comments (e.g. prefixed with a particular character like #)
3) would be slightly nicer to parse if some of the metadata were in some key=value format (though I realise the existing value // key is a key-value format in reverse)
 

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,401
Yes, the data starts after the first empty line. The way to shorten the file is to use the windowing option you requested I add. The basic format hasn't changed.
 

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,401
Here is a tweaked format for the next build.

* Impulse Response data saved by REW V5.19
* IR is normalised
* IR window has not been applied
* IR is not the min phase version
* Source: Microphone (Umik-1 Gain: 0dB ), MICROPHONE (Master Volume), Right channel, volume: 0.550
* Dated: 05-May-2014 14:12:40
* Measurement: Artist 3+Q2070Si
* Excitation: 256k Log Swept Sine, 1 sweep at -12.0 dB FS
* Response measured over: 2.2 to 24,000.0 Hz
4.33353241533041E-4 // Peak value before normalisation
48000 // Peak index
131072 // Response length
2.0833333333333333E-5 // Sample interval (seconds)
-1.0 // Start time (seconds)
* Data start
-3.1990022E-4
4.7188485E-4
-3.4590682E-4
-2.916168E-4
-3.5212302E-5
 

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,401
As an aside, if it is the frequency response magnitude which is ultimately of interest that data could be exported directly or the minimum phase impulse could be exported, which doesn't require any left window since by definition it will be zero up to t=0 and of course has the same frequency response magnitude as the original impulse response. Note that impulse response exports (in any format) do not include the effects of any cal files.
 

3ll3d00d

New Member
Thread Starter
Joined
Jun 4, 2017
Messages
45
Thanks, I had missed that option. I notice it still generates the same length file as it produces all the zeroes at the end. It would be good to truncate the file at that point.

The app I'm working on does need the impulse data, not sure if a lack of cal file is an issue for this purpose but thanks for pointing it out.
 

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,401
Data up to the left window was trimmed, but not data after the right window. I've fixed that, but note that the data will be padded with zeroes so the length is a binary power if required.
 
Top Bottom