Skip to content

Commit

Permalink
60 second moving average filter
Browse files Browse the repository at this point in the history
  • Loading branch information
marenz2569 committed May 19, 2024
1 parent 6c6a4ec commit 8ec975e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/r09-receiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,13 @@ auto receiver_main(const int frequency, const int offset, const int RF,
{"name", "R09 Receiver Average Signal Strength"}});

auto mag_squared = gr::blocks::complex_to_mag_squared::make();
// averaging filter over one second
unsigned tap_size = samp_rate / decimation;
// averaging filter over 60 second
unsigned tap_size = samp_rate / decimation * 60;
std::vector<float> averaging_filter(/*count=*/tap_size,
/*alloc=*/1.0 / tap_size);
// do not decimate directly to the final frequency, since there will be some
// jitter
unsigned decimation = tap_size / 10;
unsigned decimation = samp_rate / decimation / 10;
auto fir = gr::filter::fir_filter_fff::make(/*decimation=*/decimation,
averaging_filter);
auto populator = gr::prometheus::PrometheusGaugePopulator::make(
Expand Down

0 comments on commit 8ec975e

Please sign in to comment.