Compressed Sensing library for 1D Spectroscopic Profiling Data
Project description
cs1
Compressed Sensing library for 1D Spectroscopic Profiling Data
module | sub-module | description |
cs1.basis | cs1.basis.common | commonly used non-adaptive CS transform bases |
cs1.basis.adaptive | adaptive CS transform bases, e.g., LDA (linear discriminant analysis)-based, EBP (eigenvector-based projection) | |
cs1.cs | basic functions for CS sensing, recovery, hyper-parameter grid-search, etc. | |
cs1.metrics | CS-related metrics, e.g., mutual coherence, sparsity, MSE, KLD | |
cs1.security | cs1.security.tvsm | time-variant sensing matrix mechanism |
cs1.domain | cs1.domain.audio | contains functions for audio and other one-dimensional signal processing. e.g., wave file I/O, lossy compression, ECG simulator |
cs1.domain.image | contains functions for image processing. e.g., image CS, lossy compression |
Installation
pip install cs1
A simple startup
import cs1
# Generate common non-adaptive bases and save to a local pickle file.
# The generation process can be very slow, so save it for future use.
cs1.basis.common.Generate_PSIs(n, savepath = 'PSIs_' + str(n) + '.pkl') # n is the data/signal dimensionality
# load back bases
file = open('PSIs_' + str(n) + '.pkl','rb')
PSIs = pickle.load(file)
file.close()
# sparsity analysis
cs1.metrics.analyze_sparsity(x, PSIs)
# compare different bases and sampling ratio on a single sample
rmses = cs1.cs.GridSearch_Sensing_n_Recovery(x, PSIs, solver = 'LASSO') # returns relative MSEs
low-level cs functions
from cs1.basis.common import *
dftmtx()
dctmtx()
hwtmtx()
from cs1.cs import *
sensing()
recovery()
from cs1.metrics import *
mutual_coherence()
...
singal processing functions for audio / image domains
from cs1.domain.audio import *
simulate_ECG()
dct_lossy_signal_compression()
dft_lossy_signal_compression()
from cs1.domain.image import *
img_dct()
img_dft()
dct_lossy_image_compression()
dft_lossy_image_compression()
adaptive cs bases
from cs1.basis.adaptive import *
PSI, _ = EBP(X) # X is a m-by-n training dataset. PSI is the EBP basis
PSI, _, _ = LDA(X, y, display = True) # X and y are training dataset. PSI is the LDA basis.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cs1-0.1.3.tar.gz
(33.4 kB
view details)
Built Distribution
cs1-0.1.3-py3-none-any.whl
(35.5 kB
view details)
File details
Details for the file cs1-0.1.3.tar.gz
.
File metadata
- Download URL: cs1-0.1.3.tar.gz
- Upload date:
- Size: 33.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e24f09337aa90a73bb5c4084476b1d467ac023de11d1944f163e53ca3a9a8f84 |
|
MD5 | 85153959c437a7fb43e12a785bfb2b87 |
|
BLAKE2b-256 | f5cc0e00389e9ab5032d32355e865bf1178ba6dc1888346e5f99298af1131ebe |
File details
Details for the file cs1-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: cs1-0.1.3-py3-none-any.whl
- Upload date:
- Size: 35.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 503b1d1e6dacb28ddaf667eddb30d19988dd55aef9dcb583d8729e1f4110eb93 |
|
MD5 | 50b7f110fc91253808486d20b5a53ee0 |
|
BLAKE2b-256 | a5f29a3b9f67a99af5dd233efd0f660deedace33079aef3e27ce94756e2619a8 |