AdaptiveSmooth.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_AdaptiveSmooth_h
10#define __Pulsar_AdaptiveSmooth_h
11
12#include "Pulsar/Transformation.h"
13
14namespace Pulsar {
15
16 class Profile;
17
20 class AdaptiveSmooth : public Transformation<Profile> {
21
22 public:
23
26
28 virtual ~AdaptiveSmooth ();
29
31 float get_turns () const;
32
34 unsigned get_max_harm() const;
35
37 void set_hold (bool);
38
40 bool get_hold() const;
41
43 void transform(Profile *);
44
46 enum Method { Wiener, Sinc_MSE, Sinc_IC, VonMises };
47
49 void set_method(Method m);
50
51 protected:
52
54 std::vector<float> filter;
55
58
60 bool hold;
61
64
67
68 private:
69
71 void compute(const float *fprof, int nbin);
72
74 void compute_wiener(const float *pspec, double sigma2, int nh);
75
77 void compute_sinc_mse(const float *pspec, double sigma2, int nh);
78
80 void compute_sinc_ic(const float *pspec, double sigma2, int nh);
81
83 void compute_lpf(const float *pspec, double sigma2, int nh,
84 float (*filter_func)(float,float));
85
87 void compute_vonmises_lpf(const float *pspec, double sigma2, int nh);
88
89 };
90
91}
92
93#endif
Method
Different types of filter.
Definition AdaptiveSmooth.h:46
virtual ~AdaptiveSmooth()
Destructor.
Definition AdaptiveSmooth.C:29
AdaptiveSmooth()
Default constructor.
Definition AdaptiveSmooth.C:20
bool get_hold() const
Get hold state.
Definition AdaptiveSmooth.C:48
bool hold
Current hold state.
Definition AdaptiveSmooth.h:60
Method method
Which filter method to use.
Definition AdaptiveSmooth.h:66
float noise_band
Upper fraction of band to use for noise estimate.
Definition AdaptiveSmooth.h:63
void transform(Profile *)
Smooth given Profile.
Definition AdaptiveSmooth.C:54
int max_harm
Maximum nonzero harmonic.
Definition AdaptiveSmooth.h:57
unsigned get_max_harm() const
Get maximum nonzero harmonic.
Definition AdaptiveSmooth.C:41
void set_method(Method m)
Set filter method.
Definition AdaptiveSmooth.C:50
float get_turns() const
Get the characteristic width of the smoothing window in turns.
Definition AdaptiveSmooth.C:34
std::vector< float > filter
Current fourier-domain smoothing function.
Definition AdaptiveSmooth.h:54
void set_hold(bool)
Hold current filter to apply to more profiles.
Definition AdaptiveSmooth.C:46
Any quantity recorded as a function of pulse phase.
Definition Profile.h:40
Algorithms that modify data in the Container.
Definition Transformation.h:20
Defines the PSRCHIVE library.
Definition CalSource.h:17

Generated using doxygen 1.14.0