SigmaTransform
The SigmaTransform unifies various known signal processing transforms, like the STFT and the wavelet transform, differing only by a specific diffeomorphism.
|
#include <SigmaTransform2D.h>
Public Member Functions | |
NPShearlet2D (winFunc< 2 > window=NULL, const point< 2 > &Fs=point< 2 >(0), const point< 2 > &size=point< 2 >(0), const std::vector< point< 2 >> &steps=std::vector< point< 2 >>(0)) | |
NPShearlet2D (const point< 2 > &width, const point< 2 > &Fs=point< 2 >(0), const point< 2 > &size=point< 2 >(0), const std::vector< point< 2 >> &steps=std::vector< point< 2 >>(0)) | |
SigmaTransform & | setWindow (winFunc< N > window) |
SigmaTransform & | setSigma (diffFunc< N > sigma) |
SigmaTransform & | setAction (actFunc< N > action) |
SigmaTransform & | setFs (const point< N > &Fs) |
SigmaTransform & | setSize (const point< N > &size) |
SigmaTransform & | setWinWidth (const double &winWidth) |
SigmaTransform & | setNumThreads (const int &numThreads) |
SigmaTransform & | setSteps (const std::vector< point< N >> &steps) |
cxVec & | getCoeffs () |
cxVec & | getWindows () |
cxVec & | getReconstruction () |
SigmaTransform & | operator() (cxVec const &sig) |
SigmaTransform & | analyze (cxVec const &sig, std::function< void(SigmaTransform *)> onFinish=NULL) |
SigmaTransform & | synthesize (std::function< void(SigmaTransform *obj)> onFinish=NULL) |
cxVec & | multiplier (cxVec const &sig, cxVec const &mask, std::function< void(SigmaTransform *)> onFinish=NULL) |
cxVec & | multiplier (cxVec const &sig, mskFunc< N > maskFunc, std::function< void(SigmaTransform *)> onFinish=NULL) |
SigmaTransform & | applyMask (const cxVec &mask) |
SigmaTransform & | applyMask (mskFunc< N > maskFunc) |
void | makeWindows () |
SigmaTransform & | asyncTransform (cxVec const &sig, std::function< void(SigmaTransform *)> onFinish) |
SigmaTransform & | asyncInverseTransform (std::function< void(SigmaTransform *)> onFinish) |
SigmaTransform & | asyncMultiplier (cxVec const &sig, cxVec const &mask, std::function< void(SigmaTransform *)> onFinish) |
SigmaTransform & | asyncMultiplier (cxVec const &sig, mskFunc< N > maskFunc, std::function< void(SigmaTransform *)> onFinish) |
SigmaTransform & | join () |
cxVec | fft (cxVec const &in, int const &howmany=1) |
void | fft_inplace (cxVec &inout, int const &howmany=1) |
cxVec | ifft (cxVec const &in, int const &howmany=1) |
void | ifft_inplace (cxVec &inout, int const &howmany=1) |
Protected Member Functions | |
void | makeWarpedDomain () |
std::vector< point< N > > | makeSpatialDomain () |
void | makeWarpedGaussian () |
SigmaTransform & | applyTransform (const cxVec &in) |
SigmaTransform & | applyInverseTransform () |
void | fftN (fftw_complex *out, fftw_complex *in, const point< N > &size, const int &howmany=1, const int &DIR=FFTW_FORWARD) |
Protected Attributes | |
std::function< cmpx(point< N > const &)> | m_window |
std::function< point< N >point < N >const &)> | m_sigma |
std::function< point< N >point < N >const &, point< N >const &)> | m_action |
cxVec | m_windows |
cxVec | m_coeff |
cxVec | m_reconstructed |
point< N > | m_size |
point< N > | m_fs |
std::vector< point< N > > | m_steps |
std::vector< point< N > > | m_domain |
int | m_numThreads |
point< N > | m_winWidth |
std::map< std::string, std::thread > | m_threads |
std::mutex | m_mtx |
Class NPShearlet2D is a two-dimensional Shearlet-instantation of SigmaTransform<N>, by setting the spectral diffeomorphism's handle to the 2D Shearing diffeomorphism. Since no more templates are involved, it can be used in a precompiled form.
See the documentation of SigmaTransform<N> for more information.
Definition at line 154 of file SigmaTransform2D.h.
SigmaTransform::NPShearlet2D::NPShearlet2D | ( | winFunc< 2 > | window = NULL , |
const point< 2 > & | Fs = point<2>(0) , |
||
const point< 2 > & | size = point<2>(0) , |
||
const std::vector< point< 2 >> & | steps = std::vector<point<2>>(0) |
||
) |
Definition at line 58 of file SigmaTransform2D.cpp.
SigmaTransform::NPShearlet2D::NPShearlet2D | ( | const point< 2 > & | width, |
const point< 2 > & | Fs = point<2>(0) , |
||
const point< 2 > & | size = point<2>(0) , |
||
const std::vector< point< 2 >> & | steps = std::vector<point<2>>(0) |
||
) |
Definition at line 61 of file SigmaTransform2D.cpp.
|
inlineinherited |
Analyze a signal.
sig | the signal as a complex vector |
onFinish | a callback-function to be called, when the work is done; defaults to NULL NOTE: if NOT NULL: the transform is executed asynchronously in a separate thread and the function returns immediately if NULL: the transfom is executed synchronously and blocks till finish |
std::runtime_error |
Definition at line 212 of file SigmaTransformN.h.
|
inlineprotectedinherited |
Applies the actual inverse transform in a multi-threaded manner.
Definition at line 652 of file SigmaTransformN.h.
|
inlineinherited |
Multiplies the coefficients with a mask.
mask | the mask as a complex vector (of the same size as the coefficient-vector) |
std::runtime_error |
Definition at line 276 of file SigmaTransformN.h.
|
inlineinherited |
Multiplies the coefficients with a mask, using a given masking function.
maskFunc | complex function handle, taking spatial and warped Fourier domain parameters |
Definition at line 310 of file SigmaTransformN.h.
|
inlineprotectedinherited |
Applies the actual transform in a multi-threaded manner.
in | the signal as a complex vector |
Definition at line 615 of file SigmaTransformN.h.
|
inlineinherited |
Performs the synthesis/inverse transform asynchronously.
onFinish | a callback-function to be called, when the work is done |
Definition at line 400 of file SigmaTransformN.h.
|
inlineinherited |
Performs the multiplier asynchronously.
sig | signal as a complex vector |
mask | complex mask vector of the same size as the coefficient-vector |
onFinish | a callback-function to be called, when the work is done |
Definition at line 422 of file SigmaTransformN.h.
|
inlineinherited |
Performs the multiplier asynchronously.
sig | signal as a complex vector |
maskFunc | a function handle for the masking function |
onFinish | a callback-function to be called, when the work is done |
Definition at line 444 of file SigmaTransformN.h.
|
inlineinherited |
Performs the analysis/transform asynchronously.
sig | signal as a complex vector |
onFinish | a callback-function to be called, when the work is done |
Definition at line 380 of file SigmaTransformN.h.
|
inlineinherited |
Forward fft - wrapper for fftN.
in | complex input vector |
howmany | number of signals of size "size", found in the input vector |
Definition at line 492 of file SigmaTransformN.h.
|
inlineinherited |
Forward fft for inplace transform - wrapper for fftN.
inout | complex input and output vector |
howmany | number of signals of size "size", found in the input vector |
Definition at line 510 of file SigmaTransformN.h.
|
inlineprotectedinherited |
Wrapper for the N-dimensional Fast Fourier Transform from the FFTW Lib.
out | pointer to buffer, where the complex and transformed data is to be placed |
in | pointer to buffer, where the complex data is stored |
size | size of the signal to be transformed |
howmany | number of signals of size "size", found in the buffer "in" |
DIR | direction of the transform |
Definition at line 685 of file SigmaTransformN.h.
|
inlineinherited |
Getter method for the transform-coefficients.
Definition at line 178 of file SigmaTransformN.h.
|
inlineinherited |
Getter method for the reconstruction
Definition at line 190 of file SigmaTransformN.h.
|
inlineinherited |
Getter method for the spectrum of the windows
Definition at line 184 of file SigmaTransformN.h.
|
inlineinherited |
Inverse fft - wrapper for fftN.
in | complex input vector |
howmany | number of signals of size "size", found in the input vector |
Definition at line 524 of file SigmaTransformN.h.
|
inlineinherited |
Inverse fft for inplace transform - wrapper for fftN.
inout | complex input and output vector |
howmany | number of signals of size "size", found in the input vector |
Definition at line 542 of file SigmaTransformN.h.
|
inlineinherited |
Waits for the asynchronous-threads to join and finally deltes them.
Definition at line 462 of file SigmaTransformN.h.
|
inlineprotectedinherited |
Generates a Spatial domain, from the size and the sampling frequency
Definition at line 571 of file SigmaTransformN.h.
|
inlineprotectedinherited |
Generates a warped Fourier domain, from the spectral diffeomorphism and the sampling frequency.
Definition at line 555 of file SigmaTransformN.h.
|
inlineprotectedinherited |
Generates a warped Gaussian window of adequate size.
Definition at line 585 of file SigmaTransformN.h.
|
inlineinherited |
Creates a set of "m_steps.size()" windows in the Fourier domain.
Definition at line 343 of file SigmaTransformN.h.
|
inlineinherited |
Use transform as a multiplier; analyze, apply a mask and synthesize.
sig | the signal as a complex vector |
mask | the mask as a complex vector (of the same size as the coefficient-vector) |
onFinish | a callback-function to be called, when the work is done; defaults to NULL NOTE: if NOT NULL: the multiplier is executed asynchronously in a separate thread and the function returns immediately if NULL: the multiplier is executed synchronously and blocks till finish |
Definition at line 249 of file SigmaTransformN.h.
|
inlineinherited |
Use transform as a multiplier; analyze, apply a mask and synthesize.
sig | the signal as a complex vector |
maskFunc | complex function handle, taking spatial and warped Fourier domain parameters |
onFinish | a callback-function to be called, when the work is done; defaults to NULL NOTE: if NOT NULL: the multiplier is executed asynchronously in a separate thread and the function returns immediately if NULL: the multiplier is executed synchronously and blocks till finish |
Definition at line 264 of file SigmaTransformN.h.
|
inlineinherited |
Functor operator, wrapping "analyze".
sig | the signal as a complex vector |
Definition at line 198 of file SigmaTransformN.h.
|
inlineinherited |
Setter method for the action function handle.
action | a function handle for the "group action" performed in the warped Fourier domain, defaults to "subtraction" |
Definition at line 94 of file SigmaTransformN.h.
|
inlineinherited |
Setter method for the sampling frequency
Fs | the sampling frequency in N dimensions |
Definition at line 102 of file SigmaTransformN.h.
|
inlineinherited |
Setter method for the number of threads
numThreads | the number of threads used for parallel processing (multiplications, additions as well as for FFTW), defaults to 4 |
Definition at line 126 of file SigmaTransformN.h.
|
inlineinherited |
Setter method for the spectral diffeomorphism function handle.
sigma | a function handle for the spectral diffeomorphism, NULL for identity (STFT in N dimensions) |
Definition at line 86 of file SigmaTransformN.h.
|
inlineinherited |
Setter method for the signal size
size | the size of the signals that are to be transformed in N dimensions |
Definition at line 110 of file SigmaTransformN.h.
|
inlineinherited |
Setter method for the channels used in the warped Fourier domain
steps | vector containing the channels in the warped Fourier domain in N dimensions |
std::runtime_error |
Definition at line 137 of file SigmaTransformN.h.
|
inlineinherited |
Setter method for the window function handle.
window | a function handle for the window function, NULL for warped Gaussian |
Definition at line 78 of file SigmaTransformN.h.
|
inlineinherited |
Setter method for the window width
winWidth | the width of a warped Gaussian in N dimensions |
Definition at line 118 of file SigmaTransformN.h.
|
inlineinherited |
synthesize from the coefficients, using the (complex conjugated) spectrum of the generated windows.
onFinish | a callback-function to be called, when the work is done; defaults to NULL NOTE: if NOT NULL: the inverse transform is executed asynchronously in a separate thread and the function returns immediately if NULL: the inverse transfom is executed synchronously and blocks till finish |
Definition at line 234 of file SigmaTransformN.h.
|
protectedinherited |
Definition at line 699 of file SigmaTransformN.h.
|
protectedinherited |
Definition at line 703 of file SigmaTransformN.h.
|
protectedinherited |
Definition at line 710 of file SigmaTransformN.h.
|
protectedinherited |
Definition at line 708 of file SigmaTransformN.h.
|
protectedinherited |
Definition at line 716 of file SigmaTransformN.h.
|
protectedinherited |
Definition at line 711 of file SigmaTransformN.h.
|
protectedinherited |
Definition at line 704 of file SigmaTransformN.h.
|
protectedinherited |
Definition at line 698 of file SigmaTransformN.h.
|
protectedinherited |
Definition at line 707 of file SigmaTransformN.h.
|
protectedinherited |
Definition at line 709 of file SigmaTransformN.h.
|
protectedinherited |
Definition at line 715 of file SigmaTransformN.h.
|
protectedinherited |
Definition at line 697 of file SigmaTransformN.h.
|
protectedinherited |
Definition at line 702 of file SigmaTransformN.h.
|
protectedinherited |
Definition at line 712 of file SigmaTransformN.h.