Center for Compressive Sensing Center for Compressive Sensing

Home

Outreach

Publications

Principal Investigators

Students

Tutorials

 

Matlab Compressive Sensing Tutorial

Examples of Compressive Sensing

The Matlab codes go through two examples (sparse_in_time.m & sparse_in_frequency.m) which can be downloaded freely from here.

The first example deals with the signal sparse in Frequency domain and hence random measurements are taken in Time domain. The second example deals with the signal sparse in Time domain and the random measurements are taken in the Frequency domain. In both examples l1-magic Matlab code is used to recover the signal. The Matlab code is freely available from the following website which is required to run the two Matlab examples. http://www.acm.caltech.edu/l1magic/

In using l1-magic, we change the file l1eq_pd.m found in the directory \l1magic-1.1\Optimization\ as follows.

On line 141 change the following line from

[dv,hcond] = linsolve(H11p, w1p,opts);

to,

[dv,hcond] = linsolve(H11p, w1p);

This is because the structure opts specify the property of the matrix A in solving Ax=b linear system of equations and omitting the structure opts in the linsolve function will allow Matlab to choose the appropriate solver automatically.

Sparse in Frequency (sparse_in_frequency.m)

This code demonstrates the compressive sensing using a sparse signal in frequency domain. The signal consists of summation of two sinusoids of different frequencies in time domain. The signal is sparse in Frequency domain and therefore K random measurements are taken in time domain.

After running the code, the first figure shows the time domain signal and it’s DFT. The second figure shows the recovered signal spectrum along with the original signal spectrum. The Third figure shows the recovered signal in time domain and compares it with the original time domain signal.

Sparse in Time (sparse_in_time.m)

This code demonstrates the compressive sensing using a sparse signal in Time domain. The signal consists of a UWB (Ultra Wide Band) pulse in time domain. The signal is sparse in Time domain and therefore K random measurements are taken in Frequency domain.

After running the code, the first figure shows the time domain signal and it’s DFT. The second figure shows the recovered signal along with the original signal in Time Domain.

   
 
 
  Copyright © 2010 Center for Compressive Sensing
University of Michigan College of Engineering Electrical Engineering and Computer Science