mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-26 00:46:59 +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:
parent
0a295f9147
commit
05937e6995
@ -56,11 +56,9 @@ IbyteToComplex::IbyteToComplex(ConfigurationInterface* configuration, std::strin
|
|||||||
|
|
||||||
size_t item_size = sizeof(gr_complex);
|
size_t item_size = sizeof(gr_complex);
|
||||||
|
|
||||||
gr_interleaved_short_to_complex_ = gr::blocks::interleaved_short_to_complex::make();
|
gr_interleaved_char_to_complex_ = gr::blocks::interleaved_char_to_complex::make();
|
||||||
gr_char_to_short_ = gr::blocks::char_to_short::make();
|
|
||||||
|
|
||||||
DLOG(INFO) << "data_type_adapter_(" << gr_interleaved_short_to_complex_->unique_id() << ")";
|
DLOG(INFO) << "data_type_adapter_(" << gr_interleaved_char_to_complex_->unique_id() << ")";
|
||||||
DLOG(INFO) << "data_type_adapter_(" << gr_char_to_short_->unique_id() << ")";
|
|
||||||
|
|
||||||
if (dump_)
|
if (dump_)
|
||||||
{
|
{
|
||||||
@ -77,22 +75,18 @@ IbyteToComplex::~IbyteToComplex()
|
|||||||
|
|
||||||
void IbyteToComplex::connect(gr::top_block_sptr top_block)
|
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_)
|
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)
|
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_)
|
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()
|
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()
|
gr::basic_block_sptr IbyteToComplex::get_right_block()
|
||||||
{
|
{
|
||||||
return gr_interleaved_short_to_complex_;
|
return gr_interleaved_char_to_complex_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -32,10 +32,10 @@
|
|||||||
#define GNSS_SDR_IBYTE_TO_COMPLEX_H_
|
#define GNSS_SDR_IBYTE_TO_COMPLEX_H_
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <gnuradio/blocks/interleaved_short_to_complex.h>
|
#include <gnuradio/blocks/interleaved_char_to_complex.h>
|
||||||
#include <gnuradio/blocks/char_to_short.h>
|
|
||||||
#include <gnuradio/blocks/file_sink.h>
|
#include <gnuradio/blocks/file_sink.h>
|
||||||
#include <gnuradio/msg_queue.h>
|
#include <gnuradio/msg_queue.h>
|
||||||
|
#include "gnss_synchro.h"
|
||||||
#include "gnss_block_interface.h"
|
#include "gnss_block_interface.h"
|
||||||
|
|
||||||
|
|
||||||
@ -74,8 +74,7 @@ public:
|
|||||||
gr::basic_block_sptr get_right_block();
|
gr::basic_block_sptr get_right_block();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
gr::blocks::interleaved_short_to_complex::sptr gr_interleaved_short_to_complex_;
|
gr::blocks::interleaved_char_to_complex::sptr gr_interleaved_char_to_complex_;
|
||||||
gr::blocks::char_to_short::sptr gr_char_to_short_;
|
|
||||||
ConfigurationInterface* config_;
|
ConfigurationInterface* config_;
|
||||||
bool dump_;
|
bool dump_;
|
||||||
std::string dump_filename_;
|
std::string dump_filename_;
|
||||||
|
Loading…
Reference in New Issue
Block a user