Skip to content

Commit

Permalink
Merge pull request #87 from sultanqasim/pano_improvements
Browse files Browse the repository at this point in the history
More panoramic spectrum improvements
  • Loading branch information
BatchDrake authored May 21, 2024
2 parents 0d779b8 + 8af3428 commit d21f18c
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions analyzer/workers/wide.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,26 @@ suscan_local_analyzer_hop(suscan_local_analyzer_t *self)
next = part_bw * self->part_ndx++
+ self->current_sweep_params.min_freq;
if (next > self->current_sweep_params.max_freq) {
next = self->current_sweep_params.min_freq;
self->part_ndx = 1;
if (self->curr_freq < self->current_sweep_params.max_freq - part_bw * 0.5) {
next = self->current_sweep_params.max_freq;
self->part_ndx = 0;
} else {
next = self->current_sweep_params.min_freq;
self->part_ndx = 1;
}
}
} else {
/* Continuous: advance monotonically in randomized steps */
SUFLOAT step_size = fs * self->current_sweep_params.rel_bw;
SUFLOAT freq_jiggle = SU_FLOOR(step_size * rnd * 0.2);
next = self->curr_freq + step_size - freq_jiggle;
if (next > self->current_sweep_params.max_freq) {
next = self->current_sweep_params.min_freq + step_size * 0.5
- freq_jiggle;
if (self->curr_freq < self->current_sweep_params.max_freq - step_size * 0.5) {
next = self->current_sweep_params.max_freq - freq_jiggle;
} else {
next = self->current_sweep_params.min_freq + step_size * 0.5
- freq_jiggle;
}
} else if (next < self->current_sweep_params.min_freq) {
/* can happen on first run when self->curr_freq may be invalid */
next = self->current_sweep_params.min_freq;
Expand Down Expand Up @@ -293,9 +302,7 @@ suscan_local_analyzer_init_wide_worker(suscan_local_analyzer_t *self)
SU_TRY(suscan_local_analyzer_readjust_detector(self, &det_params));
}

SU_TRY(
self->parent->params.max_freq - self->parent->params.min_freq >=
self->source_info.source_samp_rate);
SU_TRY(self->parent->params.max_freq >= self->parent->params.min_freq);

self->current_sweep_params.fft_min_samples =
SUSCAN_ANALYZER_MIN_POST_HOP_FFTS * det_params.window_size;
Expand Down

0 comments on commit d21f18c

Please sign in to comment.