pysparse.cs package¶
Subpackages¶
Submodules¶
pysparse.cs.cs module¶
-
pysparse.cs.cs.
cs1d
(y, Phi, Psi=None, optim='OMP', k=1000, tol=1e-08, osshape=None, verbose=True)[source]¶ Solves the 1-d Compressive Sensing problem
for sparse signal \(\bm x\)
\[{\bm y} = {\bm \Phi}{\bm x} + {\bf n}, \]for non-sparse signal \({\bm x} = {\bm \Psi}{\bm z}\)
\[{\bm y} = {\bm \Phi \Psi}{\bm z} + {\bm n}, \]see https://iridescent.ink/aitrace/SignalProcessing/Sparse/LinearCompressiveSensing/index.html for details.
Parameters: - y (ndarray) – the mesurements \({\bm y}\), if ndarray, each colum is a mesurement
- Phi (2darray) – the mesurement matrix \({\bm \Phi}\)
Keyword Arguments: - Psi (2darray) – the dictionary \({\bm \Psi}\) (default: {None})
- optim (str) – optimization method, OMP, LASSO (default: {‘OMP’})
- k (integer) – sparse degree for OMP, max iter for LASSO (default: size of \({\bm x}\) )
- tol (float) – tolerance of error (LASSO) (default: {1e-8})
- osshape (tuple) – orignal signal shape, such as an H-W image (default: {None})
- verbose (bool) – show log info (default: {True})
Returns: x – reconstructed signal with sieof osshape
Return type: ndarray