cs1
Compressed Sensing library for 1D (one-dimensional) Spectroscopic Profiling Data
| package | module | sub-module | description |
|---|---|---|---|
| cs1[3] | |||
| cs1.cs | basic functions for CS sensing, recovery, hyper-parameter grid-search, etc. | ||
| cs1.basis | cs1.basis.common | commonly used non-adaptive CS transform bases[1] | |
| cs1.basis.adaptive | adaptive CS transform bases, e.g., LDA (linear discriminant analysis)-based, EBP (eigenvector-based projection)[2], VAE (variational auto-encoder) | ||
| cs1.metrics | CS-related metrics, e.g., mutual coherence, sparsity, MSE, KLD | ||
| cs1.security | cs1.security.tvsm | time-variant sensing matrix mechanism[4] | |
| 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 | ||
| cs1.gui | provides a web-based playground for researchers. users can try different CS bases and sampling ratios | ||
Publications:
[1] Adaptive compressed sensing of Raman spectroscopic profiling data for discriminative tasks [J]. Talanta, 2020, doi: 10.1016/j.talanta.2019.120681
[2] Task-adaptive eigenvector-based projection (EBP) transform for compressed sensing: A case study of spectroscopic profiling sensor [J]. Analytical Science Advances. Chemistry Europe, 2021, doi: 10.1002/ansa.202100018
[3] Compressed Sensing library for spectroscopic profiling data [J]. Software Impacts, 2023, doi: 10.1016/j.simpa.2023.100492
[4] Secured telemetry based on time-variant sensing matrix – An empirical study of spectroscopic profiling, Smart Agricultural Technology, Volume 5, 2023, doi: 10.1016/j.atech.2023.100268
[5] Variational Auto-Encoder based Deep Compressed Sensing on Raman Spectroscopy [J]. Smart Agricultural Technology. 2025
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
mses, rmses = cs1.cs.GridSearch_Sensing_n_Recovery(x, PSIs, solver = 'LASSO') # returns MSEs and 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.
run as a local web server
python -m cs1.gui.run
You can then access the web GUI at the 5006 port:
Metadata
Release files for cs1 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cs1-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for cs1-0.3.0-py3-none-any.whl |
Release files / cs1-0.3.0-py3-none-any.whl
| Download URL | cs1-0.3.0-py3-none-any.whl |
|---|---|
| Size | 3.0 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f4e80e4977d16102ddf72e947a863c22f88c403b29a20b8fb5e1a858a4398b47
|
|
BLAKE2b-256 checksum How to use checksums |
104fa7c48ba605e226722b772729b67525a7a68bc3b7b05d16bc35bf7288b5f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.3
|
Security for cs1 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.