Skip to main content

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


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

Uploaded Source

Built Distribution

cs1-0.1.0-py3-none-any.whl (24.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cs1-0.1.0.tar.gz
  • Upload date:
  • Size: 22.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for cs1-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2c95e2852fc984674e6c7660a8f382da5b49f312320b2223d24125e125650bea
MD5 260fc3b3422608814078c8d892f5607c
BLAKE2b-256 da275c7f2a0eec4d0d542f4bf2e0805378ea05af3ba7fcfa867b5ec550f153a3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cs1-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 24.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for cs1-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4e3daacf7e2d25660aeb0efb5f6a2df76383cdfe42c974f13aa5e9ae32a24a63
MD5 489521d011b53eaf1fe128611dc0e0ea
BLAKE2b-256 84a92b42b273c02f23b9eca329b97895d8520aa13469447cf00dc9d476151360

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