DSPRelated.com
Forums

De-mixing two audio streams using Room Impulse Response (Matlab)

Started by jere...@gmail.com October 30, 2005
Hi, new to this group...I am using Matlab to SIMULATE the de-mixing of
two audio streams. What I did is as follows:

1. found two clean audio sources on the internet S1, S2. (4 seconds at
11kHz, 16bit)
2. found four room/hall impulse responses H11,H12,H21,H22. (3 seconds
at 11kHz, 16 bit)
3. Intention is to simulate pickup by two separate microphones the
mixed streams X1, X2.
4. Hence Convolved S1*H11 & S1*H12 & S2*H21 & S2*H22
5. mic 1 receives X1 = S1*H11+S2*H21
6. mic 2 receives X2 = S1*H12+S2*H22
7. in matrix form X=HS
8. hence (H^-1)X=S

and this is the step in which problems arise, the calculation of det(H)
for some samples is 0 and hence H^-1 is not possible. Any hints?

jeremy

<jeremyscerri@gmail.com> wrote in message
news:1130704565.841621.305810@o13g2000cwo.googlegroups.com...
> Hi, new to this group...I am using Matlab to SIMULATE the de-mixing of > two audio streams. What I did is as follows: > > 1. found two clean audio sources on the internet S1, S2. (4 seconds at > 11kHz, 16bit) > 2. found four room/hall impulse responses H11,H12,H21,H22. (3 seconds > at 11kHz, 16 bit) > 3. Intention is to simulate pickup by two separate microphones the > mixed streams X1, X2. > 4. Hence Convolved S1*H11 & S1*H12 & S2*H21 & S2*H22 > 5. mic 1 receives X1 = S1*H11+S2*H21 > 6. mic 2 receives X2 = S1*H12+S2*H22 > 7. in matrix form X=HS > 8. hence (H^-1)X=S > > and this is the step in which problems arise, the calculation of det(H) > for some samples is 0 and hence H^-1 is not possible. Any hints? > > jeremy >
Not just that but more than often the impulse response will be non-invertable due to its non-minimum phase nature. McC

jeremyscerri@gmail.com wrote:
> Hi, new to this group...I am using Matlab to SIMULATE the de-mixing of > two audio streams. What I did is as follows: > > 1. found two clean audio sources on the internet S1, S2. (4 seconds at > 11kHz, 16bit) > 2. found four room/hall impulse responses H11,H12,H21,H22. (3 seconds > at 11kHz, 16 bit) > 3. Intention is to simulate pickup by two separate microphones the > mixed streams X1, X2. > 4. Hence Convolved S1*H11 & S1*H12 & S2*H21 & S2*H22 > 5. mic 1 receives X1 = S1*H11+S2*H21 > 6. mic 2 receives X2 = S1*H12+S2*H22 > 7. in matrix form X=HS > 8. hence (H^-1)X=S > > and this is the step in which problems arise, the calculation of det(H) > for some samples is 0 and hence H^-1 is not possible. Any hints? > > jeremy
Try transforming the determinant back to time domain, finding the LMS time domain inverse of it, transform back to freq domain and multiply the cofactors with that. Search Levinson-Durbin for the time domain inversion algorithm. If working in frequency domain, remember to zero pad the IR's before transforming to make sure they are long enough to contain the results of the convolutions implied by the frequency domain multiplications. Bob -- "Things should be described as simply as possible, but no simpler." A. Einstein
"Bob Cain" <arcane@arcanemethods.com> wrote in message
news:dk48dm02u9e@enews1.newsguy.com...
> > > jeremyscerri@gmail.com wrote: > > Hi, new to this group...I am using Matlab to SIMULATE the de-mixing of > > two audio streams. What I did is as follows: > > > > 1. found two clean audio sources on the internet S1, S2. (4 seconds at > > 11kHz, 16bit) > > 2. found four room/hall impulse responses H11,H12,H21,H22. (3 seconds > > at 11kHz, 16 bit) > > 3. Intention is to simulate pickup by two separate microphones the > > mixed streams X1, X2. > > 4. Hence Convolved S1*H11 & S1*H12 & S2*H21 & S2*H22 > > 5. mic 1 receives X1 = S1*H11+S2*H21 > > 6. mic 2 receives X2 = S1*H12+S2*H22 > > 7. in matrix form X=HS > > 8. hence (H^-1)X=S > > > > and this is the step in which problems arise, the calculation of det(H) > > for some samples is 0 and hence H^-1 is not possible. Any hints? > > > > jeremy > > Try transforming the determinant back to time domain, finding the LMS > time domain inverse of it, transform back to freq domain and multiply > the cofactors with that. Search Levinson-Durbin for the time domain > inversion algorithm. > >
If there are none-min phase terms this will not be possible. Its like expanding 1/(z-2) - it becomes divergent. You would need to identify the non-min phase terms and factor them (or reflect them back within the unit circle first). McC

Real_McCoy wrote:
> "Bob Cain" <arcane@arcanemethods.com> wrote in message > news:dk48dm02u9e@enews1.newsguy.com... >> >> jeremyscerri@gmail.com wrote: >>> Hi, new to this group...I am using Matlab to SIMULATE the de-mixing of >>> two audio streams. What I did is as follows: >>> >>> 1. found two clean audio sources on the internet S1, S2. (4 seconds at >>> 11kHz, 16bit) >>> 2. found four room/hall impulse responses H11,H12,H21,H22. (3 seconds >>> at 11kHz, 16 bit) >>> 3. Intention is to simulate pickup by two separate microphones the >>> mixed streams X1, X2. >>> 4. Hence Convolved S1*H11 & S1*H12 & S2*H21 & S2*H22 >>> 5. mic 1 receives X1 = S1*H11+S2*H21 >>> 6. mic 2 receives X2 = S1*H12+S2*H22 >>> 7. in matrix form X=HS >>> 8. hence (H^-1)X=S >>> >>> and this is the step in which problems arise, the calculation of det(H) >>> for some samples is 0 and hence H^-1 is not possible. Any hints? >>> >>> jeremy >> Try transforming the determinant back to time domain, finding the LMS >> time domain inverse of it, transform back to freq domain and multiply >> the cofactors with that. Search Levinson-Durbin for the time domain >> inversion algorithm. >> >> > If there are none-min phase terms this will not be possible. Its like > expanding 1/(z-2) - it becomes divergent. > You would need to identify the non-min phase terms and factor them (or > reflect them back within the unit circle first).
I hear you but I routinely invert mixed phase IR's with Levinson-Durbin and the results convolve with the arguments to nearly perfect impulses. What you say seems to make sense so I wonder why it works so well. Bob -- "Things should be described as simply as possible, but no simpler." A. Einstein
i need to brush up my dsp basics...if i am understanding correctly, if
we have an impulse response in which we have a zero like (z-2) and we
compute the inverse we would get 1/(z-2) i.e. a pole outside unit
circle. hence we need the minimum-phase property to ensure stability of
inverse. Now i have 2 questions:

1. how do you reflect back into unit circle.
2. by doing so, will you be changing the impulse response (phase or
magnitude).

thanks
jeremy


Bob Cain wrote:

>> If there are none-min phase terms this will not be possible. Its like >> expanding 1/(z-2) - it becomes divergent. >> You would need to identify the non-min phase terms and factor them (or >> reflect them back within the unit circle first). > > I hear you but I routinely invert mixed phase IR's with Levinson-Durbin > and the results convolve with the arguments to nearly perfect impulses. > What you say seems to make sense so I wonder why it works so well.
Since Levinson-Durbin gives an FIR (all zero) LMS approximation to the true inverse, this problem is skated around. It gives the FIR with the minimum of the sum of the squared values of all time domain samples other than the central peak. In practice, with things as mixed phase as room responses to loudspeakers, the results I get are _very_ close to a true FIR inverse so I still don't understand why it works so well. Bob -- "Things should be described as simply as possible, but no simpler." A. Einstein

jeremyscerri@gmail.com wrote:
> i need to brush up my dsp basics...if i am understanding correctly, if > we have an impulse response in which we have a zero like (z-2) and we > compute the inverse we would get 1/(z-2) i.e. a pole outside unit > circle. hence we need the minimum-phase property to ensure stability of > inverse. Now i have 2 questions: > > 1. how do you reflect back into unit circle.
The way to map an FIR to one with all the outside zeros reflected inside is given here: http://www-ccrma.stanford.edu/~jos/filters/Minimum_Phase_Filters_Signals.html http://www.nauticom.net/www/jdtaft/minphase.htm http://www.ece.utexas.edu/~bevans/papers/1999/icassp/ For Matlab: http://www-ccs.ucsd.edu/matlab/toolbox/signal/cceps.html
> 2. by doing so, will you be changing the impulse response (phase or > magnitude).
Phase. Bob -- "Things should be described as simply as possible, but no simpler." A. Einstein