# Mid/Side encoding/decoding in frequency domain instead of time domain

In the time domain let's say we have a signal $L_t$ and $R_t$. Then we can do mid/side encoding/decoding like so:

$$M_t = \frac{L_t + R_t}{2}$$ $$S_t = \frac{L_t - R_t}{2}$$

$$L_t = M_t + S_t$$ $$R_t = M_t - S_t$$

Let's say the we convert a block of $N$ values from $L_t$ and $R_t$ to the frequency domain by zero padding and taking their FFT to yield $L_f$ and $R_f$. Is it possible to do a similar encoding for mis/side in the frequency domain i.e. convert $L_f$ and $R_f$ to $M_f$ and $S_f$? So that the inverse FFT of $M_f$ and $S_f$ would yield $M_t$ and $S_t$?

$$a\cdot\text{DFT}\{x\}+b\cdot\text{DFT}\{y\}=\text{DFT}\{a\cdot x+b\cdot y\}.$$
As a consequence, you can directly convert the equations for the mid and side signals from the time domain to the frequency domain. Simply replace the subscript $t$ with $f$:
$$M_f = \frac{L_f + R_f}{2}\\ S_f = \frac{L_f - R_f}{2}\\ \vdots$$
From $M_f$, $S_f$ you can then compute the inverse discrete Fourier transform to obtain $M_t$, $S_t$.