# Audio codec analysis in MATLAB: crosstalk

I am currently making an analysis of a codec system that can encode up to 2 wave files into 1 file and decode it. Here is a simple illustration:

L+R ---> ENC --->L'+R'
with L'=L+∂1 & R'=R+∂2


The codec is not lossless and we are analyzing if there is any leakage from one source to another, some kind of crosstalk, if you will.

So what I have to do is find out if ∂1 has traces of R & ∂2 has traces of L.

I feel a general approach would be to subtract L/Ldec to get ∂ and then compare that ∂ to R.

I have done some reading on correlation but it's all a little vague at the moment.

So, onto my question(s):

• Is this possible with limited knowledge of DSP (reading up but it's a lot & not that easy)?
• If not, on what should I do some reading (From what I've gathered so far: correlation & Pearson's coefficient)?
• Is there some sort of standardized test for this - I presume there is but I can't find any!

Even though code snippets would be handy since I only just started to use MATLAB & still am somewhat inexperienced, the main point of this topic is understanding so I can implement it. If someone else implements it I won't learn!

• Is decoded L1' different from L1 in this compression scheme, even in no leakage case, or is it only the leakage that changes it? Nov 8 '12 at 13:52
• Do you expect the original two channels $L$ and $R$ to be uncorrelated with one another, or are they something like stereo channels of a common recording? If they are correlated before the encoder, then checking for cross-correlation after the decoder probably isn't going to be a good approach. Nov 8 '12 at 15:34
• It's an audio codec, so most of the time L/R are going to be correlated at least partly. For my fiddling-around-test-setup I used a 3khz sine signal & a 5khz sine signal and encoded/decoded them. it turned out that the correlation coefficient for (∂L,R) and (L,∂R) was respectively 0,0002 & 0,0007. I concluded that the leakage was negligable! Nov 12 '12 at 9:32

## 1 Answer

Most lossy stereo encoders (MP3, AAC, etc) operate in a joint-stereo mode, i.e. there will be a lot of cross talk between the two channels specifically at higher frequencies and in general they will allocate more bits to the sum then do to difference in the channels which also introduces cross talk. The amount of cross talk will depend heavily on the signal and the bit rate. There isn't an east metric for it. Subtracting the decoded version from the original is also not a great idea since you can't easily distinguish the encoding/decoding artifacts from the cross talk.

• It's a LPCM based codec that we developed ourselves. It is indeed true that there are very little tests that check codec quality metrics. How would you suggest analyzing the crosstalk then? Nov 12 '12 at 9:34