GNU Radio's CDMA Package
amp_var_est.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2016 <+YOU OR YOUR COMPANY+>.
4 *
5 * This is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3, or (at your option)
8 * any later version.
9 *
10 * This software is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this software; see the file COPYING. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street,
18 * Boston, MA 02110-1301, USA.
19 */
20
21/* Authors: Vignesh Athreya, Yang Xiao, Yu Wang Winter 2016 */
22
23
24#ifndef INCLUDED_CDMA_AMP_VAR_EST_H
25#define INCLUDED_CDMA_AMP_VAR_EST_H
26
27#include <cdma/api.h>
28#include <gnuradio/sync_block.h>
29
30namespace gr {
31 namespace cdma {
32
33 /*!
34 * \brief Assumes as input a constant complex signal with complex noise s[i]=(A+j B) + (wr[i]+j wi[i])
35 Estimates the signal power on the real part A^2 and real noise variance sigma^2.
36 * \ingroup cdma
37 *
38 * \details
39 * First convert the input stream from complex type to real type, so r[i]=A + wr[i]. \n
40 * Then split the stream into two branches: \n
41 * 1) Pass the first branch through a single-pole IIR filter (averaging), square the result,
42 * and obtain an estimate of the signal power A^2. \n
43 * 2) Square the second branch, pass the result through a single-pole IIR filter,
44 * subtract the estimated signal power and obtain an estimate of the noise power sigma^2.\n
45 * \n
46 * For the IIR filter, the parameter alpha controls the averaging length. See equation below: \n
47 * y[i] = (1-alpha)*y[i-1] + alpha*x[i]. \n
48 * \n
49 */
50 class CDMA_API amp_var_est : virtual public gr::sync_block
51 {
52 public:
53 typedef boost::shared_ptr<amp_var_est> sptr;
54
55 /*!
56 * \brief Return a shared_ptr to a new instance of cdma::amp_var_est.
57 *
58 * To avoid accidental use of raw pointers, cdma::amp_var_est's
59 * constructor is in a private implementation
60 * class. cdma::amp_var_est::make is the public interface for
61 * creating new instances.
62 */
63//-------------------------CODE HERE------------------------------
64 static sptr make(float alpha);
65
66 virtual float alpha() const = 0;
67
68 virtual void set_alpha(float k) = 0;
69//----------------------------------------------------------------
70 };
71
72 } // namespace cdma
73} // namespace gr
74
75#endif /* INCLUDED_CDMA_AMP_VAR_EST_H */
#define CDMA_API
Definition: api.h:30
Assumes as input a constant complex signal with complex noise s[i]=(A+j B) + (wr[i]+j wi[i]) Estimate...
Definition: amp_var_est.h:51
virtual float alpha() const =0
static sptr make(float alpha)
Return a shared_ptr to a new instance of cdma::amp_var_est.
virtual void set_alpha(float k)=0
boost::shared_ptr< amp_var_est > sptr
Definition: amp_var_est.h:53
Definition: amp_var_est.h:30