1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-11-02 08:13:04 +00:00

Updated ibyte_to_complex with new gr block

Now uses gr_interleaved_char_to_complex instead of byte to short
followed by short to complex. This also changes the normalisation.
This commit is contained in:
Cillian O'Driscoll
2016-02-04 20:30:53 +00:00
parent c1d0550af6
commit 672e281361
2 changed files with 8 additions and 15 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,19 @@ 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 +95,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,8 +32,7 @@
#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"
@@ -75,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_;