gtkIOStream  1.7.0
GTK+ << C++ IOStream operators for GTK+. Now with ORBing, numerical computation, audio client and more ...
Real2DFFTData.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 REAL2DFFTDATA_H_
18 #define REAL2DFFTDATA_H_
19 
20 #include "fft/FFTCommon.H"
21 //#include "fft/Real2DFFT.H"
22 
26  int x, y;
30  void memDeInit(void);
31 public:
35  fftw_complex *out;
42 
49 
51  Real2DFFTData(int r, int c);
54 
56  int getXSize(){return x;}
58  int getYSize(){return y;}
60  int getXHalfSize(){ if (!(x%2)) return x/2; else return x/2+1;}
62  int getYHalfSize(){ if (!(y%2)) return y/2; else return y/2+1;}
63 
65  void reScale(void);
67  void compPowerSpec(); // Find the power spectrum
69  int sqrtPowerSpec();
71  void compLogPowerSpec(); // Find the log power spectrum
72 
74  void timeSpecAverage();
76  void complexSpecAverage();
79  void powerSpecAverage();
81  void findYSum(int start, int stop);
83  void findYMax(void);
84 
86  void clearInput(void);
88  void clearOutput(void);
89 };
90 #endif // REAL2DFFTDATA_H_
fftw_real * ySum
Definition: Real2DFFTData.H:37
int x
x=row y=column
Definition: Real2DFFTData.H:26
int maxXSumIndex
Row (x) and Column (y) max sum indexes.
Definition: Real2DFFTData.H:48
class Real2DFFTData controls and manipulates real 2D fft data
Definition: Real2DFFTData.H:24
fftw_complex * out
The output data.
Definition: Real2DFFTData.H:35
int sqrtPowerSpec()
This function computes the square root of the power spectrum and returns the max bin.
int getXHalfSize()
The half row count.
Definition: Real2DFFTData.H:60
void complexSpecAverage()
Updates realXSum and imagXSum.
void findYMax(void)
Finds the y-max for the ySum array, updates ySumMin, ySumMax, maxYSumIndex.
double xSumMin
The minimum/maximum row (x) and column (y) sums.
Definition: Real2DFFTData.H:46
int getYSize()
The column count.
Definition: Real2DFFTData.H:58
void powerSpecAverage()
Real2DFFTData(int r, int c)
Constructor with all memory to be allocated internally.
Definition: Real2DFFTData.C:24
int getYHalfSize()
The half column count.
Definition: Real2DFFTData.H:62
fftw_real * power
Definition: Real2DFFTData.H:33
fftw_real * timeXSum
A sum across the input time signal.
Definition: Real2DFFTData.H:39
void clearInput(void)
Zeros the in array.
void compPowerSpec()
This function computes the power spectrum and updates the totalPower, maxPower and minPower...
Definition: Real2DFFTData.C:88
double totalPower
The total power in the power spectrum, the maximum and minimum powers too.
Definition: Real2DFFTData.H:44
void findYSum(int start, int stop)
Finds the y-sum between columns start and stop.
fftw_real * mem
The total memory used by this class.
Definition: Real2DFFTData.H:28
void reScale(void)
Scales the output down by the number of elements.
Definition: Real2DFFTData.C:80
fftw_real * xSum
Arrays which sum across rows (x) and columns (y)
Definition: Real2DFFTData.H:37
void timeSpecAverage()
Updates timeXSum.
fftw_real * in
The input data and power spectrum.
Definition: Real2DFFTData.H:33
~Real2DFFTData()
Deconstructor.
Definition: Real2DFFTData.C:61
fftw_real * imagXSum
Definition: Real2DFFTData.H:41
int getXSize()
The row count.
Definition: Real2DFFTData.H:56
void memDeInit(void)
Free the memory.
Definition: Real2DFFTData.C:66
void compLogPowerSpec()
Finds 10*log10(power spectrum) and updates the totalPower, maxPower and minPower. ...
void clearOutput(void)
Zeros the out awway.
#define fftw_real
use double by default
Definition: FFTCommon.H:24
fftw_real * realXSum
Power spectral sums across rows (x) and columns (y)
Definition: Real2DFFTData.H:41
gtkIOStream: /tmp/gtkiostream/include/fft/Real2DFFTData.H Source File
GTK+ IOStream  Beta