Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* -*- c++ -*- */
- /*
- * Copyright 2014 <+YOU OR YOUR COMPANY+>.
- *
- * This is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this software; see the file COPYING. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street,
- * Boston, MA 02110-1301, USA.
- */
- #ifdef HAVE_CONFIG_H
- #include "config.h"
- #endif
- #include <gnuradio/io_signature.h>
- #include "al_enc_impl.h"
- #include <stdexcept>
- #include <iostream>
- #include <string.h>
- #include <cstdio>
- namespace gr {
- namespace alamouti {
- al_enc::sptr
- al_enc::make(int fft_length)
- {
- return gnuradio::get_initial_sptr
- (new al_enc_impl(fft_length));
- }
- /*
- * The private constructor
- */
- al_enc_impl::al_enc_impl(int fft_length)
- : gr::sync_block("al_enc",
- gr::io_signature::make(1, 1, sizeof(gr_complex)*fft_length),
- gr::io_signature::make(2, 2, sizeof(gr_complex)*fft_length)),d_fft_length(fft_length)
- {}
- /*
- * Our virtual destructor.
- */
- al_enc_impl::~al_enc_impl()
- {
- }
- int
- al_enc_impl::work(int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
- {
- const gr_complex *in = (const gr_complex *) input_items[0];
- gr_complex *out_sym0 = (gr_complex *) output_items[0];
- gr_complex *out_sym1 = (gr_complex *) output_items[1];
- // Do <+signal processing+>
- //SFBC
- int i = 0;
- while ( i < noutput_items ) {
- out_sym0[i] = in[i];
- out_sym0[i+1] = -(conj( in[i+1] ));
- out_sym1[i] = in[i+1];
- out_sym1[i+1] = conj( in[i] );
- i+=2;
- }
- return 1;
- }
- } /* namespace alamouti */
- } /* namespace gr */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement