diff --git a/host/hackrf-tools/src/hackrf_sweep.c b/host/hackrf-tools/src/hackrf_sweep.c index 0a6331c5..59368521 100644 --- a/host/hackrf-tools/src/hackrf_sweep.c +++ b/host/hackrf-tools/src/hackrf_sweep.c @@ -184,8 +184,11 @@ int rx_callback(hackrf_transfer* transfer) { buf_short = buf_short + 8190; fftwf_execute(fftwPlan); for (i=0; i < fftSize; i++) { - pwr[i] = logPower(fftwOut[i], 1.0f / fftSize); - fprintf(stderr, "%f\n", pwr[i]); + // Start from the middle of the FFTW array and wrap + // 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"); }