Skip to main content

Compressed Sensing library for 1D Spectroscopic Profiling Data

Project description

cs1

Compressed Sensing library for 1D Spectroscopic Profiling

Installation

pip install cs1

A simple startup

from cs1.cs import *

# 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.
cs.Generate_PSIHs(n, savepath = 'PSIHs_' + 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
Analyze_Sparsity(x, PSIs)
# compare different bases and sampling ratio on a single sample
rmses = GridSearch_Sensing_n_Recovery(x, PSIs, solver = 'LASSO') # returns relative MSEs

low-level cs functions

dftmtx()
dctmtx()
hwtmtx()
Sensing()
Recovery()
Mutual_Coherence()
...

singal processing functions for other domains

Simulate_ECG()
dct_lossy_signal_compression()
dft_lossy_signal_compression()
img_dct()
img_dft()
dct_lossy_image_compression()
dft_lossy_image_compression()

adaptive cs bases

from cs1.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


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.0.6.tar.gz (18.0 kB view details)

Uploaded Source

Built Distribution

cs1-0.0.6-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file cs1-0.0.6.tar.gz.

File metadata

  • Download URL: cs1-0.0.6.tar.gz
  • Upload date:
  • Size: 18.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/1.5.0 pkginfo/1.8.2 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for cs1-0.0.6.tar.gz
Algorithm Hash digest
SHA256 466e11d891617815af3a1b5bf6ba08ed0a3a696a909847bfb342917af48b2dee
MD5 d9a722c642e4b11396984eaee7dee6e0
BLAKE2b-256 d40c8b934faca413ecb52b1a99164c16e528441a8c502d3499cb55ac34e9c99e

See more details on using hashes here.

File details

Details for the file cs1-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: cs1-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/1.5.0 pkginfo/1.8.2 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for cs1-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 00c499adce3ce1079b9b27999e9a88f5cf141541eeb69a4632b2f39e1f71a0a5
MD5 ef885c5a7d02f0947eb8b2911d535e2e
BLAKE2b-256 5826e511dbc7ab528197af388e165601b384204987d18efd0d02a6c58af6fa14

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page