30 printf(
"power size=%d\n",
x*(c/2+1));
33 printf(
"Real2DFFTData: malloc 2 fail\n");
44 printf(
"Real2DFFTData: malloc 3 fail\n");
48 printf(
"Real2DFFTData: malloc 3a fail\n");
52 printf(
"Real2DFFTData: malloc 3b fail\n");
76 printf(
"Real2DFFTData: DeInit Out\n");
81 double factor=1.0/((double)
x*(
double)
y);
82 for (
int i=0;i<
x*(
y/2+1);i++){
91 int maxIndexX, maxIndexY;
92 int minIndexX, minIndexY;
93 for (
int i=0; i <
x; i++){
95 for (
int j=0;j<
y/2+1;j++){
101 maxPower=temp; maxIndexX=i; maxIndexY=j;
104 minPower=temp; minIndexX=i; minIndexY=j;
115 double max=-MAXDOUBLE;
116 for (
int i=0; i <
x; i++){
118 for (
int j=0;j<
y/2+1;j++)
119 if ((
power[index+j]=sqrt(
power[index+j]))>max){
121 max=(
power[maxPowerBin]);
131 int maxIndexX, maxIndexY;
132 int minIndexX, minIndexY;
137 for (
int i=0; i <
x; i++){
139 for (
int j=0;j<
y/2+1;j++){
141 temp=10.0*log10(temp);
147 maxPower=temp; maxIndexX=i; maxIndexY=j;
150 minPower=temp; minIndexX=i; minIndexY=j;
163 for (
int i=start; i < stop; i++){
165 for (
int j=0;j<
y/2+1;j++){
169 for (
int j=0;j<
y/2+1;j++){
178 for (
int j=0;j<
y/2+1;j++){
190 for (
int i=0; i <
x; i++){
192 for (
int j=0;j<
y;j++){
204 for (
int i=0; i <
x; i++){
206 for (
int j=0;j<
y/2+1;j++){
222 for (
int i=0; i <
x; i++){
224 for (
int j=0;j<
y/2+1;j++){
237 for (
int j=0;j<
y/2+1;j++){
252 memset(
out, 0,
x*(
y/2+1)*
sizeof(fftw_complex));
int maxXSumIndex
Row (x) and Column (y) max sum indexes.
fftw_complex * out
The output data.
int sqrtPowerSpec()
This function computes the square root of the power spectrum and returns the max bin.
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.
Real2DFFTData(int r, int c)
Constructor with all memory to be allocated internally.
fftw_real * timeXSum
A sum across the input time signal.
void clearInput(void)
Zeros the in array.
void compPowerSpec()
This function computes the power spectrum and updates the totalPower, maxPower and minPower...
double totalPower
The total power in the power spectrum, the maximum and minimum powers too.
#define c_re(c)
The real part of the complex number.
void findYSum(int start, int stop)
Finds the y-sum between columns start and stop.
#define c_im(c)
The imaginary part of the complex number.
fftw_real * mem
The total memory used by this class.
void reScale(void)
Scales the output down by the number of elements.
fftw_real * xSum
Arrays which sum across rows (x) and columns (y)
void timeSpecAverage()
Updates timeXSum.
fftw_real * in
The input data and power spectrum.
~Real2DFFTData()
Deconstructor.
void memDeInit(void)
Free the memory.
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
fftw_real * realXSum
Power spectral sums across rows (x) and columns (y)