Preserve specific information in compressed sensing
As a result of the discussion, let me provide an answer here.
Say you want to perform &quot;linear compression&quot; àla Compressed Sensing to a vector, i.e., reduce a length-$N$ vector $\mathbf x$ to a length-$M&lt;N$ vector $\mathbf y$ via a linear transformation $\mathbf \Phi$ such that $\mathbf y = \mathbf \Phi \mathbf x$. Further assume that $\mathbf x$ may be partitioned into $\mathbf x = [\mathbf x_1^T, \mathbf x_2^T, \mathbf x_3^T]^T$, where $\mathbf x_i$ are length $N_i$ vectors and $N = N_1 + N_2 + N_3$. Further, $\mathbf x_2$ is a part of your signal you do not want to compress so that the actual compression is only applied to $\mathbf x_1$ and $\mathbf x_3$.
The most general way of achieving this is by structuring $\mathbf \Phi$ as $$\mathbf \Phi = \begin{bmatrix} \mathbf \Phi_{11} &amp; \mathbf 0 &amp; \mathbf\Phi_{13} \\
\mathbf 0 &amp; \mathbf I_{N_2} &amp;\mathbf 0 \\
\mathbf \Phi_{31} &amp; \mathbf 0 &amp; \mathbf\Phi_{33}
\end{bmatrix} $$ where $\mathbf \Phi_{ij}$ is $M_i \times N_j$ for $i, j \in \{1,3\}$ and $M = M_1 + N_2 + M_3$.
Applying this $\mathbf \Phi$ we can see that $\mathbf y$ will be partioned as well, i.e., $\mathbf y = [\mathbf y_1^T, \mathbf y_2^T, \mathbf y_3^T]^T$ where $\mathbf y_1 = \mathbf \Phi_{11} \mathbf x_1 + \mathbf \Phi_{13}\mathbf x_3$, $\mathbf y_3 = \mathbf \Phi_{31} \mathbf x_1 + \mathbf \Phi_{33}\mathbf x_3$ and $\mathbf y_2 = \mathbf x_2$, as desired.