Minimum Phase

Frank_F

Registered
Thread Starter
Joined
May 27, 2019
Messages
5
I just built a little own application for measuring IR impulses for cabs. I actually did this with pleasure using REW for a while but since I needed to automate the microphone position relativ to the speaker by a stepper I neede a way to trigger measurment-movment automatically. It took me a while to work myself through heeps of new experiencies, overcome some beginner mistakes with convolution, FFT, windowing etc., but now I am realy happy with the results so far. And I am happy always beiing able to compare to REW results to see if my programming and outputs make sense.
Now I that I almost reached the finish line I came to one last step which I need to make the project complete: minimum phase.

Right now I am sending a log sine sweep, measuring the cab with different mics at different positions. By of both signals and dividing the FFTs I am able to extract the frequency and phase data of the cab. By transfering it iFFT I get the impuls in time domain which I can save as wav and use for cab simulator. Unfortunately the impuls is not minimum phase that way. Although it sounds already pretty good I would like to get the minimum phase version somehow for not risking to run into phase issues using more impulses at one time.

So I need a way to implement some code into my project (C#) for doing the minimum phase transfer. Most things I found in the internet are about hilbert transforms and zero reflections, etc. All sounds (for me) pretty complicated. Those algorithms look pretty much all like there must bu extensive handcraft in the end to get a sufficient good result. All looks pretty much far away from implemeting as a "one button" automatic transfer. When I look at commercial apps recognizing that they have this magic button, I am wodering if there is no "simpler" way to get a sufficient good transfer to minimum phase.

I would be happy if some of the experts could give me an advice.

Frank
 

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,325
Are you sure it is a minimum phase response you need? The minimum phase response isn't the response of your cab, it just happens to share the same magnitude response. It is more often useful to remove time delay from the measurement. If you have a timing reference (such as a loopback connection) you can estimate how much delay to remove by looking at the group delay.
 

Frank_F

Registered
Thread Starter
Joined
May 27, 2019
Messages
5
Hi John,

thank you very much.
I start getting doubts about the "minimum phase" topic. I actually came to the IR topic through guitar cab (and amp) modeling. Here is "minimum phase" a pronounced and often "discussed" topic.
Even those commercial package of IR files which one can buy almost all contain those hundreds of IR files from different mics and positions, plus same amount of files as "minumum phase". So I thought this is connected to minimize phase by Hilbert transforms and zero reflection etc. So you think this is all about cutting silence/delay in this context? How could I find this out? Could I find out by watching this so called "minimal phase" files somehow??

could I as another "newbie" question?..?
My workflow is so far pretty "selfmade". Especially the order of process is so far not 100% "safe". What I do:
-Starting log sine sweeps (20-24000Hz, 2-3 secs) via asio driver of external usb soundcard and "simultaneous" start record (s/n ratio is optimized before)
-FFT of both signals
-getting h by deviding FFT(recorded)/FFT(Filter)
-Inverse FFT on h getting the IR in time domain H.
- searching H for maximum and for "trigger" point (time from which signal amplitude comes over noise and where Impuls starts/reaches mic)
- cutting eg. 8192 samples from trigger point to new float[]
- applying Tukey sarting at n=0, getting 1 from Impulsmax and starting decaying at adjustable, variabel percentage of samples from the end.
- applying highcut, low cut on the Imulse
- exporting as wav.

I am little confused about when to do windowing and bandbass/cut. Does it make sense like I do? Or better applying pass filters to the recorded outpfile already before first FFT?
Same with the window. Should I better put the window over the outputalready before doing FFT. I thought it mages sense to put it on the finals Impuls wax, do get a smooth "blend" and fade of the rough cut 8192 samples whicch dont start/end at zero.
 

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,325
Whether you need a minimum phase version of a response depends on what you want to do with it. Generating a minimum phase response is a useful way to create a phase response from a measurement that doesn't have one. When you have an impulse response removing time delays is typically of more importance to extract the phase response, but I'm not clear what use you want to make of the phase response.

8k would be a pretty short impulse response unless you are only interested in the direct sound and don't need very low frequency content. Windowing and filtering should be applied after impulse response extraction.
 
Top Bottom