This example shows how to use one of the interleaving classes.
using std::cout;
using std::endl;
int main()
{
int rows, cols;
ivec input, output, deinterleaved;
rows = 4;
cols = 5;
input = "1:20";
cout << "input = " << input << endl;
cout << "output = " << output << endl;
cout << "deinterleaved = " << deinterleaved << endl;
return 0;
}
Vec< T > deinterleave(const Vec< T > &input, short keepzeros=0)
Function for block deinterleaving. Removes additional zeros if keepzeros = 0.
Vec< T > interleave(const Vec< T > &input)
Function for block interleaving. May add some zeros.
void set_cols(int in_cols)
Set the number of columns for block interleaving.
void set_rows(int in_rows)
Set the number of rows for block interleaving.
Vec< int > ivec
Definition of integer vector type.
Include file for the IT++ communications module.
When you run this program, the output will look like this:
input = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20]
output = [1 5 9 13 17 2 6 10 14 18 3 7 11 15 19 4 8 12 16 20]
deinterleaved = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20]