After my first post on compressive sensing I extended the simple script a bit. The new script is trying to reconstruct different levels of sparsity and undersampling factors. Then it calculates the root mean squared error (RMSE).

The following graph shows the RMSE:

The blue regions show very small RMSE but then there is quite a sharp change when the sparsity decrases and/or the undersampling factor increases (as expected). The code for the graph is on Github.

I also did some experiments using cvxpy. Currently it seems cvxpy is more accurate, but also quite a bit slower :-( I will post a comparison another time.