SigmaTransform
The SigmaTransform unifies various known signal processing transforms, like the STFT and the wavelet transform, differing only by a specific diffeomorphism.
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
SigmaTransform2D.cpp
Go to the documentation of this file.
1 
2 //#include <math.h>
3 
4 #include "SigmaTransform2D.h"
5 
6 namespace SigmaTransform {
7 
8  point<2> polar(const point<2> &p) {
9  //return std::move( point<2>({ log2( p.sq().sum()+1E-16 )/2.0, atan2( p[1] , p[0] ) }) );
10  return std::move( point<2>(std::array<double,2>{ log2( p.sq().sum()+1E-16 )/2.0, atan( p[1] / p[0] ) }) );
11  }
12 
13  point<2> shear(const point<2> &p) {
14  return std::move( point<2>(std::array<double,2>{ log2( abs(p[0]) + 1E-16 ), p[1] / p[0] }) );
15  }
16 
17  point<2> parabolicAction(const point<2> &l ,const point<2> &r ) {
18  return std::move( point<2>(std::array<double,2>{ l[0] - r[0] , exp( -r[0] / 2.0 * log(2) ) * ( l[1] - r[1] ) }) );
19  }
20 
22  diffFunc<2> sigma, winFunc<2> window, const point<2> &Fs, const point<2> &size, const std::vector<point<2>> &steps, actFunc<2> act )
23  : SigmaTransform<2>( sigma, window, Fs , size , steps , act ) { }
24 
26  diffFunc<2> sigma, const point<2> &width, const point<2> &Fs, const point<2> &size, const std::vector<point<2>> &steps, actFunc<2> act )
27  : SigmaTransform<2>( sigma, width, Fs , size , steps , act ) { }
28 
29 
30  STFT2D::STFT2D( winFunc<2> window, const point<2> &Fs, const point<2> &size, const std::vector<point<2>> &steps )
31  : SigmaTransform<2>( id<2>, window, Fs , size , steps ) { }
32 
33  STFT2D::STFT2D( const point<2> &width, const point<2> &Fs, const point<2> &size, const std::vector<point<2>> &steps )
34  : SigmaTransform<2>( id<2>, width, Fs , size , steps ) { }
35 
36 
37  WaveletTransform2D::WaveletTransform2D( winFunc<2> window, const point<2> &Fs, const point<2> &size, const std::vector<point<2>> &steps )
38  : SigmaTransform<2>( logabs<2>, window, Fs , size , steps ) { }
39 
40  WaveletTransform2D::WaveletTransform2D( const point<2> &width, const point<2> &Fs, const point<2> &size, const std::vector<point<2>> &steps )
41  : SigmaTransform<2>( logabs<2>, width, Fs , size , steps ) { }
42 
43 
44  SIM2D::SIM2D( winFunc<2> window, const point<2> &Fs, const point<2> &size, const std::vector<point<2>> &steps )
45  : SigmaTransform<2>( polar, window, Fs , size , steps ) { }
46 
47  SIM2D::SIM2D( const point<2> &width, const point<2> &Fs, const point<2> &size, const std::vector<point<2>> &steps )
48  : SigmaTransform<2>( polar, width, Fs , size , steps ) { }
49 
50 
51  Curvelet2D::Curvelet2D( winFunc<2> window, const point<2> &Fs, const point<2> &size, const std::vector<point<2>> &steps )
52  : SigmaTransform<2>( polar, window, Fs , size , steps , parabolicAction ) { }
53 
54  Curvelet2D::Curvelet2D( const point<2> &width, const point<2> &Fs, const point<2> &size, const std::vector<point<2>> &steps )
55  : SigmaTransform<2>( polar, width, Fs , size , steps , parabolicAction ) { }
56 
57 
58  NPShearlet2D::NPShearlet2D( winFunc<2> window, const point<2> &Fs, const point<2> &size, const std::vector<point<2>> &steps )
59  : SigmaTransform<2>( shear, window, Fs , size , steps ) { }
60 
61  NPShearlet2D::NPShearlet2D( const point<2> &width, const point<2> &Fs, const point<2> &size, const std::vector<point<2>> &steps )
62  : SigmaTransform<2>( shear, width, Fs , size , steps ) { }
63 
64 
65  Shearlet2D::Shearlet2D( winFunc<2> window, const point<2> &Fs, const point<2> &size, const std::vector<point<2>> &steps )
66  : SigmaTransform<2>( shear, window, Fs , size , steps , parabolicAction ) { }
67 
68  Shearlet2D::Shearlet2D( const point<2> &width, const point<2> &Fs, const point<2> &size, const std::vector<point<2>> &steps )
69  : SigmaTransform<2>( shear, width, Fs , size , steps , parabolicAction ) { }
70 
71 } // namespace SigmaTransform