Houston, we have a trunk.
[debian/gnuradio] / gnuradio-core / src / lib / general / gr_complex_to_xxx.h
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2004 Free Software Foundation, Inc.
4  * 
5  * This file is part of GNU Radio
6  * 
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 2, or (at your option)
10  * any later version.
11  * 
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.
16  * 
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., 59 Temple Place - Suite 330,
20  * Boston, MA 02111-1307, USA.
21  */
22
23 #ifndef INCLUDED_GR_COMPLEX_TO_XXX_H
24 #define INCLUDED_GR_COMPLEX_TO_XXX_H
25
26 #include <gr_sync_block.h>
27 #include <gr_complex.h>
28
29 class gr_complex_to_float;
30 class gr_complex_to_real;
31 class gr_complex_to_imag;
32 class gr_complex_to_mag;
33 class gr_complex_to_arg;
34
35 typedef boost::shared_ptr<gr_complex_to_float> gr_complex_to_float_sptr;
36 typedef boost::shared_ptr<gr_complex_to_real> gr_complex_to_real_sptr;
37 typedef boost::shared_ptr<gr_complex_to_imag> gr_complex_to_imag_sptr;
38 typedef boost::shared_ptr<gr_complex_to_mag> gr_complex_to_mag_sptr;
39 typedef boost::shared_ptr<gr_complex_to_arg> gr_complex_to_arg_sptr;
40
41 gr_complex_to_float_sptr gr_make_complex_to_float (unsigned int vlen=1);
42 gr_complex_to_real_sptr gr_make_complex_to_real (unsigned int vlen=1);
43 gr_complex_to_imag_sptr gr_make_complex_to_imag (unsigned int vlen=1);
44 gr_complex_to_mag_sptr gr_make_complex_to_mag (unsigned int vlen=1);
45 gr_complex_to_arg_sptr gr_make_complex_to_arg (unsigned int vlen=1);
46
47 /*!
48  * \brief convert a stream of gr_complex to 1 or 2 streams of float
49  * \ingroup converter
50  * \param vlen  vector len (default 1)
51  */
52 class gr_complex_to_float : public gr_sync_block
53 {
54   friend gr_complex_to_float_sptr gr_make_complex_to_float (unsigned int vlen);
55   gr_complex_to_float (unsigned int vlen);
56
57   unsigned int  d_vlen;
58
59  public:
60   virtual int work (int noutput_items,
61                     gr_vector_const_void_star &input_items,
62                     gr_vector_void_star &output_items);
63 };
64
65 /*!
66  * \brief complex in, real out (float)
67  * \ingroup converter
68  * \param vlen  vector len (default 1)
69  */
70 class gr_complex_to_real : public gr_sync_block
71 {
72   friend gr_complex_to_real_sptr gr_make_complex_to_real (unsigned int vlen);
73   gr_complex_to_real (unsigned int vlen);
74
75   unsigned int  d_vlen;
76
77  public:
78   virtual int work (int noutput_items,
79                     gr_vector_const_void_star &input_items,
80                     gr_vector_void_star &output_items);
81 };
82
83 /*!
84  * \brief complex in, imaginary out (float)
85  * \ingroup converter
86  * \param vlen  vector len (default 1)
87  */
88 class gr_complex_to_imag : public gr_sync_block
89 {
90   friend gr_complex_to_imag_sptr gr_make_complex_to_imag (unsigned int vlen);
91   gr_complex_to_imag (unsigned int vlen);
92
93   unsigned int  d_vlen;
94
95  public:
96   virtual int work (int noutput_items,
97                     gr_vector_const_void_star &input_items,
98                     gr_vector_void_star &output_items);
99 };
100
101 /*!
102  * \brief complex in, magnitude out (float)
103  * \ingroup converter
104  * \param vlen  vector len (default 1)
105  */
106 class gr_complex_to_mag : public gr_sync_block
107 {
108   friend gr_complex_to_mag_sptr gr_make_complex_to_mag (unsigned int vlen);
109   gr_complex_to_mag (unsigned int vlen);
110
111   unsigned int  d_vlen;
112
113  public:
114   virtual int work (int noutput_items,
115                     gr_vector_const_void_star &input_items,
116                     gr_vector_void_star &output_items);
117 };
118
119 /*!
120  * \brief complex in, angle out (float) 
121  * \ingroup converter
122  * \param vlen  vector len (default 1)
123  */
124 class gr_complex_to_arg : public gr_sync_block
125 {
126   friend gr_complex_to_arg_sptr gr_make_complex_to_arg (unsigned int vlen);
127   gr_complex_to_arg (unsigned int vlen);
128
129   unsigned int  d_vlen;
130
131  public:
132   virtual int work (int noutput_items,
133                     gr_vector_const_void_star &input_items,
134                     gr_vector_void_star &output_items);
135 };
136
137 #endif /* INCLUDED_GR_COMPLEX_TO_XXX_H */