gtkIOStream  1.7.0
GTK+ << C++ IOStream operators for GTK+. Now with ORBing, numerical computation, audio client and more ...
ComplexFFTData.H
Go to the documentation of this file.
1 /* Copyright 2000-2018 Matt Flax <flatmax@flatmax.org>
2  This file is part of GTK+ IOStream class set
3 
4  GTK+ IOStream is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  GTK+ IOStream is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You have received a copy of the GNU General Public License
15  along with GTK+ IOStream
16 */
17 #ifndef COMPLEXFFTDATA_H_
18 #define COMPLEXFFTDATA_H_
19 
20 #include "fft/FFTCommon.H"
21 //#include "fft/ComplexFFT.H"
22 
25 public:
27  int size;
29  fftw_complex *in, *out;
33  double totalPower;
36 
38  ComplexFFTData(int sz);
40  ~ComplexFFTData(void);
41 
43  void switchData(ComplexFFTData *d);
44 
46  int limitHalfPowerSpec(double lim);
47 
49  int getSize(){return size;}
50  // int getHalfSize(){ if (!(size%2)) return size/2; else return size/2+1;}
51 
53  int compPowerSpec();
54  // int powerSpecDeriv(); // Find the derivative of the power spectrum
55 
57  int sqrtPowerSpec();
58 };
59 #endif // COMPLEXFFTDATADATA_H_
int sqrtPowerSpec()
This function computes the square root of the power spectrum and returns the max bin.
fftw_complex * out
int limitHalfPowerSpec(double lim)
Limits the maximum to &#39;lim&#39; and returns the last fft bin with max.
fftw_real * power_spectrum
the power_spectrum array
int compPowerSpec()
This function computes the power spectrum and returns the max bin.
fftw_complex * in
the input and output arrays
int getSize()
Returns the number of elements in the input and output arrays.
int size
Specifies the size of the data array.
void switchData(ComplexFFTData *d)
Use this to change associated fft data (for fft&#39;ing)
~ComplexFFTData(void)
Deconstructor.
ComplexFFTData(int sz)
Constructor with all memory to be allocated internally.
double totalPower
The total power (summed) of the power spectrum as used in the method compPowerSpec.
int minPowerBin
Specifies the minimum and maximum power bins as used in the methods findMaxMinPowerBins and compPower...
class ComplexFFTData controls and manipulates complex fft data
#define fftw_real
use double by default
Definition: FFTCommon.H:24
gtkIOStream: /tmp/gtkiostream/include/fft/ComplexFFTData.H Source File
GTK+ IOStream  Beta