Installing toolboxes and setting up the path.

You need to unzip these toolboxes in your working directory, so that you have toolbox_signal and toolbox_general in your directory.

For Scilab user: you must replace the Matlab comment '%' by its Scilab counterpart '//'.

Recommandation: You should create a text file named for instance numericaltour.sce (in Scilab) or numericaltour.m (in Matlab) to write all the Scilab/Matlab command you want to execute. Then, simply run exec('numericaltour.sce'); (in Scilab) or numericaltour; (in Matlab) to run the commands.

One needs to set-up either the sparsity parameter \(s \in \NN\) or the error contraint \(\epsilon \geq 0\). These parameters
should be tuned in accordance to the noise level, and when there is not noise, \(w=0\), one should set \( \epsilon=0 \) and
solve the problem \[ \umin{\Phi x = y} \norm{x}_0. \]

This update is computed in closed form as \[ \mu = c_i \de_i \] where the correlation vector is \[ c = \Phi^* (y-\Phi x^{(\ell)})
\in \RR^N \] and where \(\de_i\) is the Dirac at position \(i\) that maximizes the absolute correlation \[ \umax{ i } \abs{c_i}
\]

Compute the correlation.

c = Phi'*(y-Phi*x);

Display the correlation.

clf;
stem( abs(c), 'b.' );
axis tight;

Extract the coefficient with maximal correlation

[~,i] = max(abs(c));

Update the coefficients

x(i) = x(i) + c(i);

Exercice 1: (check the solution) Perform the Matching pursuit. Record the evolution of the solution \(x^{(\ell)}\) as well as the maximum correlation \(
\la^{(\ell)} = \abs{c_i} \). Display the decay of the error \( E(\ell) = \norm{y-\Phi x^{(\ell)}}. \)

exo1;

One can shows that the error \(\norm{y-\Phi x^{(\ell)}}\) converges toward zero when \(\ell\) increases.

Display the signal to recover and the signal recovered with a large number of iterations (thus corresponding to \(\epsilon=0\)).
Note how the noise impacts the recovered vector.

Display the evolution of each entry of \(x^{(\ell)}\) (different colors) with \(\norm{y-\Phi x^{(\ell)}}\). We display the
evolution of the correct components (those indexed by the support \(I\) of \(x_0\)) in color, and the wrong components (indexed
by \(J=I^c\)) in black.

At an iteration \(\ell\) of the algorithm, one computes a standard MP step \[ \tilde x = x^{(\ell)} + \mu \] and the next
iteration is computed by projecting \(\tilde x\) on the known support \[ x^{(\ell+1)} = \uargmin{ I(x)=I(\tilde x) } \norm{y-\Phi
x} \] where \(I(x)\) is the support of the solution \[ I(x) = \enscond{ i \in \{1,\ldots,N\} }{ x_i \neq 0 }. \]

This \(\ell^2\) minimization can be solved in closed form as \[ x^{(\ell+1)}_I = \Phi_I^+ y \qwhereq A^+ = (A^*A)^{-1}
A^* \qandq I = I(\tilde x), \] where we used the shorthand notation \(x_I = (x_i)_{i \in I} \in \RR^{\abs{I}}\) and \(\Phi_I
\in \RR^{P \times \abs{I}}\) is the sub-matrix obtained by extracting from \(\Phi\) the columns indexed by \(I\).