From 3ad5113201df7624ae25da5c67b3de62aca8760d Mon Sep 17 00:00:00 2001 From: Michael Ossmann Date: Sat, 4 Feb 2017 10:43:33 -0700 Subject: [PATCH] Select only the best sections of the FFT output. Skip the lowest 1/8 of the band, the middle 1/4 of the band, and the highest 1/8 of the band. This provides full coverage of the selected frequency range because the hopping pattern was designed with this in mind. --- host/hackrf-tools/src/hackrf_sweep.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/host/hackrf-tools/src/hackrf_sweep.c b/host/hackrf-tools/src/hackrf_sweep.c index 06e4441b..910d6b84 100644 --- a/host/hackrf-tools/src/hackrf_sweep.c +++ b/host/hackrf-tools/src/hackrf_sweep.c @@ -244,11 +244,21 @@ int rx_callback(hackrf_transfer* transfer) { strftime(time_str, 50, "%Y-%m-%d, %H:%M:%S", fft_time); printf("%s, %" PRIu64 ", %" PRIu64 ", %.2f, %d", time_str, - (uint64_t)((FREQ_ONE_MHZ*frequency)-(DEFAULT_SAMPLE_RATE_HZ/2)), - (uint64_t)((FREQ_ONE_MHZ*frequency)+(DEFAULT_SAMPLE_RATE_HZ/2)), + (uint64_t)((FREQ_ONE_MHZ*frequency)-((DEFAULT_SAMPLE_RATE_HZ*3)/8)), + (uint64_t)((FREQ_ONE_MHZ*frequency)-(DEFAULT_SAMPLE_RATE_HZ/8)), (float)STEP_SIZE_IN_HZ, FFT_SIZE); - for(i=0; i < fftSize; i++) { + for(i=fftSize/8; (fftSize*3)/8 > i; i++) { + printf(", %.2f", pwr[i]); + } + printf("\n"); + printf("%s, %" PRIu64 ", %" PRIu64 ", %.2f, %d", + time_str, + (uint64_t)((FREQ_ONE_MHZ*frequency)+(DEFAULT_SAMPLE_RATE_HZ/8)), + (uint64_t)((FREQ_ONE_MHZ*frequency)+((DEFAULT_SAMPLE_RATE_HZ*3)/8)), + (float)STEP_SIZE_IN_HZ, + FFT_SIZE); + for(i=(fftSize*5)/8; (fftSize*7)/8 > i; i++) { printf(", %.2f", pwr[i]); } printf("\n");