Exercises

ex01-lasso-implementation

Easy

(a) Generate a 1D sparse signal c0∈C256\mathbf{c}_{0} \in \mathbb{C}^{256} with s=10s = 10 nonzero entries (random complex amplitudes). Create measurements y=Ac0+w\mathbf{y} = \mathbf{A}\mathbf{c}_{0} + \mathbf{w} with Gaussian A∈C100Γ—256\mathbf{A} \in \mathbb{C}^{100 \times 256} and SNR=25\text{SNR} = 25 dB.

(b) Implement FISTA with complex soft-thresholding. Run for 200 iterations with step size ΞΌ=1/Lf\mu = 1/L_f.

(c) Plot the objective function F(c(t))F(\mathbf{c}^{(t)}) vs. iteration and verify the O(1/t2)O(1/t^2) rate.

(d) Implement the debiasing step: restrict to the detected support and solve least-squares. Compare the amplitude error before and after debiasing.

ex02-lambda-selection

Easy

Using the setup from Exercise 1:

(a) Run FISTA for λ∈{10βˆ’4,10βˆ’3,10βˆ’2,10βˆ’1,1}\lambda \in \{10^{-4}, 10^{-3}, 10^{-2}, 10^{-1}, 1\}. For each, record the final NMSE and βˆ₯c^βˆ₯0\|\hat{\mathbf{c}}\|_0.

(b) Implement the discrepancy principle: find Ξ»\lambda such that βˆ₯Ac^βˆ’yβˆ₯2=MΟƒ\|\mathbf{A}\hat{\mathbf{c}} - \mathbf{y}\|_2 = \sqrt{M}\sigma via bisection search.

(c) Implement 5-fold cross-validation on 20% held-out measurements.

(d) Compare the three methods (grid search, discrepancy, CV). Which yields the lowest NMSE?

ex03-admm-lasso

Easy

(a) Implement ADMM for the LASSO with splitting c=z\mathbf{c} = \mathbf{z}, penalty ρ=1\rho = 1.

(b) Run for 100 iterations. Plot primal and dual residuals.

(c) Implement adaptive ρ\rho (residual balancing, Ο„=2\tau = 2, ΞΌ=10\mu = 10). Compare convergence with fixed ρ\rho.

(d) Compare the final ADMM solution with FISTA. Verify they are identical up to numerical precision.

ex04-2d-imaging

Medium

(a) Create a 2D MIMO radar imaging setup: Nt=4N_t = 4, Nr=8N_r = 8, Nf=32N_f = 32 at 10 GHz with 2 GHz bandwidth. Scene: 32Γ—3232 \times 32 grid, 8 point scatterers. SNR=20\text{SNR} = 20 dB.

(b) Compute the matched filter image c^MF=AHy\hat{\mathbf{c}}_{\text{MF}} = \mathbf{A}^{H}\mathbf{y}.

(c) Run FISTA for 100 iterations. Compare MF and FISTA in NMSE, SSIM, and support F1-score.

(d) Apply debiasing. How much does it improve the amplitude RMSE?

(e) Vary SNR\text{SNR} from 5 to 40 dB. Plot NMSE vs. SNR\text{SNR} for MF, FISTA, and FISTA+debiasing.

ex05-tv-imaging

Medium

(a) Create a 2D scene (64Γ—6464 \times 64) with 3 extended targets: a rectangle, a circle, and an L-shape. All piecewise-constant.

(b) Generate compressed measurements (M/N=0.3M/N = 0.3) using a random sensing matrix. SNR=20\text{SNR} = 20 dB.

(c) Reconstruct using: (i) β„“1\ell_1 (FISTA), (ii) isotropic TV (ADMM), (iii) anisotropic TV (ADMM).

(d) Compare NMSE, SSIM, and edge preservation.

(e) Add 5 point scatterers to the scene. Reconstruct with β„“1\ell_1, TV, and β„“1\ell_1 + TV. Show that the combined penalty is superior for this mixed scene.

ex06-group-lasso

Medium

(a) Create a radar imaging scene where each scatterer has a frequency-dependent reflectivity: ck(f)=Ξ±k(f/f0)Ξ²c_k(f) = \alpha_k(f/f_0)^\beta with random β∈[βˆ’2,2]\beta \in [-2, 2]. Grid: 32Γ—3232 \times 32, 4 frequency bands, s=6s = 6 scatterers.

(b) Formulate as a group LASSO with groups = (pixel, all frequencies). Group size d=4d = 4.

(c) Solve with: (i) standard LASSO (independent per frequency), (ii) group LASSO (FISTA with block soft-thresholding).

(d) Compare support recovery F1-score and amplitude RMSE.

(e) Reduce measurements per band to 50% of Nyquist. How much does group LASSO improve over standard LASSO?

ex07-omp-vs-lasso

Medium

(a) Generate 1D imaging problems with N=512N = 512, M=128M = 128, and varying sparsity s∈{5,10,20,30,40,50}s \in \{5, 10, 20, 30, 40, 50\}. SNR=20\text{SNR} = 20 dB.

(b) For each ss, run: OMP (stopping at ss iterations), CoSaMP (ss target sparsity), and LASSO (FISTA, optimal Ξ»\lambda).

(c) Plot NMSE vs. ss for all three methods. At what ss does each method start failing?

(d) Plot computation time vs. ss. At what ss is OMP faster than FISTA?

(e) Make the signal compressible (power-law decay with q=0.5q = 0.5). How do the results change?

ex08-admm-composite

Hard

(a) Implement ADMM for the composite problem: min⁑12βˆ₯Acβˆ’yβˆ₯2+Ξ»1βˆ₯cβˆ₯1+Ξ»2βˆ₯cβˆ₯TV\min \frac{1}{2}\|\mathbf{A}\mathbf{c}-\mathbf{y}\|^2 + \lambda_1\|\mathbf{c}\|_1 + \lambda_2\|\mathbf{c}\|_{\text{TV}}. Use two splitting variables.

(b) Create a scene with 5 point scatterers and 2 extended targets. N=64Γ—64N = 64 \times 64, M=2048M = 2048, SNR=20\text{SNR} = 20 dB.

(c) Sweep (Ξ»1,Ξ»2)(\lambda_1, \lambda_2) on a 10Γ—1010 \times 10 grid. Plot the 2D NMSE surface.

(d) Find the optimal (Ξ»1βˆ—,Ξ»2βˆ—)(\lambda_1^*, \lambda_2^*). How does the ratio Ξ»1βˆ—/Ξ»2βˆ—\lambda_1^*/\lambda_2^* relate to the scene composition?

(e) Compare pure β„“1\ell_1, pure TV, and the optimal combination.

ex09-gridless-refinement

Hard

(a) Generate a scene with 5 point scatterers at off-grid positions on a 6464-point grid.

(b) Solve standard LASSO on the grid. Identify detected scatterers.

(c) Implement SPARROW-style refinement: parameterize pk=pnk+Ξ΄k\mathbf{p}_{k} = \mathbf{p}_{n_k} + \delta_k and optimize Ξ΄k\delta_k by gradient descent on the data fidelity.

(d) Compare position error (RMSE) before and after refinement.

(e) Increase grid density to N=128,256,512N = 128, 256, 512. At what density does refinement become unnecessary?

ex10-mmv-radar

Hard

(a) Simulate radar observing s=10s = 10 scatterers across L=1,2,4,8,16,32L = 1, 2, 4, 8, 16, 32 snapshots. M=200M = 200, N=1024N = 1024. SNR=10\text{SNR} = 10 dB per snapshot. Swerling I amplitudes.

(b) For each LL, solve: (i) independent LASSO per snapshot then threshold the average support, (ii) MMV (β„“2,1\ell_{2,1}).

(c) Plot support F1-score vs. LL for both methods.

(d) What is the minimum LL for 90% support detection?

(e) Compute the "snapshot gain" (dB equivalent of extra measurements from joint processing).

ex11-pesavento

Hard

(a) Implement the Pesavento iteratively reweighted β„“2,1\ell_{2,1} algorithm (IR-β„“2,1\ell_{2,1}) for the MMV problem.

(b) Compare with standard group LASSO on the multi-frequency imaging setup from Exercise 6.

(c) Run for 10 outer reweighting iterations. Plot the support F1-score vs. outer iteration.

(d) Does IR-β„“2,1\ell_{2,1} converge to a sparser solution than standard group LASSO? Count the number of nonzero rows.

(e) Compare the computational cost per outer iteration with solving a single group LASSO from scratch.

ex12-tgv

Hard

(a) Create a scene with a target whose reflectivity varies linearly (gradient from c=0.2c = 0.2 to c=0.8c = 0.8 across a 20Γ—2020 \times 20 region) surrounded by zero background.

(b) Reconstruct with: (i) isotropic TV (ADMM), (ii) TGV order 2 (ADMM with two auxiliary variables).

(c) Compare visually: does TV produce staircase artifacts? Does TGV recover the smooth gradient?

(d) Sweep the TGV parameters (Ξ±0,Ξ±1)(\alpha_0, \alpha_1) and find the optimal ratio Ξ±0/Ξ±1\alpha_0/\alpha_1.

(e) Add sharp edges to the scene (a rectangular cutout inside the gradient region). Does TGV preserve both the edges and the smooth gradient?

ex13-algorithm-comparison

Hard

Build a systematic comparison of all algorithms on a standardized RF imaging benchmark:

(a) Setup: MIMO radar, Nt=4N_t = 4, Nr=8N_r = 8, Nf=64N_f = 64 (M=2048M = 2048). Scene: 32Γ—3232 \times 32 (N=1024N = 1024). Three sparsity levels: s=5,15,30s = 5, 15, 30. SNR=20\text{SNR} = 20 dB.

(b) Algorithms: Matched filter, FISTA, ADMM, OMP, CoSaMP, IHT.

(c) Metrics: NMSE, support F1, computation time, iterations to βˆ’15-15 dB NMSE.

(d) Create a comparison table. For each ss, rank by NMSE and by speed.

(e) Plot Pareto fronts (NMSE vs. time) for each ss. Which algorithms are Pareto-optimal?

ex14-atomic-norm

Hard

(a) Implement the atomic norm SDP for a ULA with M=16M = 16 elements. Use a standard SDP solver (e.g., CVXPY with SCS).

(b) Generate K=3K = 3 point sources at off-grid angles. Solve the SDP and extract the source angles from the dual variable.

(c) Compare with grid-based LASSO on grids of N=36,180,1800N = 36, 180, 1800 points. Plot position error vs. grid density.

(d) Vary the source separation from 3Γ—3\times to 0.5Γ—0.5\times the Rayleigh limit. At what separation does the SDP fail?

(e) Compare computation time: SDP vs. LASSO vs. SPARROW.

ex15-full-pipeline

Challenge

Build an end-to-end sparse RF imaging pipeline:

(a) System: MIMO radar at 77 GHz, Nt=8N_t = 8, Nr=16N_r = 16, 4 GHz bandwidth, Nf=128N_f = 128. Scene: 64Γ—6464 \times 64 at 5 m range.

(b) Scene: Urban scenario β€” 10 vehicles (extended, 3--5 pixels each), 20 pedestrians (point-like), 5 buildings (large extended).

(c) Compression: Randomly subsample 30% of measurements.

(d) Pipeline: (i) Matched filter (fast preview). (ii) FISTA (β„“1\ell_1) for sparse reconstruction. (iii) ADMM (β„“1\ell_1 + TV) for final image. (iv) SPARROW refinement for the strongest 10 scatterers.

(e) Evaluation: NMSE, SSIM, target detection (PdP_d and PfaP_{fa}), computation time per stage.

(f) Create a processing time vs. quality curve. What is the optimal stopping point at 100 ms? 500 ms? 5 s?