1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-06-18 11:09:56 +00:00

bug fix in interleaved byte to complex data type adapter (incorrect

scaled output when char to short int conversion was used, now replaced
the two-step process by single GNURadio block interleaver char to
complex)
This commit is contained in:
Javier Arribas 2016-01-11 12:26:45 +01:00
parent 0a295f9147
commit 05937e6995
2 changed files with 9 additions and 16 deletions

View File

@ -56,11 +56,9 @@ IbyteToComplex::IbyteToComplex(ConfigurationInterface* configuration, std::strin
size_t item_size = sizeof(gr_complex);
gr_interleaved_short_to_complex_ = gr::blocks::interleaved_short_to_complex::make();
gr_char_to_short_ = gr::blocks::char_to_short::make();
gr_interleaved_char_to_complex_ = gr::blocks::interleaved_char_to_complex::make();
DLOG(INFO) << "data_type_adapter_(" << gr_interleaved_short_to_complex_->unique_id() << ")";
DLOG(INFO) << "data_type_adapter_(" << gr_char_to_short_->unique_id() << ")";
DLOG(INFO) << "data_type_adapter_(" << gr_interleaved_char_to_complex_->unique_id() << ")";
if (dump_)
{
@ -77,22 +75,18 @@ IbyteToComplex::~IbyteToComplex()
void IbyteToComplex::connect(gr::top_block_sptr top_block)
{
top_block->connect(gr_char_to_short_, 0, gr_interleaved_short_to_complex_ , 0);
if (dump_)
{
top_block->connect(gr_interleaved_short_to_complex_, 0, file_sink_, 0);
top_block->connect(gr_interleaved_char_to_complex_, 0, file_sink_, 0);
}
}
void IbyteToComplex::disconnect(gr::top_block_sptr top_block)
{
top_block->disconnect(gr_char_to_short_, 0, gr_interleaved_short_to_complex_ , 0);
if (dump_)
{
top_block->disconnect(gr_interleaved_short_to_complex_, 0, file_sink_, 0);
top_block->disconnect(gr_interleaved_char_to_complex_, 0, file_sink_, 0);
}
}
@ -100,14 +94,14 @@ void IbyteToComplex::disconnect(gr::top_block_sptr top_block)
gr::basic_block_sptr IbyteToComplex::get_left_block()
{
return gr_char_to_short_;
return gr_interleaved_char_to_complex_;
}
gr::basic_block_sptr IbyteToComplex::get_right_block()
{
return gr_interleaved_short_to_complex_;
return gr_interleaved_char_to_complex_;
}

View File

@ -32,10 +32,10 @@
#define GNSS_SDR_IBYTE_TO_COMPLEX_H_
#include <string>
#include <gnuradio/blocks/interleaved_short_to_complex.h>
#include <gnuradio/blocks/char_to_short.h>
#include <gnuradio/blocks/interleaved_char_to_complex.h>
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/msg_queue.h>
#include "gnss_synchro.h"
#include "gnss_block_interface.h"
@ -74,8 +74,7 @@ public:
gr::basic_block_sptr get_right_block();
private:
gr::blocks::interleaved_short_to_complex::sptr gr_interleaved_short_to_complex_;
gr::blocks::char_to_short::sptr gr_char_to_short_;
gr::blocks::interleaved_char_to_complex::sptr gr_interleaved_char_to_complex_;
ConfigurationInterface* config_;
bool dump_;
std::string dump_filename_;