Rearrange fftw output
This commit is contained in:
@ -184,8 +184,11 @@ int rx_callback(hackrf_transfer* transfer) {
|
|||||||
buf_short = buf_short + 8190;
|
buf_short = buf_short + 8190;
|
||||||
fftwf_execute(fftwPlan);
|
fftwf_execute(fftwPlan);
|
||||||
for (i=0; i < fftSize; i++) {
|
for (i=0; i < fftSize; i++) {
|
||||||
pwr[i] = logPower(fftwOut[i], 1.0f / fftSize);
|
// Start from the middle of the FFTW array and wrap
|
||||||
fprintf(stderr, "%f\n", pwr[i]);
|
// to rearrange the data
|
||||||
|
int k = i ^ (fftSize >> 1);
|
||||||
|
pwr[i] = logPower(fftwOut[k], 1.0f / fftSize);
|
||||||
|
fprintf(stderr, "%f\n", pwr[i]);
|
||||||
}
|
}
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user