WaveletSmooth.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2008 by Paul Demorest
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 #ifndef __Pulsar_WaveletSmooth_h
10 #define __Pulsar_WaveletSmooth_h
11 
12 #include "Pulsar/Transformation.h"
13 #include "Pulsar/WaveletTransform.h"
14 
15 namespace Pulsar {
16 
17  class Profile;
18 
21  class WaveletSmooth : public Transformation<Profile> {
22 
23  public:
24 
27 
29  ~WaveletSmooth ();
30 
32  unsigned get_ncoeff() const { return ncoeff; };
33 
35  void transform(Profile *);
36 
38  void set_wavelet(const gsl_wavelet_type *t, int order, bool decimate=true);
39 
41  void set_wavelet(std::string s);
42 
44  enum Threshold { Hard, Soft };
45 
47  void set_threshold(Threshold t) { thresh = t; };
48 
50  void set_cutoff(double cut) { cutoff_factor = cut; }
51 
52  protected:
53 
55  int ncoeff;
56 
59 
61  double cutoff;
62 
64  double cutoff_factor;
65 
67  double sigma;
68 
71 
72  private:
73 
75  double thresh_hard(double in);
76 
78  double thresh_soft(double in);
79 
80  };
81 
82 }
83 
84 #endif
void set_cutoff(double cut)
Adjust cutoff.
Definition: WaveletSmooth.h:55
double cutoff_factor
Cutoff multiplier, for fine-tuning.
Definition: WaveletSmooth.h:69
const float * get_amps() const
Return a pointer to the amplitudes array.
Definition: ProfileAmps.C:141
Threshold thresh
Threshold type.
Definition: WaveletSmooth.h:63
Any quantity recorded as a function of pulse phase.
Definition: Profile.h:45
unsigned get_ncoeff() const
Get number of wavelet coeffs kept.
Definition: WaveletSmooth.h:37
double cutoff
Threshold cutoff.
Definition: WaveletSmooth.h:66
unsigned get_nbin() const
Return the number of bins.
Definition: ProfileAmps.h:50
Threshold
Available threshold types.
Definition: WaveletSmooth.h:49
int ncoeff
Number of coeffs kept.
Definition: WaveletSmooth.h:60
void set_wavelet(const gsl_wavelet_type *t, int order, bool decimate=true)
Set wavelet type, order.
Definition: WaveletSmooth.C:32
void set_threshold(Threshold t)
Set threshold method.
Definition: WaveletSmooth.h:52
WaveletSmooth()
Default constructor.
Definition: WaveletSmooth.C:16
double sigma
Noise level in wavelet coeffs.
Definition: WaveletSmooth.h:72
WaveletTransform wt
The wavelet transform algorithm.
Definition: WaveletSmooth.h:75
Defines the PSRCHIVE library.
Definition: CalSource.h:17
void transform(Profile *)
Smooth given Profile.
Definition: WaveletSmooth.C:39
~WaveletSmooth()
Destructor.
Definition: WaveletSmooth.C:24
Performs 1-D discrete wavelet transforms (DWT)
Definition: WaveletTransform.h:29

Generated using doxygen 1.8.17