3 * Copyright 2008 Free Software Foundation, Inc.
5 * This file is part of GNU Radio
7 * GNU Radio is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3, or (at your option)
12 * GNU Radio is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with GNU Radio; see the file COPYING. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street,
20 * Boston, MA 02110-1301, USA.
22 #ifndef INCLUDED_GR_PROBE_MPSK_SNR_C_H
23 #define INCLUDED_GR_PROBE_MPSK_SNR_C_H
25 #include <gr_sync_block.h>
27 class gr_probe_mpsk_snr_c;
28 typedef boost::shared_ptr<gr_probe_mpsk_snr_c> gr_probe_mpsk_snr_c_sptr;
30 gr_probe_mpsk_snr_c_sptr
31 gr_make_probe_mpsk_snr_c(double alpha = 0.0001);
34 * Compute the estimate SNR of an MPSK signal using the Squared Signal
35 * to Noise Variance (SNV) technique.
37 * This technique assumes an AWGN channel.
39 * \param alpha Mean and variance smoothing filter constant
42 * Compute the running average of the signal mean and noise variance.
43 * The estimated signal mean, noise variance, and SNR are available
46 * This SNR estimator is inaccurate below about 7dB SNR.
49 class gr_probe_mpsk_snr_c : public gr_sync_block
54 double d_noise_variance;
56 // Factory function returning shared pointer of this class
57 friend gr_probe_mpsk_snr_c_sptr
58 gr_make_probe_mpsk_snr_c(double alpha);
60 // Private constructor
61 gr_probe_mpsk_snr_c(double alpha);
64 ~gr_probe_mpsk_snr_c();
66 int work (int noutput_items,
67 gr_vector_const_void_star &input_items,
68 gr_vector_void_star &output_items);
70 // Return the estimated signal mean
71 double signal_mean() const { return d_signal_mean; }
73 // Return the estimated noise variance
74 double noise_variance() const { return d_noise_variance; }
76 // Return the estimated signal-to-noise ratio in decibels
79 void set_alpha(double alpha);
82 #endif /* INCLUDED_GR_PROBE_MPSK_SNR_C_H */