1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-11-20 09:05:25 +00:00

Patch submitted by Marc Molina: Improving PCPS Acquisition with some VOLK instructions. Enabling the secondary spreading code in Galileo acquisition. Adding Signal Generator to GNSS-SDR.

git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@397 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
Luis Esteve
2013-07-23 18:03:07 +00:00
parent 5e6e66e60b
commit 8b10549fee
26 changed files with 1349 additions and 162 deletions

View File

@@ -74,7 +74,7 @@ if(RTLSDR_DRIVER)
set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${RTL_DRIVER_INCLUDE_DIRS})
endif(RTLSDR_DRIVER)
set(SIGNAL_SOURCE_ADAPTER_SOURCES file_signal_source.cc uhd_signal_source.cc ${OPT_DRIVER_SOURCES})
set(SIGNAL_SOURCE_ADAPTER_SOURCES file_signal_source.cc gen_signal_source.cc uhd_signal_source.cc ${OPT_DRIVER_SOURCES})
include_directories(

View File

@@ -0,0 +1,115 @@
/*!
* \file gen_signal_source.cc
* \brief It wraps blocks that generates synthesized GNSS signal and filters
* it.
* \author Marc Molina, 2013. marc.molina.pena@gmail.com
*
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2013 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
*
* This file is part of GNSS-SDR.
*
* GNSS-SDR 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 of the License, or
* at your option) any later version.
*
* GNSS-SDR 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 GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#include "gen_signal_source.h"
//#include "gnss_flowgraph.h"
#include <iostream>
#include <sstream>
#include <boost/lexical_cast.hpp>
#include <boost/thread/thread.hpp>
#include <gnuradio/io_signature.h>
#include <gnuradio/message.h>
#include <glog/log_severity.h>
#include <glog/logging.h>
using google::LogMessage;
// Constructor
GenSignalSource::GenSignalSource(ConfigurationInterface *configuration,
GNSSBlockInterface *signal_generator, GNSSBlockInterface *filter,
std::string role, boost::shared_ptr<gr::msg_queue> queue) :
signal_generator_(signal_generator),
filter_(filter),
role_(role),
queue_(queue)
{
connected_ = false;
}
// Destructor
GenSignalSource::~GenSignalSource()
{
delete signal_generator_;
delete filter_;
}
void GenSignalSource::connect(gr::top_block_sptr top_block)
{
if (connected_)
{
LOG_AT_LEVEL(WARNING) << "Signal conditioner already connected internally";
return;
}
signal_generator_->connect(top_block);
filter_->connect(top_block);
top_block->connect(signal_generator_->get_right_block(), 0,
filter_->get_left_block(), 0);
DLOG(INFO) << "signal_generator -> filter";
connected_ = true;
}
void GenSignalSource::disconnect(gr::top_block_sptr top_block)
{
if (!connected_)
{
LOG_AT_LEVEL(WARNING) << "Signal conditioner already disconnected internally";
return;
}
top_block->disconnect(signal_generator_->get_right_block(), 0,
filter_->get_left_block(), 0);
signal_generator_->disconnect(top_block);
filter_->disconnect(top_block);
connected_ = false;
}
gr::basic_block_sptr GenSignalSource::get_left_block()
{
return signal_generator_->get_left_block();
}
gr::basic_block_sptr GenSignalSource::get_right_block()
{
return filter_->get_right_block();
}

View File

@@ -0,0 +1,80 @@
/*!
* \file gen_signal_source.h
* \brief It wraps blocks that generates synthesized GNSS signal and filters
* it.
* \author Marc Molina, 2013. marc.molina.pena@gmail.com
*
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2013 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
*
* This file is part of GNSS-SDR.
*
* GNSS-SDR 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 of the License, or
* at your option) any later version.
*
* GNSS-SDR 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 GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#ifndef GNSS_SDR_GEN_SIGNAL_SOURCE_H_
#define GNSS_SDR_GEN_SIGNAL_SOURCE_H_
#include <gnuradio/msg_queue.h>
#include "gnss_block_interface.h"
class ConfigurationInterface;
/*!
* \brief This class wraps blocks that generates synthesized GNSS signal and
* filters the signal.
*/
class GenSignalSource: public GNSSBlockInterface
{
public:
//! Constructor
GenSignalSource(ConfigurationInterface *configuration,
GNSSBlockInterface *signal_generator, GNSSBlockInterface *filter,
std::string role, boost::shared_ptr<gr::msg_queue> queue);
//! Virtual destructor
virtual ~GenSignalSource();
void connect(gr::top_block_sptr top_block);
void disconnect(gr::top_block_sptr top_block);
gr::basic_block_sptr get_left_block();
gr::basic_block_sptr get_right_block();
std::string role(){ return role_; }
//! Returns "Signal Source"
std::string implementation(){ return "Signal Source"; }
size_t item_size(){ return 0; }
GNSSBlockInterface *signal_generator(){ return signal_generator_; }
GNSSBlockInterface *output_filter(){ return filter_; }
private:
GNSSBlockInterface *signal_generator_;
GNSSBlockInterface *filter_;
std::string role_;
std::string implementation_;
bool connected_;
boost::shared_ptr<gr::msg_queue> queue_;
};
#endif /*GNSS_SDR_GEN_SIGNAL_SOURCE_H*/