simulating directional interference to evaluate model performance

I have a model for audio processing. The model receives as input, a source, convolved with a room impulse response (RIR). I would like to test the performance of the model against inputs containing directional interference. The sources and interferences are simply audio recordings (for example human speech, a dig bark, car engine, etc.). both source and interference are convolved with two different RIRs (with respect to angle) and then a gain $$A$$ is applied to the noise in order to control the desired SIR.

The signals power: $$P_s(t)=mean(x^2(t))$$

The interference (noise) power: $$P_n(t)=mean(n^2(t))$$

The amplified interference power: $$P_{An}(t)=mean(A^2n^2(t))=A^2mean(n^2(t))=A^2P_n(t)$$

And if we want to isolate $$A$$, we have: $$SIR=10 \log\left(\frac{P_s(t)}{A^2P_N(t)}\right)$$ $$A=\sqrt{\frac{P_s(t)}{10^{\frac{SNR}{10}}P_N(t)}}$$

Now, considering I am working from a dataset of audio files with variable length, will this not cause a problem due to the averaging process? For example, if the interference is of length $$T_1$$ and the source is of length $$T_2>T_1$$. The interference will be of worst than the desired SIR in the interval $$0 and better in the interval $$T_1.

• Is my thought process correct?
• Is there a known method of dealing with such a problem?
• How do I set the correct SNR for such an experiment?
• I am really confused about the purpose of what you are trying to do? What goal are you trying to achieve? When you say isolate A then is there a known noise level and an unknown amplification of that noise that you are trying to solve for? Giving a very clear purpose and desired outcome would be helpful in case you are too far down the wrong path. – Dan Boschen Nov 11 '19 at 12:46
• @DanBoschen As written in the question, the SIR is "desired" hence known and the goal and purpose are to test the performance of the model against inputs containing directional interference. When I say isolate $A$ I am trying to isolate the amplification that will lead me to the desired $SIR$. Note that I did edit the post so that SNR became SIR. – havakok Nov 11 '19 at 13:20
• I see- yes that is clearer now. Do you have the ability to transmit a known sounding pattern? If so I have a direct approach you can use to compute SIR if that is your quesiton. – Dan Boschen Nov 11 '19 at 13:25
• What do you mean by a "known sounding pattern"? Are you referring to a coherent sound? in general, my source and interference are recordings of some classes. I don't think that they fall under the definition of "known". Am I understanding you correctly? – havakok Nov 11 '19 at 13:30
• Yes a known reference that occupies all the frequencies of interest in your band. If you have such a noise free sound reference that you can transmit then you can use correlation to determine the SIR at the receiver. But arbitrary recordings of classes wouldn't apply as you only have the received signal, not the noise free reference and those sources may not sufficiently occupy the frequency band. – Dan Boschen Nov 11 '19 at 13:38

I would suggest doing this: take the source audio file and interference audio file, figure out which is longer, zero pad the shorter one so they are of equal length. Now compute the metric, "sample-by-sample SIR", by doing $$\frac{s[n]^2}{i[n]^2}$$. Just be careful when $$i[n]=0$$. This is where knowledge of the noise (real noise, not interference) would be helpful so that you could ideally report SINR (signal to interference plus noise ratio) and avoid the denominator being $$0$$ problem.
• Right. The other way, that I can think of, would be to zero pad, compute the average powers like you described and do your gain calculation. But you need to sure to distinguish between times when the interference is present and not. If during 10 seconds, you have interference present in the last 6 seconds then how will you report the SINR for it? Showing a plot would be nice, during the first 4 seconds no interference so SINR = SNR, then interference kicks on so you get whatever SINR you choose $A$ to set to – Engineer Nov 11 '19 at 13:33