# Preserve specific information in compressed sensing

I have a signal that isn't perfectly sparse and I would like to apply compressed sensing on it for lossy compression. However I would like to preserve specific section of the signal so that this "important" section can be perfectly reconstructed.

Is it possible? How?
(I hope this is ok to ask this kind of question - I'm not very deep in the theory of CS, just playing with code samples after reading brief overviews).

• Do you know in advance where this section is? Is it a specific (temporal?) window of the signal or do you know the subspace it resides in? If you know in advance where it is, it is certainly possible. You apply compression only to the rest of the signal. But to know whether this is a valid assumption, you need to say some more about what you mean by "specific section". Sep 30 '20 at 14:08
• @Florian , thanks. I know in advance where the section is - say, I have a vector representing telemetry information - I'm ok with lossy compression, but know indices [i...n] where there is important information which I don't want to loose. Of course, I can copy that section before sampling, or can apply CS only to the rest of the vector, but I would like to use only CS, on the whole signal, and still be sure that this part can be reconstructed exactly. Thank you! Oct 1 '20 at 7:19
• Then you need to explain what CS means for you. I'm thinking something like "measuring"/transmitting $\Phi x$ instead of $x$ where $\Phi$ is $M \times N$ with $M < N$. In this case you can design $\Phi$ such that a certain section of the signal is unaffected, i.e., constraining a part of $\Phi$ to be the identity matrix. If you don't want to do this, you need to explain why (and maybe what CS means for you). Oct 1 '20 at 7:28
• @Florian - This is exactly what I'm looking for. Could you please elaborate on how to constrain a part of Φ to be the identity matrix? ( - and put it as an answer so I can accept it). Thank you again. Oct 1 '20 at 9:21

Say you want to perform "linear compression" àla Compressed Sensing to a vector, i.e., reduce a length-$$N$$ vector $$\mathbf x$$ to a length-$$M 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} & \mathbf 0 & \mathbf\Phi_{13} \\ \mathbf 0 & \mathbf I_{N_2} &\mathbf 0 \\ \mathbf \Phi_{31} & \mathbf 0 & \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.