3 * Copyright 2008 Free Software Foundation, Inc.
5 * GNU Radio 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)
10 * GNU Radio 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.
15 * You should have received a copy of the GNU General Public License
16 * along with GNU Radio; see the file COPYING. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street,
18 * Boston, MA 02110-1301, USA.
25 #include <gr_probe_density_b.h>
26 #include <gr_io_signature.h>
30 gr_probe_density_b_sptr
31 gr_make_probe_density_b(double alpha)
33 return gr_probe_density_b_sptr(new gr_probe_density_b(alpha));
36 gr_probe_density_b::gr_probe_density_b(double alpha)
37 : gr_sync_block("density_b",
38 gr_make_io_signature(1, 1, sizeof(char)),
39 gr_make_io_signature(0, 0, 0))
45 gr_probe_density_b::~gr_probe_density_b()
50 gr_probe_density_b::work(int noutput_items,
51 gr_vector_const_void_star &input_items,
52 gr_vector_void_star &output_items)
54 const char *in = (const char *)input_items[0];
56 for (int i = 0; i < noutput_items; i++)
57 d_density = d_alpha*(double)in[i] + d_beta*d_density;
63 gr_probe_density_b::set_alpha(double alpha)