3 #include "gsl/gsl_fft_real.h"
4 #include "gsl/gsl_fft_halfcomplex.h"
14 double max_four_coef = 0.0;
16 gsl_fft_real_wavetable *
real = gsl_fft_real_wavetable_alloc(M);
17 gsl_fft_real_workspace *work = gsl_fft_real_workspace_alloc(M);
18 double *LD =
new double[M];
20 for (
int i = 0; i < M; ++ i) {
23 gsl_fft_real_transform(LD, 1, M,
real, work);
25 gsl_fft_real_wavetable_free(
real);
27 for (
int i = 0; i < M; ++ i) {
28 if (
std::abs(LD[i]) > max_four_coef) {
34 for (
int i = 0; i < M; ++ i) {
35 if (
std::abs(LD[i]) < max_four_coef) {
40 gsl_fft_halfcomplex_wavetable *hc = gsl_fft_halfcomplex_wavetable_alloc(M);
42 gsl_fft_halfcomplex_inverse(LD, 1, M, hc, work);
44 gsl_fft_halfcomplex_wavetable_free(hc);
45 gsl_fft_real_workspace_free(work);
47 for (
int i = 0; i < M; ++ i) {
57 double max_four_coef = 0.0;
59 gsl_fft_real_wavetable *
real = gsl_fft_real_wavetable_alloc(M);
60 gsl_fft_real_workspace *work = gsl_fft_real_workspace_alloc(M);
61 double *LD =
new double[M];
63 for (
int i = 0; i < M; ++ i) {
66 gsl_fft_real_transform(LD, 1, M,
real, work);
68 gsl_fft_real_wavetable_free(
real);
70 for (
int i = 1; i < M; ++ i) {
71 if (
std::abs(LD[i]) > max_four_coef) {
78 for (
int i = 1; i < M; i += 2) {
80 if (
std::abs(LD[i+1]) > max_four_coef) {
82 LD[i] = -LD[i+1] * gff * (i + 1) / 2;
86 if (
std::abs(temp) > max_four_coef) {
87 LD[i+1] = temp * gff * (i + 1) / 2;
93 gsl_fft_halfcomplex_wavetable *hc = gsl_fft_halfcomplex_wavetable_alloc(M);
95 gsl_fft_halfcomplex_inverse(LD, 1, M, hc, work);
97 gsl_fft_halfcomplex_wavetable_free(hc);
98 gsl_fft_real_workspace_free(work);
100 for (
int i = 0; i < M; ++ i) {
FLieGenerator< T, N > real(const FLieGenerator< std::complex< T >, N > &)
Take real part of a complex generator.
PETE_TUTree< FnAbs, typename T::PETE_Expr_t > abs(const PETE_Expr< T > &l)
constexpr double pi
The value of.
RelativeFFTLowPassFilter(const double &threshold)
void calc_derivative(std::vector< double > &histogram, const double &h)
void apply(std::vector< double > &LineDensity)