# Combining channels into single FFT left/right vs mid/side

I am creating a spectrum analyser to visualize some stereo audio data in real time. I want to display a single spectrum for the input and a single spectrum for the output. The stereo data is the usual two channels: left (L) and right (R).

I am combining them into a single channel by taking the FFT of L + R. Is this conventional or would it be more appropriate to combine FFT(L) + FFT(R) rather than use FFT(L + R).

Also if I encode the left and right channels as mid (M) and side (S) do some processing on each of M and S and convert back to L and R then I observe the following:

If the side channel is modified, then taking FFT(L + R) shows no visible difference between the input and output (because L + R is pretty much the mid channel without side) so the question is: is there a way to combine the mid and side channels together so that taking the FFT of them gives a good representation of the sound. Or should I be doing FFT(L) + FFT(R) for both L/R and M/S processing modes? I would rather not have to do two FFTs if one would suffice.

If I get you correctly, your first question is: What is more appropriate, taking the DFT (via the FFT algorithm) of the sum,

$$\text{DFT}\left\{l + r\right\},$$

or summing the DFTs

$$\text{DFT}\left\{l\right\} + \text{DFT}\left\{r\right\}?$$

Due to the linearity of the DFT (and, hence, the FFT) they are the same

$$\text{DFT}\left\{l + r\right\} = \text{DFT}\left\{l\right\} + \text{DFT}\left\{r\right\}.$$

However, summing $l + r$ in the time domain will lead to lower computational requirements than taking two DFTs and then summing, of course.

The second topic concerns mid/side encoding.

The sum signal, $l + r$, does not change when you modify the side information. Let's check the equalities for mid ($m$) and side ($s$) signal

\begin{eqnarray} m & = & \frac{l+r}{2}\\ s &=& \frac{l-r}{2}. \end{eqnarray}

L + R is pretty much the mid channel without side

In fact, it is exactly the mid signal (up to a scaling factor).

The mid signal contains everything that is identical in both channels - the side signal contains everything that has a $180°$ phase shift between both channels. All modifications that are done to the side signal cancel out completely when summing up both channels. I'll detail this a little bit in the following.

You know that the left ($l$) and right ($r$) signals are obtained from the m/s representation as follows

\begin{eqnarray} l & = & m + s\\ & = & \frac{l+r}{2} + \frac{l-r}{2}\\ & = & l \end{eqnarray}

and

$$r = m-s.$$

Computing $l + r$ simply cancels out the side signal:

\begin{eqnarray} l + r & = & \left(m+s\right) + \left(m-s\right)\\ & = & 2\cdot m \end{eqnarray}

In summary: If you want a proper representation of what happened to the m/s signals summing the channels will probably not work. However, you will have to decide what a good representation is for your application.

• As you are displaying the "spectra": You are probably displaying the power spectral density (PSD) of the spectra, not the (complex) spectra themselves. In this case, as @hotpaw2 mentioned, there will be differences between computing the PSD for the sum or summing the PSDs of the individual channels. Probably my answer above is not of big use in this case... Apr 14 '16 at 8:20
• Thanks for your answer. Although it doesn't strictly answer my question you have inspired me to think about my problem in a new way. I agree the sum of the integrals of two functions is the same as the integral of the sum of two functions, hence the linearity of the FFT/DFT as they are pretty much continuous/discrete integrals. However as you've pointed out I'm creating a spectrum analyser which displays power so I take the magnitude of each component of the output of the DFT which means I should probably be doing two FFTs to get the total power either on L/R or M/S - thanks :-) Apr 14 '16 at 8:47
• I don't know which platform you are developing on, but with modern libraries, taking the FFT might not a big add to the overall computational requirements... Maybe you can just display three PSDs: Left, right, (or mid, side) and sum: This has been done in many cases and, at least in my opinion, is quite useful - depending on the application, of course. Apr 14 '16 at 9:54

Whether FFT(L+R) will work depends on how the stereo recording was mic'd and mixed.

If just 2 separated stereo microphones were used to record a group of spatially separated sound sources (say an orchestra), then there will be location and frequency dependent phase differences between the 2 channels than could cause cancellations or nulls in a simple (L+R) mono mix. If a lot of individually mic'd tracks were mixed down into 2 channels, this might be less of a problem.

• I gave you an up-vote as I think you're statement is correct and helpful but didn't offer any insight into how I should proceed to measure my mid and side so didn't feel I could mark as correct. Apr 14 '16 at 8:49