Skip to content
This repository was archived by the owner on Sep 27, 2024. It is now read-only.

ARCHIVED - Kronecker technique for improving quality of the signal in compressive sensing recovery. Transposing to Python, to the best of my ability, the work from https://github.com/hadizand/Kronecker-based-CS-recovery. (Originally in MATLAB)

Notifications You must be signed in to change notification settings

RosNaviGator/Kronecker-based-CS-recovery-RNG

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kronecker-based-CS-recovery -- ECG data -- ARCHIVED

This project has been archived and will no longer be maintained.

The work from this repository, along with contributions from other reports, converged and has been merged into a final project:

Please visit the new repository for the latest developments, including updates, improvements, and Python implementations of the algorithms.


Fork to study and to port to python the work of Kronecker-based-CS-recovery

I will leave as description the original one by Hadi Zanddizari, it also includes all the references to Kronecker Technique, Compressed Sensing, SL0 recovery algorithm, MIT-BIH Arrhythmia database

Original description (by Hadi Zanddizari)

Kronecker Technique for Improving Signal Quality in Compressive Sensing Recovery

This code demonstrates the effect of the Kronecker technique on compressive sensing recovery. This technique has been used for different signals and measurement matrices and has been published in multiple journals and conference papers:

  1. H. Zanddizari, S. Rajan, and H. Zarrabi, “Increasing the quality of reconstructed signal in compressive sensing utilizing Kronecker technique,”
    Biomedical Engineering Letters, vol. 8, no. 2, pp. 239–247, May 2018.

  2. D. Mitra, H. Zanddizari, and S. Rajan, "Investigation of Kronecker-based recovery of compressed ECG signal,"
    IEEE Transactions on Instrumentation and Measurement, pp. 1-1, 2019.

  3. D. Mitra, H. Zanddizari, and S. Rajan, “Improvement of signal quality during recovery of compressively sensed ECG signals,”
    2018 IEEE International Symposium on Medical Measurements and Applications (MeMeA), June 2018, pp. 1–5.

  4. D. Mitra, H. Zanddizari, and S. Rajan, “Improvement of recovery in segmentation-based parallel compressive sensing,”
    2018 IEEE International Symposium on Signal Processing and Information Technology (ISSPIT), Dec 2018, pp. 501–506.

Original Author (MATLAB): Hadi Zanddizari
Email: [email protected], [email protected]

The Main Objective of This Approach

For fast and efficient compression, the sensing phase in compressive sensing can be done in a very small size, because in this case:

  • It requires a very small measurement matrix,
  • Less number of multiplication and addition operations,
  • Less delay for generating compressed samples,

These characteristics are particularly useful for sensors with low computational resources. However, sensing in small sizes degrades the quality of recovery. The Kronecker technique can be used to improve the quality of the recovered signal.

CS Recovery Algorithm

Any recovery algorithm can be used. In this code, Sl0, which is a very fast CS recovery algorithm, is used.
SL0 Reference: http://ee.sharif.edu/~SLzero/

Database

In this code, an ECG signal from the MIT-BIH Arrhythmia Database, which is a public dataset, is used.
Database Reference: MIT-BIH Arrhythmia Database. Available: http://www.physionet.org/physiobank/database/mitdb/

Repo content

Branches:


master

  • Python implementation that partially correctly emulates the original MATLAB code
  • I never managed to build a dwt dictionary in the way MATLAB's wmpdictionary, note that in the future Mathworks plans to remove the obsolete wmpdictionary, it will be substituted by sensingDictionary

csv-logging-ipynb

  • Python code is all in a Jupyter Notebook
  • Both MATLAB and Python codes save all relevant variables in csv so that the two languages implementation can be compared.

hadizand-original-backup

Untouched copy of orginal folder


How to use

MATLAB content

You need to have MATLAB installed: matlabDir is a stand-alone-content directory, just set MATLAB working directory to the it.

  • Version: original code was written in 2008, I used it in 2024, no compatibility issues to this day.
  • Mathworks website info: wmpdictionary is obsolete, will be soon replaced by sensingDictionary
  • Toolboxes: 'Wavelet Toolbox' required

Python

It slightly depends on the following choice you make: you can either choose to use only the provided RECORD 100.mat from the repository or use other records from the MIT-BIH Arrhythmia Database.

Python version and modules

  • Today: 23 August 2024 (worked fine up to this date)

  • Version: obviously need to have python installed (version 3.5 or above, worked both with 3.8 and 3.12)

  • Run all commands from root directory of the project

  • You might want to install a python virtual environment, here shown with venv (but you're free to use conda or whatever you prefer)

# virtual environment
deactivate
python -m venv .kroneckerVenv
source .kroneckerVenv/bin/activate
  • Install this project package compSensPack and all it's requirements
# install compSensPack
pip install .

How to run:

Simply run scripts/main_run.py

# run from CLI
python scripts/main_run.py

If you want to use freely whole MIT-BIH Arrhythmia Database

  • There is a dedicated python module to use the MIT-BIH Arrhythmia Database
  • Beware: when I used this library in 2024 it didn't work with latest version of python (3.12), it did work fine using python3.8
# Python module to use MIT-BIH databases bind to Physionet.org
pip install wfdb
  • I didn't use it for my implementation, RECORD 100 already present in original repo was enough for the purpose of my study, so _the rest is up to you... (modify scripts/main_run.py to add it if you want)

About

ARCHIVED - Kronecker technique for improving quality of the signal in compressive sensing recovery. Transposing to Python, to the best of my ability, the work from https://github.com/hadizand/Kronecker-based-CS-recovery. (Originally in MATLAB)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 76.0%
  • MATLAB 23.8%
  • M 0.2%