3 * Copyright 2006 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 2, 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., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
23 #ifndef INCLUDED_GR_STREAMS_ENCODE_TURBO_H
24 #define INCLUDED_GR_STREAMS_ENCODE_TURBO_H
27 #include <gr_streams_encode_convolutional.h>
30 #include <libecc/encoder_turbo_ic1_ic1.h>
32 #include <libecc/encoder_turbo.h>
36 * \brief Encode the incoming stream(s) using a turbo encoder
38 * input: streams of char, one stream per input as defined by the
39 * instantiated code, using only the right-most justified bit as
40 * the single input bit per input item.
42 * output: streams of char, one stream per output as defined by the
43 * instantiated code, using only the right-most justified bit as
44 * the single output bit per output item.
47 * n_code_outputs: the total number of code inputs and outputs for the
48 * overall turbo encoder (not just the constituent codes).
50 * encoders: the constituent encoders to be used; all -should- be
51 * configured with the same "block_size" and "termination", though
52 * from this encoder's perspective it doesn't really matter.
54 * interleavers: the interleavers to use before each encoder,
55 * respectively, except the first encoder which will not use an
59 class gr_streams_encode_turbo;
61 typedef boost::shared_ptr<gr_streams_encode_turbo>
62 gr_streams_encode_turbo_sptr;
64 gr_streams_encode_turbo_sptr
65 gr_make_streams_encode_turbo
68 const std::vector<gr_streams_encode_convolutional_sptr> &encoders,
69 const std::vector<size_t> &interleavers);
71 class gr_streams_encode_turbo : public gr_block
73 friend gr_streams_encode_turbo_sptr
74 gr_make_streams_encode_turbo
77 const std::vector<gr_streams_encode_convolutional_sptr> &d_encoders,
78 const std::vector<size_t> &d_interleavers);
80 gr_streams_encode_turbo
83 const std::vector<gr_streams_encode_convolutional_sptr> &d_encoders,
84 const std::vector<size_t> &d_interleavers);
86 std::vector<gr_streams_encode_turbo_sptr> d_encoders;
87 std::vector<size_t> d_interleavers;
88 size_t d_n_encoders, d_block_size_bits;
89 bool d_do_termination;
90 encoder_turbo* d_encoder;
93 ~gr_streams_encode_turbo ();
95 virtual void forecast (int noutput_items,
96 gr_vector_int &ninput_items_required);
98 virtual int general_work (int noutput_items,
99 gr_vector_int &ninput_items,
100 gr_vector_const_void_star &input_items,
101 gr_vector_void_star &output_items);
104 #endif /* INCLUDED_GR_STREAMS_ENCODE_TURBO_H */