8 : threshold_m(threshold) {}
11 const int M = LineDensity.size();
12 double max_four_coef = 0.0;
16 double* LD =
new double[M];
18 for (
int i = 0; i < M; ++i) {
19 LD[i] = LineDensity[i];
25 for (
int i = 0; i < M; ++i) {
26 if (std::abs(LD[i]) > max_four_coef) {
27 max_four_coef = std::abs(LD[i]);
32 for (
int i = 0; i < M; ++i) {
33 if (std::abs(LD[i]) < max_four_coef) {
45 for (
int i = 0; i < M; ++i) {
46 LineDensity[i] = LD[i];
53 const int M = LineDensity.size();
54 const double gff = 2. *
Physics::pi / (h * (M - 1));
55 double max_four_coef = 0.0;
59 double* LD =
new double[M];
61 for (
int i = 0; i < M; ++i) {
62 LD[i] = LineDensity[i];
68 for (
int i = 1; i < M; ++i) {
69 if (std::abs(LD[i]) > max_four_coef) {
70 max_four_coef = std::abs(LD[i]);
76 for (
int i = 1; i < M; i += 2) {
78 if (std::abs(LD[i + 1]) > max_four_coef) {
80 LD[i] = -LD[i + 1] * gff * (i + 1) / 2;
84 if (std::abs(temp) > max_four_coef) {
85 LD[i + 1] = temp * gff * (i + 1) / 2;
98 for (
int i = 0; i < M; ++i) {
99 LineDensity[i] = LD[i];
gsl_fft_halfcomplex_wavetable * gsl_fft_halfcomplex_wavetable_alloc(size_t n)
Allocate a halfcomplex FFT wavetable of size .
void gsl_fft_real_wavetable_free(gsl_fft_real_wavetable *w)
Free a real FFT wavetable.
gsl_fft_real_workspace * gsl_fft_real_workspace_alloc(size_t n)
Allocate a real FFT workspace of size .
void gsl_fft_halfcomplex_inverse(double *data, size_t stride, size_t n, gsl_fft_halfcomplex_wavetable *wavetable, gsl_fft_halfcomplex_workspace *workspace)
Alias for halfcomplex inverse transform.
void gsl_fft_real_workspace_free(gsl_fft_real_workspace *w)
Free a real FFT workspace.
void gsl_fft_real_transform(double *data, size_t stride, size_t n, gsl_fft_real_wavetable *, gsl_fft_real_workspace *)
Forward real FFT with GSL-compatible packed output.
gsl_fft_real_wavetable * gsl_fft_real_wavetable_alloc(size_t n)
Allocate a real FFT wavetable of size .
void gsl_fft_halfcomplex_wavetable_free(gsl_fft_halfcomplex_wavetable *w)
Free a halfcomplex FFT wavetable.
Halfcomplex FFT types for inverse transforms.
GSL-compatible interface for FFT routines.
Workspace for real FFT routines.
RelativeFFTLowPassFilter(const double &threshold)
void calc_derivative(std::vector< double > &histogram, const double &h)
void apply(std::vector< double > &LineDensity)
constexpr double pi
The value of.