|
| 1 | + |
| 2 | +# SigmaTransform-Python |
| 3 | +Implements the Sigma Transform in Python |
| 4 | + |
| 5 | +## Contents |
| 6 | +- [General Information](#general-information) |
| 7 | +- [Usage and Examples](#usage-and-examples) |
| 8 | + |
| 9 | +# General information |
| 10 | +This repository shows an exemplary implementation of the "SigmaTransform", as defined in the thesis _"Quantum Frames and Uncertainty Principles arising from Symplectomorphisms"_, written in Python. |
| 11 | + |
| 12 | +Note that this library is not intended to show maximal performance, but show the usability of the universal interface of the "Sigma Transform" to perform well-known signal processing transforms / algorithms like the Short-Time Fourier Transform and Wavelet Transform. |
| 13 | + |
| 14 | +Currently, only the one-dimensional SigmaTransform is implemented |
| 15 | + |
| 16 | +# Usage and Examples |
| 17 | +Clone this repository, or copy the file "sigmatransform.py" to a local folder. |
| 18 | +## Usage |
| 19 | +Perform a STFT on a signal "f" and save coefficients as numpy array |
| 20 | +```python |
| 21 | +import sigmatransform as st |
| 22 | +... |
| 23 | +# define diffeomorphism |
| 24 | +sig = lambda x : x; |
| 25 | +# get an instance |
| 26 | +STFT = st.SigmaTransform( |
| 27 | + sig , # the diffeomorphism handle |
| 28 | + win , # the window handle |
| 29 | + Fs , # the sampling Frequency |
| 30 | + chan # the channels in warped Fourier domain |
| 31 | +); |
| 32 | +# analyze the signal "f", given as numpy array ... |
| 33 | +STFT.analyze( f ); |
| 34 | +# ...and get coeffs, as numpy array |
| 35 | +coeff = STFT.coeff; |
| 36 | +``` |
| 37 | + |
| 38 | +Perform a Wavelet transform on a signal "f" and plot coefficients |
| 39 | +```python |
| 40 | +import sigmatransform as st |
| 41 | +... |
| 42 | +# define diffeomorphism |
| 43 | +sig = lambda x : np.log2(x*(x>0)); |
| 44 | +# get an instance |
| 45 | +Wavelet = st.SigmaTransform( |
| 46 | + sig , # the diffeomorphism handle |
| 47 | + win , # the window handle |
| 48 | + Fs , # the sampling Frequency |
| 49 | + chan # the channels in warped Fourier domain |
| 50 | +); |
| 51 | +# analyze the signal "f", given as numpy array ... |
| 52 | +Wavelet.analyze( f ); |
| 53 | +# ... and plot coeffs |
| 54 | +Wavelet.plotCoeff(); |
| 55 | +``` |
| 56 | + |
| 57 | +## Examples |
| 58 | +The python scripts |
| 59 | +``` |
| 60 | + Example1D_STFT.py |
| 61 | + Example1D_Wavelet.py |
| 62 | +``` |
| 63 | +provide more elaborated usage examples. |
0 commit comments