REW Beta Release Problems with IR Exports, Phase data not correct

bixite

Member
Thread Starter
Joined
Nov 30, 2022
Posts
30
Hello,

I am using REW almost daily in the development of active systems with FIR filters. I build my filters in rePhase. I export the frequency response as txt from REW and import it in rePhase. This works perfectly.
I am testing with another tool for FIR-filter development right now, which requires an Impulse Response. I export such an Impulse Response from the respective measurement in REW (meanwhile in almost all possible variations/configurations). The exported IR does not contain the identical phase information from the measurement. I have checked this additionally, by reimporting the IR back into REW. It has a different phase information compared to the original (approx. 20 degrees higher in higer frequencies). I did the same test with an export and reimport of the frequency response as txt. The reimported frequency response has the same phase information as the original.

Any ideas what might go wrong here? Kind regards
Bidjan

P.S.: I am using the latest Beta. However, a friend checked the same behaviour with an older version.
 
There is no concept of absolute time in a WAV file, but the phase display depends on where in the response t=0 is defined. When you export from REW there is an option to place t=0 at a specified sample index, the Analysis preferences similarly have options to place t=0 for imported files. If those two are used in the same way (e.g. placing t=0 at the first sample or placing t=0 at sample 256) the REW import should show the same phase response. How tools show phase will depend on how they place t=0.
 
t = 0 is at the Impulse Peak before export and after import of the measurement. However, the phase differs. I can replicate the error in REW itself (without other tools) with t=0 at the same position of the measurement.
 
Imports have identical phase to the exported response for me. Please attach an example measurement and a screenshot of your export dialog.
 
Here is my example:
This is the measurement:

1-measurement.jpg


Export Dialog (I tried many variations)
1.export.jpg


After Re-Import same frequency response
1-measurment-and-import-frequency-response.jpg


But different phase
1-measurement-and-imported-phase.jpg


The two impulses are not identical but very similar.

1-impulses.jpg


I do not find a way to export an IR and reimport it receiving the same data as the original measurement.
 

Attachments

  • 1-identical-phase-with-txt-export-import.jpg
    1-identical-phase-with-txt-export-import.jpg
    78.9 KB · Views: 14
  • 1-identical-SPL-with-txt-export-import.jpg
    1-identical-SPL-with-txt-export-import.jpg
    94.2 KB · Views: 18
  • 1-impuls.jpg
    1-impuls.jpg
    54.3 KB · Views: 12
The import doesn't have the cal files applied, that's the source of the difference. There is an action to merge the cal files into the impulse response if you want an export that includes the cal file effects.
 
Fabulous John,

so many hours in REW and I still learn new stuff. Thanks a lot.
It would be great to have this as an export option, which is the default. I assume that this would make sense in most cases when you want to work with the IR in other tools.

Thanks a lot for your help. Kind Regards
Bidjan

P.S.: Now I will check the calibration file of my Earthworks M30 mic. Phase shifts of up to 20 degrees in the "normal" frequency range seems a lot to me.
 
The problem is NOT the MIC calibration. It ist the soundcard calibration. Here a few lines:

8642 -0.006 -332.142
8643 -0.005 -332.132
8644 -0.004 -332.133
8645 -0.006 -332.131
8646 -0.005 -332.134
8647 -0.005 -332.118
8648 -0.007 -332.131
8649 -0.004 -332.132
8650 -0.006 -332.129
8651 -0.005 -332.132
8652 -0.006 -332.122

I will try to recalibrate an have a closer look ... I cannot imagine that the Soundcard itself has such effects on phase.
 
This is the soundcard calibration file. Obiviously, it has phase date which generate my phase shifts. I will try to redo the calibration and see what happens.

Soundcard-calibration.jpg
 
Puh, it seems that I stumbled upon an interesting topic. Correct phase information is relevant to me, since I do not want to manipulate phase with FIR in the wrong direction (neither manually with rePhase or automatically with impulse inversion).
I did another Soundcard calibration with REW for my Focusrite Scarlett Solo 4th Gen. devices. For this calibration, I switched to 96kHz. Interestingly, the phase response is quite different (see phase in orange). After that, I used the REW functionality "Estimate IR delay" and applied it. This resulted in a much more linear phase (see phase in green).
I remain unsure what to use. The Focusrite is not the later playback system. I use it for measurements and want to rely on proper amplitude and phase information when measuring. Amplitude is perfect. Phase is in question ...
Soundcard-calibration-96kHz-with-and-without-IR-Delay-corrected.jpg
 
Last edited:
Phase will vary where the response is not flat, most obviously at the low and high frequency roll-offs of the interface. Using a higher sample rate pushes that high frequency roll-off further up.
 
Correct, I see that in the comparison between the 44.1kHz and 96kHz measurements very obviously.
My last picture above shows two phase plots from the same soundcard measurement. Orange as measured and Green with "Estimate IR Delay" applied. Which should be used as basis for "Make CAL file"?
 
Usually best to use the result as measured by REW, but the easiest way to check is to make the cal and then make a loopback measurement to see how flat the result is.
 
This is the soundcard calibration file. Obiviously, it has phase date which generate my phase shifts. I will try to redo the calibration and see what happens.

View attachment 95880

I was flabbergasted to see a perfectly flat amplitude response and a varying phase response, until I looked a bit closer. Your SPL scale is about 450dB! Choose something a bit more sensible, maybe about 5dB and you will see that John is right.
 
I was flabbergasted to see a perfectly flat amplitude response and a varying phase response, until I looked a bit closer. Your SPL scale is about 450dB! Choose something a bit more sensible, maybe about 5dB and you will see that John is right.
Hi Keith, John was right in all his replies. All my questions are about phase not about the amplitude. The soundcard measures almost perfectly flat for amplitude. No problem here (see zoomed in version).

SPL-scale.jpg
 
Last edited:
I made some progress. Thanks John for the hint. I build calibration files and then did measurements with loopback and calibration applied. Picture only shows phase of 4 different measurements. The 44.1kHz calibration worked out of the box and delivers flat amplitude and flat phase (dark green). After that I did a 96kHz calibration. Amplitude flat, phase not (blue). I applied "Estimate IR delay", made a new calibration file and a new measurement: phase is flatter (orange). I manually put t=0 at the impulse peak, made a new calibration file and a new measurement: phase is flatter (light green). At the moment, I have no simple way to produce the correct calibration file. Any ideas how to set the timing correctly?

Phase-44.1-and-96.jpg
 
The difficulty with soundcard responses is they may use linear phase, minimum phase or mixed phase reconstruction filters for their outputs and (usually) linear phase anti-alias filters at their inputs. REW makes a best guess at the correct delay for the measurement by a process similar to the normal Estimate IR delay, but that is based on an assumption of minimum phase behaviour which may not hold true. There isn't a universal solution to arrive at the ideal figure, though the phase shifts of systems being measured are usually orders of magnitude greater than those of the interface. You could try making normal loopback measurements (not soundcard cal measurements) using the acoustic timing reference or with no timing reference and the option to set t=0 at the peak to see if either of those works better.
 
Back
Top