mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-12-15 20:50:33 +00:00
Merging fpga with next
This commit is contained in:
commit
7c406bb6eb
97
.clang-format
Normal file
97
.clang-format
Normal file
@ -0,0 +1,97 @@
|
||||
---
|
||||
Language: Cpp
|
||||
# BasedOnStyle: Google
|
||||
# More info: http://clang.llvm.org/docs/ClangFormatStyleOptions.html
|
||||
AccessModifierOffset: -4
|
||||
AlignAfterOpenBracket: DontAlign
|
||||
AlignConsecutiveAssignments: false
|
||||
AlignConsecutiveDeclarations: false
|
||||
AlignEscapedNewlinesLeft: true
|
||||
AlignOperands: true
|
||||
AlignTrailingComments: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: true
|
||||
AllowShortBlocksOnASingleLine: false
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: All
|
||||
AllowShortIfStatementsOnASingleLine: true
|
||||
AllowShortLoopsOnASingleLine: true
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: true
|
||||
AlwaysBreakTemplateDeclarations: false
|
||||
BinPackArguments: true
|
||||
BinPackParameters: true
|
||||
BraceWrapping:
|
||||
AfterClass: false
|
||||
AfterControlStatement: false
|
||||
AfterEnum: false
|
||||
AfterFunction: false
|
||||
AfterNamespace: false
|
||||
AfterObjCDeclaration: false
|
||||
AfterStruct: false
|
||||
AfterUnion: false
|
||||
BeforeCatch: false
|
||||
BeforeElse: false
|
||||
IndentBraces: false
|
||||
BreakBeforeBinaryOperators: None
|
||||
BreakBeforeBraces: GNU
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializersBeforeComma: false
|
||||
BreakAfterJavaFieldAnnotations: false
|
||||
BreakStringLiterals: true
|
||||
ColumnLimit: 0
|
||||
CommentPragmas: '^ IWYU pragma:'
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
ContinuationIndentWidth: 4
|
||||
Cpp11BracedListStyle: true
|
||||
DerivePointerAlignment: true
|
||||
DisableFormat: false
|
||||
ExperimentalAutoDetectBinPacking: false
|
||||
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
|
||||
IncludeCategories:
|
||||
- Regex: '^<.*\.h>'
|
||||
Priority: 1
|
||||
- Regex: '^<.*'
|
||||
Priority: 2
|
||||
- Regex: '.*'
|
||||
Priority: 3
|
||||
IncludeIsMainRegex: '([-_](test|unittest))?$'
|
||||
IndentCaseLabels: false
|
||||
IndentWidth: 4
|
||||
IndentWrappedFunctionNames: false
|
||||
JavaScriptQuotes: Leave
|
||||
JavaScriptWrapImports: true
|
||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||
MacroBlockBegin: ''
|
||||
MacroBlockEnd: ''
|
||||
MaxEmptyLinesToKeep: 2
|
||||
NamespaceIndentation: None
|
||||
ObjCBlockIndentWidth: 2
|
||||
ObjCSpaceAfterProperty: false
|
||||
ObjCSpaceBeforeProtocolList: false
|
||||
PenaltyBreakBeforeFirstCallParameter: 1
|
||||
PenaltyBreakComment: 300
|
||||
PenaltyBreakFirstLessLess: 120
|
||||
PenaltyBreakString: 1000
|
||||
PenaltyExcessCharacter: 1000000
|
||||
PenaltyReturnTypeOnItsOwnLine: 200
|
||||
PointerAlignment: Left
|
||||
ReflowComments: true
|
||||
SortIncludes: false
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceAfterTemplateKeyword: true
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesBeforeTrailingComments: 2
|
||||
SpacesInAngles: false
|
||||
SpacesInContainerLiterals: true
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
Standard: Auto
|
||||
TabWidth: 8
|
||||
UseTab: Never
|
||||
...
|
||||
|
@ -128,6 +128,8 @@ $ git pull --rebase upstream next
|
||||
|
||||
### How to submit a pull request
|
||||
|
||||
Before submitting you code, please be sure to [apply clang-format](http://gnss-sdr.org/coding-style/#use-tools-for-automated-code-formatting).
|
||||
|
||||
When the contribution is ready, you can [submit a pull
|
||||
request](https://github.com/gnss-sdr/gnss-sdr/compare/). Head to your
|
||||
GitHub repository, switch to your `my_feature` branch, and click the
|
||||
|
@ -84,7 +84,7 @@ $ sudo yum install make automake gcc gcc-c++ kernel-devel cmake git boost-devel
|
||||
boost-date-time boost-system boost-filesystem boost-thread boost-chrono \
|
||||
boost-serialization log4cpp-devel gnuradio-devel gr-osmosdr-devel \
|
||||
blas-devel lapack-devel matio-devel armadillo-devel gflags-devel \
|
||||
glog-devel gnutls-devel openssl-devel python-mako python-six
|
||||
glog-devel openssl-devel python-mako python-six
|
||||
~~~~~~
|
||||
|
||||
Once you have installed these packages, you can jump directly to [download the source code and build GNSS-SDR](#download-and-build-linux).
|
||||
@ -101,7 +101,7 @@ $ sudo yum install make automake gcc gcc-c++ kernel-devel libtool \
|
||||
hdf5-devel cmake git boost-devel boost-date-time boost-system \
|
||||
boost-filesystem boost-thread boost-chrono boost-serialization \
|
||||
log4cpp-devel gnuradio-devel gr-osmosdr-devel blas-devel lapack-devel \
|
||||
armadillo-devel gnutls-devel openssl-devel python-mako python-six
|
||||
armadillo-devel openssl-devel python-mako python-six
|
||||
~~~~~~
|
||||
|
||||
Once you have installed these packages, you can jump directly to [download the source code and build GNSS-SDR](#download-and-build-linux).
|
||||
@ -244,11 +244,11 @@ changing `/home/username/googletest-release-1.8.0/googletest` by the actual dire
|
||||
|
||||
|
||||
|
||||
#### Install the [GnuTLS library](http://www.gnutls.org/ "GnuTLS's Homepage"):
|
||||
#### Install the [GnuTLS](http://www.gnutls.org/ "GnuTLS's Homepage") or [OpenSSL](https://www.openssl.org/ "OpenSSL's Homepage") libraries:
|
||||
|
||||
~~~~~~
|
||||
$ sudo apt-get install libgnutls-openssl-dev # For Debian/Ubuntu/LinuxMint
|
||||
$ sudo yum install libgnutls-openssl-devel # For Fedora/CentOS/RHEL
|
||||
$ sudo yum install openssl-devel # For Fedora/CentOS/RHEL
|
||||
~~~~~~
|
||||
|
||||
In case the GnuTLS library with openssl extensions package is not available in your GNU/Linux distribution, GNSS-SDR can also work well with OpenSSL.
|
||||
|
@ -5,7 +5,8 @@ Before submitting your pull request, please make sure the following is done:
|
||||
2. If you are a first-time contributor, after your pull request you will be asked to sign an Individual Contributor License Agreement ([CLA](https://en.wikipedia.org/wiki/Contributor_License_Agreement)) before your code gets accepted into `master`. This license is for your protection as a Contributor as well as for the protection of [CTTC](http://www.cttc.es/); it does not change your rights to use your own contributions for any other purpose. Except for the license granted therein to CTTC and recipients of software distributed by CTTC, you reserve all right, title, and interest in and to your contributions. The information you provide in that CLA will be maintained in accordance with [CTTC's privacy policy](http://www.cttc.es/privacy/).
|
||||
3. You have read the [Contributing Guidelines](https://github.com/gnss-sdr/gnss-sdr/blob/master/CONTRIBUTING.md).
|
||||
4. You have read the [coding style guide](http://gnss-sdr.org/coding-style/).
|
||||
5. You have forked the [gnss-sdr upstream repository](https://github.com/gnss-sdr/gnss-sdr) and have created your branch from `next` (or any other currently living branch in the upstream repository).
|
||||
6. Please include a description of your changes here.
|
||||
5. Specifically, you have read [about clang-format](http://gnss-sdr.org/coding-style/#use-tools-for-automated-code-formatting) and you have applied it.
|
||||
6. You have forked the [gnss-sdr upstream repository](https://github.com/gnss-sdr/gnss-sdr) and have created your branch from `next` (or any other currently living branch in the upstream repository).
|
||||
7. Please include a description of your changes here.
|
||||
|
||||
**Please feel free to delete this line and the above text once you have read it and in case you want to go on with your pull request.**
|
@ -44,8 +44,7 @@ using google::LogMessage;
|
||||
RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
|
||||
std::string role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams) :
|
||||
role_(role),
|
||||
unsigned int out_streams) : role_(role),
|
||||
in_streams_(in_streams),
|
||||
out_streams_(out_streams)
|
||||
{
|
||||
@ -417,7 +416,8 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
|
||||
|
||||
snrmask_t snrmask = {{}, {{}, {}}};
|
||||
|
||||
prcopt_t rtklib_configuration_options = {positioning_mode, /* positioning mode (PMODE_XXX) see src/algorithms/libs/rtklib/rtklib.h */
|
||||
prcopt_t rtklib_configuration_options = {
|
||||
positioning_mode, /* positioning mode (PMODE_XXX) see src/algorithms/libs/rtklib/rtklib.h */
|
||||
0, /* solution type (0:forward,1:backward,2:combined) */
|
||||
number_of_frequencies, /* number of frequencies (1:L1, 2:L1+L2, 3:L1+L2+L5)*/
|
||||
navigation_system, /* navigation system */
|
||||
@ -522,7 +522,9 @@ RtklibPvt::~RtklibPvt()
|
||||
|
||||
void RtklibPvt::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if(top_block) { /* top_block is not null */};
|
||||
if (top_block)
|
||||
{ /* top_block is not null */
|
||||
};
|
||||
// Nothing to connect internally
|
||||
DLOG(INFO) << "nothing to connect internally";
|
||||
}
|
||||
@ -530,7 +532,9 @@ void RtklibPvt::connect(gr::top_block_sptr top_block)
|
||||
|
||||
void RtklibPvt::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if(top_block) { /* top_block is not null */};
|
||||
if (top_block)
|
||||
{ /* top_block is not null */
|
||||
};
|
||||
// Nothing to disconnect
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,6 @@
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifndef GNSS_SDR_RTKLIB_PVT_H_
|
||||
#define GNSS_SDR_RTKLIB_PVT_H_
|
||||
|
||||
|
@ -218,7 +218,6 @@ void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg)
|
||||
{
|
||||
LOG(WARNING) << "msg_handler_telemetry unknown object type!";
|
||||
}
|
||||
|
||||
}
|
||||
catch (boost::bad_any_cast& e)
|
||||
{
|
||||
@ -237,9 +236,7 @@ rtklib_pvt_cc::rtklib_pvt_cc(unsigned int nchannels, bool dump, std::string dump
|
||||
int output_rate_ms, int display_rate_ms, bool flag_nmea_tty_port,
|
||||
std::string nmea_dump_filename, std::string nmea_dump_devname, int rinex_version,
|
||||
bool flag_rtcm_server, bool flag_rtcm_tty_port, unsigned short rtcm_tcp_port,
|
||||
unsigned short rtcm_station_id, std::map<int,int> rtcm_msg_rate_ms, std::string
|
||||
rtcm_dump_devname, const unsigned int type_of_receiver, rtk_t & rtk) :
|
||||
gr::sync_block("rtklib_pvt_cc",
|
||||
unsigned short rtcm_station_id, std::map<int, int> rtcm_msg_rate_ms, std::string rtcm_dump_devname, const unsigned int type_of_receiver, rtk_t& rtk) : gr::sync_block("rtklib_pvt_cc",
|
||||
gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)),
|
||||
gr::io_signature::make(0, 0, 0))
|
||||
{
|
||||
@ -542,13 +539,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
|
||||
std::map<int, Galileo_Ephemeris>::const_iterator tmp_eph_iter_gal = d_ls_pvt->galileo_ephemeris_map.find(in[i][epoch].PRN);
|
||||
std::map<int, Gps_CNAV_Ephemeris>::const_iterator tmp_eph_iter_cnav = d_ls_pvt->gps_cnav_ephemeris_map.find(in[i][epoch].PRN);
|
||||
std::map<int, Glonass_Gnav_Ephemeris>::const_iterator tmp_eph_iter_glo_gnav = d_ls_pvt->glonass_gnav_ephemeris_map.find(in[i][epoch].PRN);
|
||||
if(((tmp_eph_iter_gps->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("1C") == 0))
|
||||
|| ((tmp_eph_iter_cnav->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("2S") == 0))
|
||||
|| ((tmp_eph_iter_gal->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("1B") == 0))
|
||||
|| ((tmp_eph_iter_gal->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("5X") == 0))
|
||||
|| ((tmp_eph_iter_glo_gnav->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("1G") == 0))
|
||||
|| ((tmp_eph_iter_glo_gnav->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("2G") == 0))
|
||||
|| ((tmp_eph_iter_cnav->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("L5") == 0)))
|
||||
if (((tmp_eph_iter_gps->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("1C") == 0)) || ((tmp_eph_iter_cnav->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("2S") == 0)) || ((tmp_eph_iter_gal->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("1B") == 0)) || ((tmp_eph_iter_gal->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("5X") == 0)) || ((tmp_eph_iter_glo_gnav->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("1G") == 0)) || ((tmp_eph_iter_glo_gnav->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("2G") == 0)) || ((tmp_eph_iter_cnav->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("L5") == 0)))
|
||||
{
|
||||
// store valid observables in a map.
|
||||
gnss_observables_map.insert(std::pair<int, Gnss_Synchro>(i, in[i][epoch]));
|
||||
@ -582,7 +573,6 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
|
||||
d_rtcm_printer->lock_time(d_ls_pvt->glonass_gnav_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -734,7 +724,6 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
|
||||
rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, d_rx_time);
|
||||
rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model);
|
||||
b_rinex_header_written = true; // do not write header anymore
|
||||
|
||||
}
|
||||
}
|
||||
if (type_of_rx == 2) // GPS L2C only
|
||||
@ -958,7 +947,6 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
|
||||
rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_ephemeris_map);
|
||||
rp->log_rinex_nav(rp->navGloFile, d_ls_pvt->glonass_gnav_ephemeris_map);
|
||||
}
|
||||
|
||||
}
|
||||
if (type_of_rx == 27) // Galileo E1B + GLONASS L1 C/A
|
||||
{
|
||||
@ -1164,7 +1152,6 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
|
||||
if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) && (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()))
|
||||
{
|
||||
rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map);
|
||||
|
||||
}
|
||||
if (!b_rinex_header_updated && (d_ls_pvt->galileo_utc_model.A0_6 != 0))
|
||||
{
|
||||
@ -1303,7 +1290,6 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
|
||||
}
|
||||
if (flag_write_RTCM_MSM_output == true)
|
||||
{
|
||||
|
||||
if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
|
||||
{
|
||||
d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, galileo_ephemeris_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
|
||||
@ -1387,7 +1373,6 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
|
||||
}
|
||||
if (flag_write_RTCM_MSM_output == true)
|
||||
{
|
||||
|
||||
if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
|
||||
{
|
||||
d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
|
||||
@ -1453,7 +1438,6 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
|
||||
}
|
||||
if (flag_write_RTCM_MSM_output == true)
|
||||
{
|
||||
|
||||
if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
|
||||
{
|
||||
d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, galileo_ephemeris_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
|
||||
@ -1461,7 +1445,6 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
|
||||
}
|
||||
if (flag_write_RTCM_MSM_output == true)
|
||||
{
|
||||
|
||||
if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end())
|
||||
{
|
||||
d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
|
||||
|
@ -144,7 +144,8 @@ private:
|
||||
bool first_fix;
|
||||
key_t sysv_msg_key;
|
||||
int sysv_msqid;
|
||||
typedef struct {
|
||||
typedef struct
|
||||
{
|
||||
long mtype; //required by sys v message
|
||||
double ttff;
|
||||
} ttff_msgbuf;
|
||||
|
@ -194,5 +194,3 @@ bool GeoJSON_Printer::close_file()
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -50,6 +50,7 @@ private:
|
||||
std::ofstream geojson_file;
|
||||
bool first_pos;
|
||||
std::string filename_;
|
||||
|
||||
public:
|
||||
GeoJSON_Printer();
|
||||
~GeoJSON_Printer();
|
||||
|
@ -347,7 +347,8 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_observables_map, dou
|
||||
|
||||
DLOG(INFO) << "Hybrid Position at " << boost::posix_time::to_simple_string(p_time)
|
||||
<< " is Lat = " << this->get_latitude() << " [deg], Long = " << this->get_longitude()
|
||||
<< " [deg], Height= " << this->get_height() << " [m]" << " RX time offset= " << this->get_time_offset_s() << " [s]";
|
||||
<< " [deg], Height= " << this->get_height() << " [m]"
|
||||
<< " RX time offset= " << this->get_time_offset_s() << " [s]";
|
||||
|
||||
// ###### Compute DOPs ########
|
||||
hybrid_ls_pvt::compute_DOP();
|
||||
|
@ -54,6 +54,7 @@ private:
|
||||
std::ofstream d_dump_file;
|
||||
int d_nchannels; // Number of available channels for positioning
|
||||
double d_galileo_current_time;
|
||||
|
||||
public:
|
||||
hybrid_ls_pvt(int nchannels, std::string dump_filename, bool flag_dump_to_file);
|
||||
~hybrid_ls_pvt();
|
||||
|
@ -124,7 +124,6 @@ bool Kml_Printer::set_headers(std::string filename, bool time_tag_name)
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool Kml_Printer::print_position(const std::shared_ptr<Pvt_Solution>& position, bool print_average_values)
|
||||
{
|
||||
double latitude;
|
||||
@ -164,7 +163,6 @@ bool Kml_Printer::close_file()
|
||||
{
|
||||
if (kml_file.is_open())
|
||||
{
|
||||
|
||||
kml_file << "</coordinates>" << std::endl
|
||||
<< "</LineString>" << std::endl
|
||||
<< "</Placemark>" << std::endl
|
||||
@ -180,14 +178,12 @@ bool Kml_Printer::close_file()
|
||||
}
|
||||
|
||||
|
||||
|
||||
Kml_Printer::Kml_Printer()
|
||||
{
|
||||
positions_printed = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Kml_Printer::~Kml_Printer()
|
||||
{
|
||||
close_file();
|
||||
@ -196,4 +192,3 @@ Kml_Printer::~Kml_Printer ()
|
||||
if (remove(kml_filename.c_str()) != 0) LOG(INFO) << "Error deleting temporary KML file";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -50,6 +50,7 @@ private:
|
||||
std::ofstream kml_file;
|
||||
bool positions_printed;
|
||||
std::string kml_filename;
|
||||
|
||||
public:
|
||||
Kml_Printer();
|
||||
~Kml_Printer();
|
||||
|
@ -41,7 +41,6 @@ using google::LogMessage;
|
||||
|
||||
Ls_Pvt::Ls_Pvt() : Pvt_Solution()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
arma::vec Ls_Pvt::bancroftPos(const arma::mat& satpos, const arma::vec& obs)
|
||||
@ -222,8 +221,10 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat & satpos, const arma::vec & obs
|
||||
{
|
||||
//--- Update equations -----------------------------------------
|
||||
rho2 = (X(0, i) - pos(0)) *
|
||||
(X(0, i) - pos(0)) + (X(1, i) - pos(1)) *
|
||||
(X(1, i) - pos(1)) + (X(2, i) - pos(2)) *
|
||||
(X(0, i) - pos(0)) +
|
||||
(X(1, i) - pos(1)) *
|
||||
(X(1, i) - pos(1)) +
|
||||
(X(2, i) - pos(2)) *
|
||||
(X(2, i) - pos(2));
|
||||
traveltime = sqrt(rho2) / GPS_C_m_s;
|
||||
|
||||
@ -290,5 +291,3 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat & satpos, const arma::vec & obs
|
||||
}
|
||||
return pos;
|
||||
}
|
||||
|
||||
|
||||
|
@ -46,6 +46,7 @@ private:
|
||||
* \brief Computes the Lorentz inner product between two vectors
|
||||
*/
|
||||
double lorentz(const arma::vec& x, const arma::vec& y);
|
||||
|
||||
public:
|
||||
Ls_Pvt();
|
||||
|
||||
@ -58,7 +59,6 @@ public:
|
||||
* \brief Computes the Weighted Least Squares position solution
|
||||
*/
|
||||
arma::vec leastSquarePos(const arma::mat& satpos, const arma::vec& obs, const arma::vec& w_vec);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -161,7 +161,8 @@ bool Nmea_Printer::Print_Nmea_Line(const std::shared_ptr<Pvt_Solution>& pvt_data
|
||||
}
|
||||
catch (const std::exception& ex)
|
||||
{
|
||||
DLOG(INFO) << "NMEA printer can not write on output file" << nmea_filename.c_str();;
|
||||
DLOG(INFO) << "NMEA printer can not write on output file" << nmea_filename.c_str();
|
||||
;
|
||||
}
|
||||
|
||||
//write to serial device
|
||||
@ -708,4 +709,3 @@ std::string Nmea_Printer::get_GPGGA()
|
||||
return sentence_str.str();
|
||||
//$GPGGA,104427.591,5920.7009,N,01803.2938,E,1,05,3.3,78.2,M,23.2,M,0.0,0000*4A
|
||||
}
|
||||
|
||||
|
@ -299,7 +299,10 @@ int Pvt_Solution::tropo(double *ddr_m, double sinel, double hsta_km, double p_mb
|
||||
double tkelp = tksea + tlapse * hp_km;
|
||||
double psea = p_mb * pow((tksea / tkelp), em);
|
||||
|
||||
if(sinel < 0) { sinel = 0.0; }
|
||||
if (sinel < 0)
|
||||
{
|
||||
sinel = 0.0;
|
||||
}
|
||||
|
||||
double tropo_delay = 0.0;
|
||||
bool done = false;
|
||||
@ -317,7 +320,10 @@ int Pvt_Solution::tropo(double *ddr_m, double sinel, double hsta_km, double p_mb
|
||||
rtop = pow((a_e + htop), 2) - pow((a_e + hsta_km), 2) * (1 - pow(sinel, 2));
|
||||
|
||||
// check to see if geometry is crazy
|
||||
if(rtop < 0) { rtop = 0; }
|
||||
if (rtop < 0)
|
||||
{
|
||||
rtop = 0;
|
||||
}
|
||||
|
||||
rtop = sqrt(rtop) - (a_e + hsta_km) * sinel;
|
||||
|
||||
@ -330,7 +336,6 @@ int Pvt_Solution::tropo(double *ddr_m, double sinel, double hsta_km, double p_mb
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
rn(i) = pow(rtop, (i + 1 + 1));
|
||||
|
||||
}
|
||||
|
||||
arma::rowvec alpha = {2 * a, 2 * pow(a, 2) + 4 * b / 3, a * (pow(a, 2) + 3 * b),
|
||||
@ -440,7 +445,6 @@ int Pvt_Solution::topocent(double *Az, double *El, double *D, const arma::vec &
|
||||
}
|
||||
|
||||
|
||||
|
||||
int Pvt_Solution::compute_DOP()
|
||||
{
|
||||
// ###### Compute DOPs ########
|
||||
|
@ -479,7 +479,9 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Glonass_Gnav_Utc_M
|
||||
|
||||
void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc_model, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac)
|
||||
{
|
||||
if(glonass_gnav_almanac.i_satellite_freq_channel){} //Avoid compiler warning
|
||||
if (glonass_gnav_almanac.i_satellite_freq_channel)
|
||||
{
|
||||
} //Avoid compiler warning
|
||||
std::string line;
|
||||
stringVersion = "3.02";
|
||||
version = 3;
|
||||
@ -601,7 +603,9 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono
|
||||
|
||||
void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps_iono, const Gps_CNAV_Utc_Model& gps_utc_model, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac)
|
||||
{
|
||||
if(glonass_gnav_almanac.i_satellite_freq_channel){} //Avoid compiler warning
|
||||
if (glonass_gnav_almanac.i_satellite_freq_channel)
|
||||
{
|
||||
} //Avoid compiler warning
|
||||
std::string line;
|
||||
stringVersion = "3.02";
|
||||
version = 3;
|
||||
@ -723,9 +727,13 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps
|
||||
|
||||
void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model, const Galileo_Almanac& galileo_almanac, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac)
|
||||
{
|
||||
if(glonass_gnav_almanac.i_satellite_freq_channel){} //Avoid compiler warning
|
||||
if (glonass_gnav_almanac.i_satellite_freq_channel)
|
||||
{
|
||||
} //Avoid compiler warning
|
||||
//Avoid compiler warning, there is not time system correction between Galileo and GLONASS
|
||||
if(galileo_almanac.A_0G_10){}
|
||||
if (galileo_almanac.A_0G_10)
|
||||
{
|
||||
}
|
||||
std::string line;
|
||||
|
||||
// -------- Line 1
|
||||
@ -1471,7 +1479,9 @@ void Rinex_Printer::rinex_sbs_header(std::fstream& out)
|
||||
|
||||
void Rinex_Printer::update_nav_header(std::fstream& out, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac)
|
||||
{
|
||||
if(glonass_gnav_almanac.i_satellite_freq_channel){} //Avoid compiler warning
|
||||
if (glonass_gnav_almanac.i_satellite_freq_channel)
|
||||
{
|
||||
} //Avoid compiler warning
|
||||
std::vector<std::string> data;
|
||||
std::string line_aux;
|
||||
|
||||
@ -1521,7 +1531,6 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Glonass_Gnav_Utc_
|
||||
{
|
||||
data.push_back(line_str);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1617,7 +1626,6 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& gal
|
||||
{
|
||||
data.push_back(line_str);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2017,7 +2025,9 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_ion
|
||||
|
||||
void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc_model, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac)
|
||||
{
|
||||
if(glonass_gnav_almanac.i_satellite_freq_channel){} //Avoid compiler warning
|
||||
if (glonass_gnav_almanac.i_satellite_freq_channel)
|
||||
{
|
||||
} //Avoid compiler warning
|
||||
std::vector<std::string> data;
|
||||
std::string line_aux;
|
||||
|
||||
@ -2100,7 +2110,6 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_ion
|
||||
{
|
||||
data.push_back(line_str);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2124,7 +2133,9 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_ion
|
||||
|
||||
void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps_iono, const Gps_CNAV_Utc_Model& gps_utc_model, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac)
|
||||
{
|
||||
if(glonass_gnav_almanac.i_satellite_freq_channel){} //Avoid compiler warning
|
||||
if (glonass_gnav_almanac.i_satellite_freq_channel)
|
||||
{
|
||||
} //Avoid compiler warning
|
||||
std::vector<std::string> data;
|
||||
std::string line_aux;
|
||||
|
||||
@ -2230,9 +2241,13 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_CNAV_Iono& gp
|
||||
|
||||
void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model, const Galileo_Almanac& galileo_almanac, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac)
|
||||
{
|
||||
if(glonass_gnav_almanac.i_satellite_freq_channel){} //Avoid compiler warning
|
||||
if (glonass_gnav_almanac.i_satellite_freq_channel)
|
||||
{
|
||||
} //Avoid compiler warning
|
||||
//Avoid compiler warning, there is not time system correction between Galileo and GLONASS
|
||||
if(galileo_almanac.A_0G_10){}
|
||||
if (galileo_almanac.A_0G_10)
|
||||
{
|
||||
}
|
||||
std::vector<std::string> data;
|
||||
std::string line_aux;
|
||||
|
||||
@ -2305,7 +2320,6 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& gal
|
||||
{
|
||||
data.push_back(line_str);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2947,9 +2961,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int, Galileo
|
||||
if (E1B_DVS == "1") LOG(WARNING) << "Navigation data without guarantee";
|
||||
E1B_DVS = "0"; // *************** CHANGE THIS WHEN GALILEO SIGNAL IS VALID
|
||||
|
||||
std::string SVhealth_str = E5B_HS + boost::lexical_cast<std::string>(galileo_ephemeris_iter->second.E5b_DVS_5)
|
||||
+ "11" + "1" + E1B_DVS + E1B_HS
|
||||
+ boost::lexical_cast<std::string>(galileo_ephemeris_iter->second.E1B_DVS_5);
|
||||
std::string SVhealth_str = E5B_HS + boost::lexical_cast<std::string>(galileo_ephemeris_iter->second.E5b_DVS_5) + "11" + "1" + E1B_DVS + E1B_HS + boost::lexical_cast<std::string>(galileo_ephemeris_iter->second.E1B_DVS_5);
|
||||
SVhealth_str = "000000000"; // *************** CHANGE THIS WHEN GALILEO SIGNAL IS VALID
|
||||
int SVhealth = Rinex_Printer::toInt(SVhealth_str, 9);
|
||||
line += Rinex_Printer::doub2for(static_cast<double>(SVhealth), 18, 2);
|
||||
@ -3208,7 +3220,9 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int, Galileo
|
||||
|
||||
void Rinex_Printer::rinex_obs_header(std::fstream& out, const Glonass_Gnav_Ephemeris& eph, const double d_TOW_first_observation, const std::string glonass_bands)
|
||||
{
|
||||
if(eph.d_m){} //Avoid compiler warning
|
||||
if (eph.d_m)
|
||||
{
|
||||
} //Avoid compiler warning
|
||||
std::string line;
|
||||
std::map<int, Glonass_Gnav_Ephemeris>::const_iterator glonass_gnav_ephemeris_iter;
|
||||
|
||||
@ -3536,7 +3550,9 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Glonass_Gnav_Ephem
|
||||
|
||||
void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string glonass_bands)
|
||||
{
|
||||
if(glonass_gnav_eph.d_m){} // avoid warning, not needed
|
||||
if (glonass_gnav_eph.d_m)
|
||||
{
|
||||
} // avoid warning, not needed
|
||||
std::string line;
|
||||
|
||||
// -------- Line 1
|
||||
@ -3887,7 +3903,9 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps
|
||||
|
||||
void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string glonass_bands)
|
||||
{
|
||||
if(glonass_gnav_eph.d_m){} // avoid warning, not needed
|
||||
if (glonass_gnav_eph.d_m)
|
||||
{
|
||||
} // avoid warning, not needed
|
||||
std::string line;
|
||||
|
||||
// -------- Line 1
|
||||
@ -4203,7 +4221,9 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris
|
||||
|
||||
void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& galileo_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string galileo_bands, const std::string glonass_bands)
|
||||
{
|
||||
if(glonass_gnav_eph.d_m){} // avoid warning, not needed
|
||||
if (glonass_gnav_eph.d_m)
|
||||
{
|
||||
} // avoid warning, not needed
|
||||
std::string line;
|
||||
version = 3;
|
||||
|
||||
@ -4988,7 +5008,9 @@ void Rinex_Printer::rinex_obs_header(std::fstream & out, const Gps_CNAV_Ephemeri
|
||||
|
||||
void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph, const Gps_CNAV_Ephemeris& eph_cnav, const double d_TOW_first_observation)
|
||||
{
|
||||
if(eph_cnav.d_i_0){} // avoid warning, not needed
|
||||
if (eph_cnav.d_i_0)
|
||||
{
|
||||
} // avoid warning, not needed
|
||||
std::string line;
|
||||
|
||||
// -------- Line 1
|
||||
@ -5475,7 +5497,9 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris&
|
||||
|
||||
void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps_eph, const Galileo_Ephemeris& galileo_eph, const double d_TOW_first_observation, const std::string galileo_bands)
|
||||
{
|
||||
if(galileo_eph.e_1){} // avoid warning, not needed
|
||||
if (galileo_eph.e_1)
|
||||
{
|
||||
} // avoid warning, not needed
|
||||
std::string line;
|
||||
version = 3;
|
||||
|
||||
@ -5891,7 +5915,6 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Gps_CNAV_Utc_Mode
|
||||
{
|
||||
data.push_back(line_str);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -5951,7 +5974,6 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Galileo_Utc_Model
|
||||
{
|
||||
data.push_back(line_str);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -5978,7 +6000,9 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri
|
||||
std::string line;
|
||||
|
||||
// Avoid compiler warning
|
||||
if(glonass_band.size()){}
|
||||
if (glonass_band.size())
|
||||
{
|
||||
}
|
||||
|
||||
boost::posix_time::ptime p_glonass_time = Rinex_Printer::compute_UTC_time(eph, obs_time);
|
||||
std::string timestring = boost::posix_time::to_iso_string(p_glonass_time);
|
||||
@ -6218,7 +6242,9 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri
|
||||
|
||||
void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double gps_obs_time, const std::map<int, Gnss_Synchro>& observables)
|
||||
{
|
||||
if(glonass_gnav_eph.d_m){} // avoid warning, not needed
|
||||
if (glonass_gnav_eph.d_m)
|
||||
{
|
||||
} // avoid warning, not needed
|
||||
std::string line;
|
||||
|
||||
// -------- EPOCH record
|
||||
@ -6534,7 +6560,9 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep
|
||||
|
||||
void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double gps_obs_time, const std::map<int, Gnss_Synchro>& observables)
|
||||
{
|
||||
if(glonass_gnav_eph.d_m){} // avoid warning, not needed
|
||||
if (glonass_gnav_eph.d_m)
|
||||
{
|
||||
} // avoid warning, not needed
|
||||
std::string line;
|
||||
|
||||
// -------- EPOCH record
|
||||
@ -6772,7 +6800,9 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g
|
||||
|
||||
void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& galileo_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, double galileo_obs_time, const std::map<int, Gnss_Synchro>& observables)
|
||||
{
|
||||
if(glonass_gnav_eph.d_m){} // avoid warning, not needed
|
||||
if (glonass_gnav_eph.d_m)
|
||||
{
|
||||
} // avoid warning, not needed
|
||||
std::string line;
|
||||
|
||||
boost::posix_time::ptime p_galileo_time = Rinex_Printer::compute_Galileo_time(galileo_eph, galileo_obs_time);
|
||||
@ -7367,7 +7397,9 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_CNAV_Ephemeris &
|
||||
|
||||
void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, const Gps_CNAV_Ephemeris& eph_cnav, double obs_time, const std::map<int, Gnss_Synchro>& observables)
|
||||
{
|
||||
if(eph_cnav.d_i_0){} // avoid warning, not needed
|
||||
if (eph_cnav.d_i_0)
|
||||
{
|
||||
} // avoid warning, not needed
|
||||
// RINEX observations timestamps are GPS timestamps.
|
||||
std::string line;
|
||||
|
||||
@ -7799,7 +7831,9 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep
|
||||
|
||||
void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_eph, const Galileo_Ephemeris& galileo_eph, double gps_obs_time, const std::map<int, Gnss_Synchro>& observables)
|
||||
{
|
||||
if(galileo_eph.e_1){} // avoid warning, not needed
|
||||
if (galileo_eph.e_1)
|
||||
{
|
||||
} // avoid warning, not needed
|
||||
std::string line;
|
||||
|
||||
boost::posix_time::ptime p_gps_time = Rinex_Printer::compute_GPS_time(gps_eph, gps_obs_time);
|
||||
@ -8049,7 +8083,6 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Rinex_Printer::to_date_time(int gps_week, int gps_tow, int& year, int& month, int& day, int& hour, int& minute, int& second)
|
||||
{
|
||||
// represents GPS time (week, TOW) in the date time format of the Gregorian calendar.
|
||||
|
@ -421,7 +421,8 @@ private:
|
||||
const std::string::size_type length,
|
||||
const char pad = ' ')
|
||||
{
|
||||
std::string t(s); return leftJustify(t, length, pad);
|
||||
std::string t(s);
|
||||
return leftJustify(t, length, pad);
|
||||
}
|
||||
|
||||
|
||||
@ -445,7 +446,8 @@ private:
|
||||
const std::string::size_type length,
|
||||
const char pad = ' ')
|
||||
{
|
||||
std::string t(s); return rightJustify(t, length, pad);
|
||||
std::string t(s);
|
||||
return rightJustify(t, length, pad);
|
||||
}
|
||||
|
||||
|
||||
@ -555,13 +557,13 @@ private:
|
||||
* @param x object to turn into a string.
|
||||
* @return string representation of \a x.
|
||||
*/
|
||||
template <class X> inline std::string asString(const X x);
|
||||
template <class X>
|
||||
inline std::string asString(const X x);
|
||||
|
||||
inline std::string asFixWidthString(const int x, const int width, char fill_digit);
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Implementation of inline functions (modified versions from GPSTk http://www.gpstk.org)
|
||||
|
||||
inline std::string& Rinex_Printer::leftJustify(std::string& s,
|
||||
@ -598,7 +600,6 @@ inline std::string & Rinex_Printer::rightJustify(std::string & s,
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline std::string Rinex_Printer::doub2for(const double& d,
|
||||
const std::string::size_type length,
|
||||
const std::string::size_type expLen,
|
||||
@ -736,7 +737,6 @@ inline std::string & Rinex_Printer::sci2for(std::string & aStr,
|
||||
} // end sci2for
|
||||
|
||||
|
||||
|
||||
inline std::string asString(const long double x, const std::string::size_type precision)
|
||||
{
|
||||
std::ostringstream ss;
|
||||
@ -780,7 +780,8 @@ inline int Rinex_Printer::toInt(std::string bitString, int sLength)
|
||||
}
|
||||
|
||||
|
||||
template<class X> inline std::string Rinex_Printer::asString(const X x)
|
||||
template <class X>
|
||||
inline std::string Rinex_Printer::asString(const X x)
|
||||
{
|
||||
std::ostringstream ss;
|
||||
ss << x;
|
||||
|
@ -351,7 +351,6 @@ bool rtklib_solver::get_PVT(const std::map<int,Gnss_Synchro> & gnss_observables_
|
||||
{
|
||||
DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN;
|
||||
}
|
||||
|
||||
}
|
||||
// GLONASS GNAV L2
|
||||
if (sig_.compare("2G") == 0)
|
||||
@ -391,8 +390,6 @@ bool rtklib_solver::get_PVT(const std::map<int,Gnss_Synchro> & gnss_observables_
|
||||
{
|
||||
DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -456,7 +453,8 @@ bool rtklib_solver::get_PVT(const std::map<int,Gnss_Synchro> & gnss_observables_
|
||||
|
||||
DLOG(INFO) << "RTKLIB Position at " << boost::posix_time::to_simple_string(p_time)
|
||||
<< " is Lat = " << this->get_latitude() << " [deg], Long = " << this->get_longitude()
|
||||
<< " [deg], Height= " << this->get_height() << " [m]" << " RX time offset= " << this->get_time_offset_s() << " [s]";
|
||||
<< " [deg], Height= " << this->get_height() << " [m]"
|
||||
<< " RX time offset= " << this->get_time_offset_s() << " [s]";
|
||||
|
||||
// ######## LOG FILE #########
|
||||
if (d_flag_dump_enabled == true)
|
||||
|
@ -42,8 +42,7 @@ using google::LogMessage;
|
||||
|
||||
GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) :
|
||||
role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
configuration_ = configuration;
|
||||
std::string default_item_type = "gr_complex";
|
||||
@ -77,9 +76,7 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition(
|
||||
|
||||
//--- Find number of samples per spreading code (4 ms) -----------------
|
||||
code_length_ = round(
|
||||
fs_in_
|
||||
/ (Galileo_E1_CODE_CHIP_RATE_HZ
|
||||
/ Galileo_E1_B_CODE_LENGTH_CHIPS));
|
||||
fs_in_ / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS));
|
||||
|
||||
vector_length_ = code_length_ * static_cast<int>(sampled_ms_ / 4);
|
||||
|
||||
@ -209,8 +206,7 @@ void GalileoE1Pcps8msAmbiguousAcquisition::set_local_code()
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
bool cboc = configuration_->property(
|
||||
"Acquisition" + boost::lexical_cast<std::string>(channel_)
|
||||
+ ".cboc", false);
|
||||
"Acquisition" + boost::lexical_cast<std::string>(channel_) + ".cboc", false);
|
||||
|
||||
std::complex<float>* code = new std::complex<float>[code_length_];
|
||||
|
||||
@ -287,4 +283,3 @@ gr::basic_block_sptr GalileoE1Pcps8msAmbiguousAcquisition::get_right_block()
|
||||
{
|
||||
return acquisition_cc_;
|
||||
}
|
||||
|
||||
|
@ -43,8 +43,7 @@ using google::LogMessage;
|
||||
|
||||
GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) :
|
||||
role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
configuration_ = configuration;
|
||||
std::string default_item_type = "gr_complex";
|
||||
@ -95,7 +94,10 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
|
||||
{
|
||||
item_size_ = sizeof(lv_16sc_t);
|
||||
}
|
||||
else { item_size_ = sizeof(gr_complex); }
|
||||
else
|
||||
{
|
||||
item_size_ = sizeof(gr_complex);
|
||||
}
|
||||
acquisition_ = pcps_make_acquisition(sampled_ms_, max_dwells_,
|
||||
doppler_max_, if_, fs_in_, samples_per_ms, code_length_,
|
||||
bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_,
|
||||
@ -192,8 +194,7 @@ void GalileoE1PcpsAmbiguousAcquisition::init()
|
||||
void GalileoE1PcpsAmbiguousAcquisition::set_local_code()
|
||||
{
|
||||
bool cboc = configuration_->property(
|
||||
"Acquisition" + boost::lexical_cast<std::string>(channel_)
|
||||
+ ".cboc", false);
|
||||
"Acquisition" + boost::lexical_cast<std::string>(channel_) + ".cboc", false);
|
||||
|
||||
std::complex<float>* code = new std::complex<float>[code_length_];
|
||||
|
||||
@ -330,4 +331,3 @@ gr::basic_block_sptr GalileoE1PcpsAmbiguousAcquisition::get_right_block()
|
||||
{
|
||||
return acquisition_;
|
||||
}
|
||||
|
||||
|
@ -42,8 +42,7 @@ using google::LogMessage;
|
||||
|
||||
GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) :
|
||||
role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
configuration_ = configuration;
|
||||
std::string default_item_type = "gr_complex";
|
||||
@ -77,9 +76,7 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition
|
||||
//--- Find number of samples per spreading code (4 ms) -----------------
|
||||
|
||||
code_length_ = round(
|
||||
fs_in_
|
||||
/ (Galileo_E1_CODE_CHIP_RATE_HZ
|
||||
/ Galileo_E1_B_CODE_LENGTH_CHIPS));
|
||||
fs_in_ / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS));
|
||||
|
||||
vector_length_ = code_length_ * static_cast<int>(sampled_ms_ / 4);
|
||||
|
||||
@ -212,8 +209,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_local_code()
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
bool cboc = configuration_->property(
|
||||
"Acquisition" + boost::lexical_cast<std::string>(channel_)
|
||||
+ ".cboc", false);
|
||||
"Acquisition" + boost::lexical_cast<std::string>(channel_) + ".cboc", false);
|
||||
|
||||
char signal[3];
|
||||
|
||||
@ -246,10 +242,11 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisition::set_state(int state)
|
||||
}
|
||||
|
||||
|
||||
|
||||
float GalileoE1PcpsCccwsrAmbiguousAcquisition::calculate_threshold(float pfa)
|
||||
{
|
||||
if(pfa){ /* Not implemented*/};
|
||||
if (pfa)
|
||||
{ /* Not implemented*/
|
||||
};
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
@ -260,7 +257,6 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisition::connect(gr::top_block_sptr top_blo
|
||||
{
|
||||
top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -283,4 +279,3 @@ gr::basic_block_sptr GalileoE1PcpsCccwsrAmbiguousAcquisition::get_right_block()
|
||||
{
|
||||
return acquisition_cc_;
|
||||
}
|
||||
|
||||
|
@ -42,8 +42,7 @@ using google::LogMessage;
|
||||
|
||||
GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcquisition(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) :
|
||||
role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
configuration_ = configuration;
|
||||
std::string default_item_type = "gr_complex";
|
||||
@ -64,9 +63,7 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui
|
||||
|
||||
/*--- Find number of samples per spreading code (4 ms) -----------------*/
|
||||
code_length_ = round(
|
||||
fs_in_
|
||||
/ (Galileo_E1_CODE_CHIP_RATE_HZ
|
||||
/ Galileo_E1_B_CODE_LENGTH_CHIPS));
|
||||
fs_in_ / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS));
|
||||
|
||||
int samples_per_ms = round(code_length_ / 4.0);
|
||||
|
||||
@ -96,7 +93,6 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui
|
||||
LOG(WARNING) << "coherent_integration_time should be multiple of "
|
||||
<< "Galileo code length (4 ms). coherent_integration_time = "
|
||||
<< sampled_ms_ << " ms will be used.";
|
||||
|
||||
}
|
||||
// vector_length_ = (sampled_ms_/folding_factor_) * code_length_;
|
||||
vector_length_ = sampled_ms_ * samples_per_ms;
|
||||
@ -153,8 +149,7 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::~GalileoE1PcpsQuickSyncAmbiguousAcqu
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_channel(unsigned int channel)
|
||||
void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_channel(unsigned int channel)
|
||||
{
|
||||
channel_ = channel;
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
@ -164,10 +159,8 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_channel(unsigned int channel)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_threshold(float threshold)
|
||||
void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_threshold(float threshold)
|
||||
{
|
||||
|
||||
float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0);
|
||||
|
||||
if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0);
|
||||
@ -190,8 +183,7 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_threshold(float threshold)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_doppler_max(unsigned int doppler_max)
|
||||
void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_doppler_max(unsigned int doppler_max)
|
||||
{
|
||||
doppler_max_ = doppler_max;
|
||||
|
||||
@ -202,8 +194,7 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_doppler_max(unsigned int doppler
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_doppler_step(unsigned int doppler_step)
|
||||
void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_doppler_step(unsigned int doppler_step)
|
||||
{
|
||||
doppler_step_ = doppler_step;
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
@ -212,8 +203,7 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_doppler_step(unsigned int dopple
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_gnss_synchro(
|
||||
void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_gnss_synchro(
|
||||
Gnss_Synchro* gnss_synchro)
|
||||
{
|
||||
gnss_synchro_ = gnss_synchro;
|
||||
@ -238,22 +228,19 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::mag()
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
GalileoE1PcpsQuickSyncAmbiguousAcquisition::init()
|
||||
void GalileoE1PcpsQuickSyncAmbiguousAcquisition::init()
|
||||
{
|
||||
acquisition_cc_->init();
|
||||
//set_local_code();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_local_code()
|
||||
void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_local_code()
|
||||
{
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
bool cboc = configuration_->property(
|
||||
"Acquisition" + boost::lexical_cast<std::string>(channel_)
|
||||
+ ".cboc", false);
|
||||
"Acquisition" + boost::lexical_cast<std::string>(channel_) + ".cboc", false);
|
||||
|
||||
std::complex<float>* code = new std::complex<float>[code_length_];
|
||||
|
||||
@ -276,8 +263,7 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_local_code()
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
GalileoE1PcpsQuickSyncAmbiguousAcquisition::reset()
|
||||
void GalileoE1PcpsQuickSyncAmbiguousAcquisition::reset()
|
||||
{
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
@ -294,7 +280,6 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_state(int state)
|
||||
}
|
||||
|
||||
|
||||
|
||||
float GalileoE1PcpsQuickSyncAmbiguousAcquisition::calculate_threshold(float pfa)
|
||||
{
|
||||
unsigned int frequency_bins = 0;
|
||||
@ -316,8 +301,7 @@ float GalileoE1PcpsQuickSyncAmbiguousAcquisition::calculate_threshold(float pfa)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
GalileoE1PcpsQuickSyncAmbiguousAcquisition::connect(gr::top_block_sptr top_block)
|
||||
void GalileoE1PcpsQuickSyncAmbiguousAcquisition::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
@ -326,8 +310,7 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::connect(gr::top_block_sptr top_block
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
GalileoE1PcpsQuickSyncAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block)
|
||||
void GalileoE1PcpsQuickSyncAmbiguousAcquisition::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
@ -346,4 +329,3 @@ gr::basic_block_sptr GalileoE1PcpsQuickSyncAmbiguousAcquisition::get_right_block
|
||||
{
|
||||
return acquisition_cc_;
|
||||
}
|
||||
|
||||
|
@ -42,8 +42,7 @@ using google::LogMessage;
|
||||
|
||||
GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) :
|
||||
role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
configuration_ = configuration;
|
||||
std::string default_item_type = "gr_complex";
|
||||
@ -80,9 +79,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition(
|
||||
//--- Find number of samples per spreading code (4 ms) -----------------
|
||||
|
||||
code_length_ = round(
|
||||
fs_in_
|
||||
/ (Galileo_E1_CODE_CHIP_RATE_HZ
|
||||
/ Galileo_E1_B_CODE_LENGTH_CHIPS));
|
||||
fs_in_ / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS));
|
||||
|
||||
vector_length_ = code_length_ * static_cast<int>(sampled_ms_ / 4);
|
||||
|
||||
@ -134,7 +131,6 @@ void GalileoE1PcpsTongAmbiguousAcquisition::set_channel(unsigned int channel)
|
||||
|
||||
void GalileoE1PcpsTongAmbiguousAcquisition::set_threshold(float threshold)
|
||||
{
|
||||
|
||||
float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0);
|
||||
|
||||
if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0);
|
||||
@ -175,7 +171,6 @@ void GalileoE1PcpsTongAmbiguousAcquisition::set_doppler_step(unsigned int dopple
|
||||
{
|
||||
acquisition_cc_->set_doppler_step(doppler_step_);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -215,8 +210,7 @@ void GalileoE1PcpsTongAmbiguousAcquisition::set_local_code()
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
bool cboc = configuration_->property(
|
||||
"Acquisition" + boost::lexical_cast<std::string>(channel_)
|
||||
+ ".cboc", false);
|
||||
"Acquisition" + boost::lexical_cast<std::string>(channel_) + ".cboc", false);
|
||||
|
||||
std::complex<float>* code = new std::complex<float>[code_length_];
|
||||
|
||||
@ -299,4 +293,3 @@ gr::basic_block_sptr GalileoE1PcpsTongAmbiguousAcquisition::get_right_block()
|
||||
{
|
||||
return acquisition_cc_;
|
||||
}
|
||||
|
||||
|
@ -48,8 +48,7 @@ using google::LogMessage;
|
||||
|
||||
GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) :
|
||||
role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
configuration_ = configuration;
|
||||
std::string default_item_type = "gr_complex";
|
||||
@ -138,7 +137,6 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_channel(unsigned int channel)
|
||||
|
||||
void GalileoE5aNoncoherentIQAcquisitionCaf::set_threshold(float threshold)
|
||||
{
|
||||
|
||||
float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0);
|
||||
|
||||
if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0);
|
||||
@ -266,9 +264,7 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_local_code()
|
||||
acquisition_cc_->set_local_code(codeI_, codeQ_);
|
||||
delete[] codeI;
|
||||
delete[] codeQ;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -309,14 +305,18 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_state(int state)
|
||||
|
||||
void GalileoE5aNoncoherentIQAcquisitionCaf::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if(top_block) { /* top_block is not null */};
|
||||
if (top_block)
|
||||
{ /* top_block is not null */
|
||||
};
|
||||
// Nothing to connect internally
|
||||
}
|
||||
|
||||
|
||||
void GalileoE5aNoncoherentIQAcquisitionCaf::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if(top_block) { /* top_block is not null */};
|
||||
if (top_block)
|
||||
{ /* top_block is not null */
|
||||
};
|
||||
// Nothing to disconnect internally
|
||||
}
|
||||
|
||||
|
@ -42,8 +42,7 @@
|
||||
using google::LogMessage;
|
||||
|
||||
GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* configuration,
|
||||
std::string role, unsigned int in_streams, unsigned int out_streams) :
|
||||
role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
configuration_ = configuration;
|
||||
std::string default_item_type = "gr_complex";
|
||||
@ -57,7 +56,10 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
acq_pilot_ = configuration_->property(role + ".acquire_pilot", false);
|
||||
acq_iq_ = configuration_->property(role + ".acquire_iq", false);
|
||||
if(acq_iq_) { acq_pilot_ = false; }
|
||||
if (acq_iq_)
|
||||
{
|
||||
acq_pilot_ = false;
|
||||
}
|
||||
dump_ = configuration_->property(role + ".dump", false);
|
||||
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
|
||||
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max;
|
||||
@ -115,14 +117,22 @@ void GalileoE5aPcpsAcquisition::set_channel(unsigned int channel)
|
||||
|
||||
void GalileoE5aPcpsAcquisition::set_threshold(float threshold)
|
||||
{
|
||||
|
||||
float pfa = configuration_->property(role_ + boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0);
|
||||
|
||||
if(pfa == 0.0) { pfa = configuration_->property(role_ + ".pfa", 0.0); }
|
||||
if (pfa == 0.0)
|
||||
{
|
||||
pfa = configuration_->property(role_ + ".pfa", 0.0);
|
||||
}
|
||||
|
||||
if(pfa == 0.0) { threshold_ = threshold; }
|
||||
if (pfa == 0.0)
|
||||
{
|
||||
threshold_ = threshold;
|
||||
}
|
||||
|
||||
else { threshold_ = calculate_threshold(pfa); }
|
||||
else
|
||||
{
|
||||
threshold_ = calculate_threshold(pfa);
|
||||
}
|
||||
|
||||
DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_;
|
||||
|
||||
@ -168,9 +178,18 @@ void GalileoE5aPcpsAcquisition::set_local_code()
|
||||
gr_complex* code = new gr_complex[code_length_];
|
||||
char signal_[3];
|
||||
|
||||
if(acq_iq_) { strcpy(signal_, "5X"); }
|
||||
else if(acq_pilot_) { strcpy(signal_, "5Q"); }
|
||||
else { strcpy(signal_, "5I"); }
|
||||
if (acq_iq_)
|
||||
{
|
||||
strcpy(signal_, "5X");
|
||||
}
|
||||
else if (acq_pilot_)
|
||||
{
|
||||
strcpy(signal_, "5Q");
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy(signal_, "5I");
|
||||
}
|
||||
|
||||
galileo_e5_a_code_gen_complex_sampled(code, signal_, gnss_synchro_->PRN, fs_in_, 0);
|
||||
|
||||
|
@ -124,7 +124,6 @@ public:
|
||||
void set_state(int state);
|
||||
|
||||
private:
|
||||
|
||||
float calculate_threshold(float pfa);
|
||||
|
||||
ConfigurationInterface* configuration_;
|
||||
@ -167,6 +166,5 @@ private:
|
||||
gr_complex* code_;
|
||||
|
||||
Gnss_Synchro* gnss_synchro_;
|
||||
|
||||
};
|
||||
#endif /* GALILEO_E5A_PCPS_ACQUISITION_H_ */
|
||||
|
@ -44,8 +44,7 @@ using google::LogMessage;
|
||||
|
||||
GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) :
|
||||
role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
configuration_ = configuration;
|
||||
std::string default_item_type = "gr_complex";
|
||||
|
@ -42,13 +42,11 @@
|
||||
#include <glog/logging.h>
|
||||
|
||||
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) :
|
||||
role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
configuration_ = configuration;
|
||||
std::string default_item_type = "gr_complex";
|
||||
@ -212,7 +210,6 @@ void GpsL1CaPcpsAcquisition::set_state(int state)
|
||||
}
|
||||
|
||||
|
||||
|
||||
float GpsL1CaPcpsAcquisition::calculate_threshold(float pfa)
|
||||
{
|
||||
//Calculate the threshold
|
||||
@ -309,4 +306,3 @@ gr::basic_block_sptr GpsL1CaPcpsAcquisition::get_right_block()
|
||||
{
|
||||
return acquisition_;
|
||||
}
|
||||
|
||||
|
@ -43,8 +43,7 @@ using google::LogMessage;
|
||||
|
||||
GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) :
|
||||
role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
std::string default_item_type = "gr_complex";
|
||||
std::string default_dump_filename = "./data/acquisition.dat";
|
||||
@ -64,8 +63,7 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler(
|
||||
max_dwells_ = configuration->property(role + ".max_dwells", 1);
|
||||
|
||||
//--- Find number of samples per spreading code -------------------------
|
||||
vector_length_ = round(fs_in_
|
||||
/ (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
|
||||
vector_length_ = round(fs_in_ / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
|
||||
|
||||
code_ = new gr_complex[vector_length_];
|
||||
|
||||
@ -158,14 +156,18 @@ void GpsL1CaPcpsAcquisitionFineDoppler::reset()
|
||||
|
||||
void GpsL1CaPcpsAcquisitionFineDoppler::connect(boost::shared_ptr<gr::top_block> top_block)
|
||||
{
|
||||
if(top_block) { /* top_block is not null */};
|
||||
if (top_block)
|
||||
{ /* top_block is not null */
|
||||
};
|
||||
//nothing to disconnect, now the tracking uses gr_sync_decimator
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsAcquisitionFineDoppler::disconnect(boost::shared_ptr<gr::top_block> top_block)
|
||||
{
|
||||
if(top_block) { /* top_block is not null */};
|
||||
if (top_block)
|
||||
{ /* top_block is not null */
|
||||
};
|
||||
//nothing to disconnect, now the tracking uses gr_sync_decimator
|
||||
}
|
||||
|
||||
@ -180,4 +182,3 @@ boost::shared_ptr<gr::basic_block> GpsL1CaPcpsAcquisitionFineDoppler::get_right_
|
||||
{
|
||||
return acquisition_cc_;
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,6 @@
|
||||
#include "pcps_acquisition_fine_doppler_cc.h"
|
||||
|
||||
|
||||
|
||||
class ConfigurationInterface;
|
||||
|
||||
/*!
|
||||
|
@ -44,8 +44,7 @@ using google::LogMessage;
|
||||
|
||||
GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) :
|
||||
role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
std::string default_item_type = "gr_complex";
|
||||
std::string default_dump_filename = "./data/acquisition.dat";
|
||||
@ -65,8 +64,7 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition(
|
||||
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
|
||||
|
||||
//--- Find number of samples per spreading code -------------------------
|
||||
vector_length_ = round(fs_in_
|
||||
/ (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
|
||||
vector_length_ = round(fs_in_ / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
|
||||
|
||||
code_ = new gr_complex[vector_length_];
|
||||
|
||||
@ -157,14 +155,18 @@ void GpsL1CaPcpsAssistedAcquisition::reset()
|
||||
|
||||
void GpsL1CaPcpsAssistedAcquisition::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if(top_block) { /* top_block is not null */};
|
||||
if (top_block)
|
||||
{ /* top_block is not null */
|
||||
};
|
||||
//nothing to disconnect, now the tracking uses gr_sync_decimator
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaPcpsAssistedAcquisition::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if(top_block) { /* top_block is not null */};
|
||||
if (top_block)
|
||||
{ /* top_block is not null */
|
||||
};
|
||||
//nothing to disconnect, now the tracking uses gr_sync_decimator
|
||||
}
|
||||
|
||||
@ -179,4 +181,3 @@ gr::basic_block_sptr GpsL1CaPcpsAssistedAcquisition::get_right_block()
|
||||
{
|
||||
return acquisition_cc_;
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,6 @@
|
||||
#include "pcps_assisted_acquisition_cc.h"
|
||||
|
||||
|
||||
|
||||
class ConfigurationInterface;
|
||||
|
||||
/*!
|
||||
|
@ -42,8 +42,7 @@ using google::LogMessage;
|
||||
|
||||
GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) :
|
||||
role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
configuration_ = configuration;
|
||||
std::string default_item_type = "gr_complex";
|
||||
@ -77,8 +76,7 @@ GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition(
|
||||
default_dump_filename);
|
||||
|
||||
//--- Find number of samples per spreading code -------------------------
|
||||
code_length_ = round(fs_in_
|
||||
/ (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
|
||||
code_length_ = round(fs_in_ / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
|
||||
|
||||
vector_length_ = code_length_ * sampled_ms_;
|
||||
|
||||
@ -168,7 +166,6 @@ void GpsL1CaPcpsOpenClAcquisition::set_doppler_step(unsigned int doppler_step)
|
||||
{
|
||||
acquisition_cc_->set_doppler_step(doppler_step_);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -283,4 +280,3 @@ gr::basic_block_sptr GpsL1CaPcpsOpenClAcquisition::get_right_block()
|
||||
{
|
||||
return acquisition_cc_;
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,6 @@
|
||||
#include "pcps_opencl_acquisition_cc.h"
|
||||
|
||||
|
||||
|
||||
class ConfigurationInterface;
|
||||
|
||||
/*!
|
||||
|
@ -43,8 +43,7 @@ using google::LogMessage;
|
||||
|
||||
GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) :
|
||||
role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
configuration_ = configuration;
|
||||
std::string default_item_type = "gr_complex";
|
||||
@ -62,8 +61,7 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition(
|
||||
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4);
|
||||
|
||||
//--- Find number of samples per spreading code -------------------------
|
||||
code_length_ = round(fs_in_
|
||||
/ (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
|
||||
code_length_ = round(fs_in_ / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
|
||||
|
||||
/*Calculate the folding factor value based on the calculations*/
|
||||
unsigned int temp = static_cast<unsigned int>(ceil(sqrt(log2(code_length_))));
|
||||
@ -157,7 +155,8 @@ void GpsL1CaPcpsQuickSyncAcquisition::set_channel(unsigned int channel)
|
||||
void GpsL1CaPcpsQuickSyncAcquisition::set_threshold(float threshold)
|
||||
{
|
||||
float pfa = configuration_->property(role_ +
|
||||
boost::lexical_cast<std::string>(channel_) + ".pfa", 0.0);
|
||||
boost::lexical_cast<std::string>(channel_) + ".pfa",
|
||||
0.0);
|
||||
|
||||
if (pfa == 0.0)
|
||||
{
|
||||
@ -320,5 +319,3 @@ gr::basic_block_sptr GpsL1CaPcpsQuickSyncAcquisition::get_right_block()
|
||||
{
|
||||
return acquisition_cc_;
|
||||
}
|
||||
|
||||
|
||||
|
@ -41,7 +41,6 @@
|
||||
#include "configuration_interface.h"
|
||||
|
||||
|
||||
|
||||
class ConfigurationInterface;
|
||||
|
||||
/*!
|
||||
@ -131,6 +130,7 @@ public:
|
||||
* \brief If state = 1, it forces the block to start acquiring from the first sample
|
||||
*/
|
||||
void set_state(int state);
|
||||
|
||||
private:
|
||||
ConfigurationInterface* configuration_;
|
||||
pcps_quicksync_acquisition_cc_sptr acquisition_cc_;
|
||||
@ -158,7 +158,6 @@ private:
|
||||
unsigned int out_streams_;
|
||||
|
||||
float calculate_threshold(float pfa);
|
||||
|
||||
};
|
||||
|
||||
#endif /* GNSS_SDR_GPS_L1_CA_PCPS_QUICKSYNC_ACQUISITION_H_ */
|
||||
|
@ -42,8 +42,7 @@ using google::LogMessage;
|
||||
|
||||
GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) :
|
||||
role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
configuration_ = configuration;
|
||||
std::string default_item_type = "gr_complex";
|
||||
@ -68,8 +67,7 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition(
|
||||
dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
|
||||
|
||||
//--- Find number of samples per spreading code -------------------------
|
||||
code_length_ = round(fs_in_
|
||||
/ (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
|
||||
code_length_ = round(fs_in_ / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
|
||||
|
||||
vector_length_ = code_length_ * sampled_ms_;
|
||||
|
||||
@ -159,7 +157,6 @@ void GpsL1CaPcpsTongAcquisition::set_doppler_step(unsigned int doppler_step)
|
||||
{
|
||||
acquisition_cc_->set_doppler_step(doppler_step_);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -259,7 +256,6 @@ void GpsL1CaPcpsTongAcquisition::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
top_block->connect(stream_to_vector_, 0, acquisition_cc_, 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -282,4 +278,3 @@ gr::basic_block_sptr GpsL1CaPcpsTongAcquisition::get_right_block()
|
||||
{
|
||||
return acquisition_cc_;
|
||||
}
|
||||
|
||||
|
@ -44,8 +44,7 @@ using google::LogMessage;
|
||||
|
||||
GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) :
|
||||
role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
configuration_ = configuration;
|
||||
std::string default_item_type = "gr_complex";
|
||||
@ -72,8 +71,7 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition(
|
||||
dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
|
||||
|
||||
//--- Find number of samples per spreading code -------------------------
|
||||
code_length_ = round(static_cast<double>(fs_in_)
|
||||
/ (GPS_L2_M_CODE_RATE_HZ / static_cast<double>(GPS_L2_M_CODE_LENGTH_CHIPS)));
|
||||
code_length_ = round(static_cast<double>(fs_in_) / (GPS_L2_M_CODE_RATE_HZ / static_cast<double>(GPS_L2_M_CODE_LENGTH_CHIPS)));
|
||||
|
||||
vector_length_ = code_length_;
|
||||
|
||||
@ -191,7 +189,6 @@ void GpsL2MPcpsAcquisition::init()
|
||||
|
||||
void GpsL2MPcpsAcquisition::set_local_code()
|
||||
{
|
||||
|
||||
gps_l2c_m_code_gen_complex_sampled(code_, gnss_synchro_->PRN, fs_in_);
|
||||
|
||||
acquisition_->set_local_code(code_);
|
||||
@ -209,7 +206,6 @@ void GpsL2MPcpsAcquisition::set_state(int state)
|
||||
}
|
||||
|
||||
|
||||
|
||||
float GpsL2MPcpsAcquisition::calculate_threshold(float pfa)
|
||||
{
|
||||
//Calculate the threshold
|
||||
@ -306,4 +302,3 @@ gr::basic_block_sptr GpsL2MPcpsAcquisition::get_right_block()
|
||||
{
|
||||
return acquisition_;
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,6 @@
|
||||
#include <string>
|
||||
|
||||
|
||||
|
||||
class ConfigurationInterface;
|
||||
|
||||
/*!
|
||||
|
@ -44,8 +44,7 @@ using google::LogMessage;
|
||||
|
||||
GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) :
|
||||
role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
configuration_ = configuration;
|
||||
std::string default_item_type = "gr_complex";
|
||||
@ -71,8 +70,7 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition(
|
||||
dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
|
||||
|
||||
//--- Find number of samples per spreading code -------------------------
|
||||
code_length_ = round(static_cast<double>(fs_in_)
|
||||
/ (GPS_L5i_CODE_RATE_HZ / static_cast<double>(GPS_L5i_CODE_LENGTH_CHIPS)));
|
||||
code_length_ = round(static_cast<double>(fs_in_) / (GPS_L5i_CODE_RATE_HZ / static_cast<double>(GPS_L5i_CODE_LENGTH_CHIPS)));
|
||||
|
||||
vector_length_ = code_length_;
|
||||
|
||||
@ -188,7 +186,6 @@ void GpsL5iPcpsAcquisition::init()
|
||||
|
||||
void GpsL5iPcpsAcquisition::set_local_code()
|
||||
{
|
||||
|
||||
gps_l5i_code_gen_complex_sampled(code_, gnss_synchro_->PRN, fs_in_);
|
||||
|
||||
acquisition_->set_local_code(code_);
|
||||
@ -206,7 +203,6 @@ void GpsL5iPcpsAcquisition::set_state(int state)
|
||||
}
|
||||
|
||||
|
||||
|
||||
float GpsL5iPcpsAcquisition::calculate_threshold(float pfa)
|
||||
{
|
||||
//Calculate the threshold
|
||||
@ -303,4 +299,3 @@ gr::basic_block_sptr GpsL5iPcpsAcquisition::get_right_block()
|
||||
{
|
||||
return acquisition_;
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,6 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr galileo_e5a_noncoherentIQ_make
|
||||
int CAF_window_hz_,
|
||||
int Zero_padding_)
|
||||
{
|
||||
|
||||
return galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr(
|
||||
new galileo_e5a_noncoherentIQ_acquisition_caf_cc(sampled_ms, max_dwells, doppler_max, freq, fs_in, samples_per_ms,
|
||||
samples_per_code, bit_transition_flag, dump, dump_filename, both_signal_components_, CAF_window_hz_, Zero_padding_));
|
||||
@ -73,8 +72,7 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc::galileo_e5a_noncoherentIQ_acquisit
|
||||
std::string dump_filename,
|
||||
bool both_signal_components_,
|
||||
int CAF_window_hz_,
|
||||
int Zero_padding_) :
|
||||
gr::block("galileo_e5a_noncoherentIQ_acquisition_caf_cc",
|
||||
int Zero_padding_) : gr::block("galileo_e5a_noncoherentIQ_acquisition_caf_cc",
|
||||
gr::io_signature::make(1, 1, sizeof(gr_complex)),
|
||||
gr::io_signature::make(0, 0, sizeof(gr_complex)))
|
||||
{
|
||||
@ -319,7 +317,6 @@ void galileo_e5a_noncoherentIQ_acquisition_caf_cc::init()
|
||||
}
|
||||
|
||||
|
||||
|
||||
void galileo_e5a_noncoherentIQ_acquisition_caf_cc::set_state(int state)
|
||||
{
|
||||
d_state = state;
|
||||
@ -334,7 +331,8 @@ void galileo_e5a_noncoherentIQ_acquisition_caf_cc::set_state(int state)
|
||||
d_test_statistics = 0.0;
|
||||
}
|
||||
else if (d_state == 0)
|
||||
{}
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(ERROR) << "State can only be set to 0 or 1";
|
||||
@ -342,8 +340,6 @@ void galileo_e5a_noncoherentIQ_acquisition_caf_cc::set_state(int state)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items __attribute__((unused)),
|
||||
gr_vector_int &ninput_items, gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items __attribute__((unused)))
|
||||
@ -519,14 +515,20 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
|
||||
if (magt_IA >= magt_IB)
|
||||
{
|
||||
// if (d_CAF_filter) {d_CAF_vector_I[doppler_index] = magt_IA;}
|
||||
if (d_CAF_window_hz > 0) {d_CAF_vector_I[doppler_index] = d_magnitudeIA[indext_IA];}
|
||||
if (d_CAF_window_hz > 0)
|
||||
{
|
||||
d_CAF_vector_I[doppler_index] = d_magnitudeIA[indext_IA];
|
||||
}
|
||||
if (d_both_signal_components)
|
||||
{
|
||||
// Integrate non-coherently I+Q
|
||||
if (magt_QA >= magt_QB)
|
||||
{
|
||||
// if (d_CAF_filter) {d_CAF_vector_Q[doppler_index] = magt_QA;}
|
||||
if (d_CAF_window_hz > 0) {d_CAF_vector_Q[doppler_index] = d_magnitudeQA[indext_QA];}
|
||||
if (d_CAF_window_hz > 0)
|
||||
{
|
||||
d_CAF_vector_Q[doppler_index] = d_magnitudeQA[indext_QA];
|
||||
}
|
||||
for (unsigned int i = 0; i < d_fft_size; i++)
|
||||
{
|
||||
d_magnitudeIA[i] += d_magnitudeQA[i];
|
||||
@ -535,7 +537,10 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
|
||||
else
|
||||
{
|
||||
// if (d_CAF_filter) {d_CAF_vector_Q[doppler_index] = magt_QB;}
|
||||
if (d_CAF_window_hz > 0) {d_CAF_vector_Q[doppler_index] = d_magnitudeQB[indext_QB];}
|
||||
if (d_CAF_window_hz > 0)
|
||||
{
|
||||
d_CAF_vector_Q[doppler_index] = d_magnitudeQB[indext_QB];
|
||||
}
|
||||
for (unsigned int i = 0; i < d_fft_size; i++)
|
||||
{
|
||||
d_magnitudeIA[i] += d_magnitudeQB[i];
|
||||
@ -548,14 +553,20 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
|
||||
else
|
||||
{
|
||||
// if (d_CAF_filter) {d_CAF_vector_I[doppler_index] = magt_IB;}
|
||||
if (d_CAF_window_hz > 0) {d_CAF_vector_I[doppler_index] = d_magnitudeIB[indext_IB];}
|
||||
if (d_CAF_window_hz > 0)
|
||||
{
|
||||
d_CAF_vector_I[doppler_index] = d_magnitudeIB[indext_IB];
|
||||
}
|
||||
if (d_both_signal_components)
|
||||
{
|
||||
// Integrate non-coherently I+Q
|
||||
if (magt_QA >= magt_QB)
|
||||
{
|
||||
//if (d_CAF_filter) {d_CAF_vector_Q[doppler_index] = magt_QA;}
|
||||
if (d_CAF_window_hz > 0) {d_CAF_vector_Q[doppler_index] = d_magnitudeQA[indext_QA];}
|
||||
if (d_CAF_window_hz > 0)
|
||||
{
|
||||
d_CAF_vector_Q[doppler_index] = d_magnitudeQA[indext_QA];
|
||||
}
|
||||
for (unsigned int i = 0; i < d_fft_size; i++)
|
||||
{
|
||||
d_magnitudeIB[i] += d_magnitudeQA[i];
|
||||
@ -564,7 +575,10 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
|
||||
else
|
||||
{
|
||||
// if (d_CAF_filter) {d_CAF_vector_Q[doppler_index] = magt_QB;}
|
||||
if (d_CAF_window_hz > 0) {d_CAF_vector_Q[doppler_index] = d_magnitudeQB[indext_QB];}
|
||||
if (d_CAF_window_hz > 0)
|
||||
{
|
||||
d_CAF_vector_Q[doppler_index] = d_magnitudeQB[indext_QB];
|
||||
}
|
||||
for (unsigned int i = 0; i < d_fft_size; i++)
|
||||
{
|
||||
d_magnitudeIB[i] += d_magnitudeQB[i];
|
||||
@ -578,11 +592,17 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
|
||||
else
|
||||
{
|
||||
// if (d_CAF_filter) {d_CAF_vector_I[doppler_index] = magt_IA;}
|
||||
if (d_CAF_window_hz > 0) {d_CAF_vector_I[doppler_index] = d_magnitudeIA[indext_IA];}
|
||||
if (d_CAF_window_hz > 0)
|
||||
{
|
||||
d_CAF_vector_I[doppler_index] = d_magnitudeIA[indext_IA];
|
||||
}
|
||||
if (d_both_signal_components)
|
||||
{
|
||||
// if (d_CAF_filter) {d_CAF_vector_Q[doppler_index] = magt_QA;}
|
||||
if (d_CAF_window_hz > 0) {d_CAF_vector_Q[doppler_index] = d_magnitudeQA[indext_QA];}
|
||||
if (d_CAF_window_hz > 0)
|
||||
{
|
||||
d_CAF_vector_Q[doppler_index] = d_magnitudeQA[indext_QA];
|
||||
}
|
||||
// NON-Coherent integration of only 1 code
|
||||
for (unsigned int i = 0; i < d_fft_size; i++)
|
||||
{
|
||||
@ -812,4 +832,3 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -246,6 +246,5 @@ public:
|
||||
int general_work(int noutput_items, gr_vector_int& ninput_items,
|
||||
gr_vector_const_void_star& input_items,
|
||||
gr_vector_void_star& output_items);
|
||||
|
||||
};
|
||||
#endif /* GALILEO_E5A_NONCOHERENT_IQ_ACQUISITION_CAF_CC_H_ */
|
||||
|
@ -45,7 +45,6 @@ galileo_pcps_8ms_acquisition_cc_sptr galileo_pcps_8ms_make_acquisition_cc(
|
||||
int samples_per_ms, int samples_per_code,
|
||||
bool dump, std::string dump_filename)
|
||||
{
|
||||
|
||||
return galileo_pcps_8ms_acquisition_cc_sptr(
|
||||
new galileo_pcps_8ms_acquisition_cc(sampled_ms, max_dwells, doppler_max, freq, fs_in, samples_per_ms,
|
||||
samples_per_code, dump, dump_filename));
|
||||
@ -55,8 +54,8 @@ galileo_pcps_8ms_acquisition_cc::galileo_pcps_8ms_acquisition_cc(
|
||||
unsigned int sampled_ms, unsigned int max_dwells,
|
||||
unsigned int doppler_max, long freq, long fs_in,
|
||||
int samples_per_ms, int samples_per_code,
|
||||
bool dump, std::string dump_filename) :
|
||||
gr::block("galileo_pcps_8ms_acquisition_cc",
|
||||
bool dump,
|
||||
std::string dump_filename) : gr::block("galileo_pcps_8ms_acquisition_cc",
|
||||
gr::io_signature::make(1, 1, sizeof(gr_complex) * sampled_ms * samples_per_ms),
|
||||
gr::io_signature::make(0, 0, sizeof(gr_complex) * sampled_ms * samples_per_ms))
|
||||
{
|
||||
@ -197,7 +196,8 @@ void galileo_pcps_8ms_acquisition_cc::set_state(int state)
|
||||
d_test_statistics = 0.0;
|
||||
}
|
||||
else if (d_state == 0)
|
||||
{}
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(ERROR) << "State can only be set to 0 or 1";
|
||||
@ -205,7 +205,6 @@ void galileo_pcps_8ms_acquisition_cc::set_state(int state)
|
||||
}
|
||||
|
||||
|
||||
|
||||
int galileo_pcps_8ms_acquisition_cc::general_work(int noutput_items,
|
||||
gr_vector_int &ninput_items, gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items __attribute__((unused)))
|
||||
|
@ -65,8 +65,8 @@ pcps_acquisition::pcps_acquisition(
|
||||
int samples_per_ms, int samples_per_code,
|
||||
bool bit_transition_flag, bool use_CFAR_algorithm_flag,
|
||||
bool dump, bool blocking,
|
||||
std::string dump_filename, size_t it_size) :
|
||||
gr::block("pcps_acquisition",
|
||||
std::string dump_filename,
|
||||
size_t it_size) : gr::block("pcps_acquisition",
|
||||
gr::io_signature::make(1, 1, it_size * sampled_ms * samples_per_ms * (bit_transition_flag ? 2 : 1)),
|
||||
gr::io_signature::make(0, 0, it_size * sampled_ms * samples_per_ms * (bit_transition_flag ? 2 : 1)))
|
||||
{
|
||||
@ -95,8 +95,14 @@ pcps_acquisition::pcps_acquisition(
|
||||
d_code_phase = 0;
|
||||
d_test_statistics = 0.0;
|
||||
d_channel = 0;
|
||||
if(it_size == sizeof(gr_complex)) { d_cshort = false; }
|
||||
else { d_cshort = true; }
|
||||
if (it_size == sizeof(gr_complex))
|
||||
{
|
||||
d_cshort = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
d_cshort = true;
|
||||
}
|
||||
|
||||
// COD:
|
||||
// Experimenting with the overlap/save technique for handling bit trannsitions
|
||||
@ -158,7 +164,10 @@ pcps_acquisition::~pcps_acquisition()
|
||||
delete d_ifft;
|
||||
delete d_fft_if;
|
||||
volk_gnsssdr_free(d_data_buffer);
|
||||
if(d_cshort) { volk_gnsssdr_free(d_data_buffer_sc); }
|
||||
if (d_cshort)
|
||||
{
|
||||
volk_gnsssdr_free(d_data_buffer_sc);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -278,7 +287,8 @@ void pcps_acquisition::set_state(int state)
|
||||
d_active = true;
|
||||
}
|
||||
else if (d_state == 0)
|
||||
{}
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(ERROR) << "State can only be set to 0 or 1";
|
||||
@ -366,8 +376,14 @@ int pcps_acquisition::general_work(int noutput_items __attribute__((unused)),
|
||||
case 1:
|
||||
{
|
||||
// Copy the data to the core and let it know that new data is available
|
||||
if(d_cshort) { memcpy(d_data_buffer_sc, input_items[0], d_fft_size * sizeof(lv_16sc_t)); }
|
||||
else { memcpy(d_data_buffer, input_items[0], d_fft_size * sizeof(gr_complex)); }
|
||||
if (d_cshort)
|
||||
{
|
||||
memcpy(d_data_buffer_sc, input_items[0], d_fft_size * sizeof(lv_16sc_t));
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(d_data_buffer, input_items[0], d_fft_size * sizeof(gr_complex));
|
||||
}
|
||||
if (d_blocking)
|
||||
{
|
||||
lk.unlock();
|
||||
@ -397,7 +413,10 @@ void pcps_acquisition::acquisition_core( unsigned long int samp_count )
|
||||
float magt = 0.0;
|
||||
const gr_complex* in = d_data_buffer; //Get the input samples pointer
|
||||
int effective_fft_size = (d_bit_transition_flag ? d_fft_size / 2 : d_fft_size);
|
||||
if(d_cshort) { volk_gnsssdr_16ic_convert_32fc(d_data_buffer, d_data_buffer_sc, d_fft_size); }
|
||||
if (d_cshort)
|
||||
{
|
||||
volk_gnsssdr_16ic_convert_32fc(d_data_buffer, d_data_buffer_sc, d_fft_size);
|
||||
}
|
||||
float fft_normalization_factor = static_cast<float>(d_fft_size) * static_cast<float>(d_fft_size);
|
||||
|
||||
d_input_power = 0.0;
|
||||
|
@ -242,7 +242,6 @@ public:
|
||||
int general_work(int noutput_items, gr_vector_int& ninput_items,
|
||||
gr_vector_const_void_star& input_items,
|
||||
gr_vector_void_star& output_items);
|
||||
|
||||
};
|
||||
|
||||
#endif /* GNSS_SDR_PCPS_ACQUISITION_H_*/
|
||||
|
@ -49,7 +49,6 @@ pcps_acquisition_fine_doppler_cc_sptr pcps_make_acquisition_fine_doppler_cc(
|
||||
long fs_in, int samples_per_ms, bool dump,
|
||||
std::string dump_filename)
|
||||
{
|
||||
|
||||
return pcps_acquisition_fine_doppler_cc_sptr(
|
||||
new pcps_acquisition_fine_doppler_cc(max_dwells, sampled_ms, doppler_max, doppler_min, freq,
|
||||
fs_in, samples_per_ms, dump, dump_filename));
|
||||
@ -59,8 +58,7 @@ pcps_acquisition_fine_doppler_cc_sptr pcps_make_acquisition_fine_doppler_cc(
|
||||
pcps_acquisition_fine_doppler_cc::pcps_acquisition_fine_doppler_cc(
|
||||
int max_dwells, unsigned int sampled_ms, int doppler_max, int doppler_min, long freq,
|
||||
long fs_in, int samples_per_ms, bool dump,
|
||||
std::string dump_filename) :
|
||||
gr::block("pcps_acquisition_fine_doppler_cc",
|
||||
std::string dump_filename) : gr::block("pcps_acquisition_fine_doppler_cc",
|
||||
gr::io_signature::make(1, 1, sizeof(gr_complex)),
|
||||
gr::io_signature::make(0, 0, sizeof(gr_complex)))
|
||||
{
|
||||
@ -259,8 +257,7 @@ double pcps_acquisition_fine_doppler_cc::search_maximum()
|
||||
filename << "../data/test_statistics_" << d_gnss_synchro->System
|
||||
<< "_" << d_gnss_synchro->Signal << "_sat_"
|
||||
<< d_gnss_synchro->PRN << "_doppler_" << d_gnss_synchro->Acq_doppler_hz << ".dat";
|
||||
d_dump_file.open(filename.str().c_str(), std::ios::out
|
||||
| std::ios::binary);
|
||||
d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary);
|
||||
d_dump_file.write(reinterpret_cast<char *>(d_grid_data[index_doppler]), n); //write directly |abs(x)|^2 in this Doppler bin?
|
||||
d_dump_file.close();
|
||||
}
|
||||
|
@ -56,12 +56,10 @@ pcps_assisted_acquisition_cc_sptr pcps_make_assisted_acquisition_cc(
|
||||
}
|
||||
|
||||
|
||||
|
||||
pcps_assisted_acquisition_cc::pcps_assisted_acquisition_cc(
|
||||
int max_dwells, unsigned int sampled_ms, int doppler_max, int doppler_min, long freq,
|
||||
long fs_in, int samples_per_ms, bool dump,
|
||||
std::string dump_filename) :
|
||||
gr::block("pcps_assisted_acquisition_cc",
|
||||
std::string dump_filename) : gr::block("pcps_assisted_acquisition_cc",
|
||||
gr::io_signature::make(1, 1, sizeof(gr_complex)),
|
||||
gr::io_signature::make(0, 0, sizeof(gr_complex)))
|
||||
{
|
||||
@ -111,14 +109,12 @@ pcps_assisted_acquisition_cc::pcps_assisted_acquisition_cc(
|
||||
}
|
||||
|
||||
|
||||
|
||||
void pcps_assisted_acquisition_cc::set_doppler_step(unsigned int doppler_step)
|
||||
{
|
||||
d_doppler_step = doppler_step;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void pcps_assisted_acquisition_cc::free_grid_memory()
|
||||
{
|
||||
for (int i = 0; i < d_num_doppler_points; i++)
|
||||
@ -130,7 +126,6 @@ void pcps_assisted_acquisition_cc::free_grid_memory()
|
||||
}
|
||||
|
||||
|
||||
|
||||
pcps_assisted_acquisition_cc::~pcps_assisted_acquisition_cc()
|
||||
{
|
||||
volk_gnsssdr_free(d_carrier);
|
||||
@ -144,14 +139,12 @@ pcps_assisted_acquisition_cc::~pcps_assisted_acquisition_cc()
|
||||
}
|
||||
|
||||
|
||||
|
||||
void pcps_assisted_acquisition_cc::set_local_code(std::complex<float> *code)
|
||||
{
|
||||
memcpy(d_fft_if->get_inbuf(), code, sizeof(gr_complex) * d_fft_size);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void pcps_assisted_acquisition_cc::init()
|
||||
{
|
||||
d_gnss_synchro->Flag_valid_acquisition = false;
|
||||
@ -172,7 +165,6 @@ void pcps_assisted_acquisition_cc::init()
|
||||
}
|
||||
|
||||
|
||||
|
||||
void pcps_assisted_acquisition_cc::forecast(int noutput_items,
|
||||
gr_vector_int &ninput_items_required)
|
||||
{
|
||||
@ -183,7 +175,6 @@ void pcps_assisted_acquisition_cc::forecast (int noutput_items,
|
||||
}
|
||||
|
||||
|
||||
|
||||
void pcps_assisted_acquisition_cc::get_assistance()
|
||||
{
|
||||
Gps_Acq_Assist gps_acq_assisistance;
|
||||
@ -212,7 +203,6 @@ void pcps_assisted_acquisition_cc::get_assistance()
|
||||
}
|
||||
|
||||
|
||||
|
||||
void pcps_assisted_acquisition_cc::reset_grid()
|
||||
{
|
||||
d_well_count = 0;
|
||||
@ -226,7 +216,6 @@ void pcps_assisted_acquisition_cc::reset_grid()
|
||||
}
|
||||
|
||||
|
||||
|
||||
void pcps_assisted_acquisition_cc::redefine_grid()
|
||||
{
|
||||
if (this->d_disable_assist == true)
|
||||
@ -261,7 +250,6 @@ void pcps_assisted_acquisition_cc::redefine_grid()
|
||||
}
|
||||
|
||||
|
||||
|
||||
double pcps_assisted_acquisition_cc::search_maximum()
|
||||
{
|
||||
float magt = 0.0;
|
||||
@ -311,7 +299,6 @@ double pcps_assisted_acquisition_cc::search_maximum()
|
||||
}
|
||||
|
||||
|
||||
|
||||
float pcps_assisted_acquisition_cc::estimate_input_power(gr_vector_const_void_star &input_items)
|
||||
{
|
||||
const gr_complex *in = reinterpret_cast<const gr_complex *>(input_items[0]); //Get the input samples pointer
|
||||
@ -328,7 +315,6 @@ float pcps_assisted_acquisition_cc::estimate_input_power(gr_vector_const_void_st
|
||||
}
|
||||
|
||||
|
||||
|
||||
int pcps_assisted_acquisition_cc::compute_and_accumulate_grid(gr_vector_const_void_star &input_items)
|
||||
{
|
||||
// initialize acquisition algorithm
|
||||
@ -370,7 +356,6 @@ int pcps_assisted_acquisition_cc::compute_and_accumulate_grid(gr_vector_const_vo
|
||||
}
|
||||
|
||||
|
||||
|
||||
int pcps_assisted_acquisition_cc::general_work(int noutput_items,
|
||||
gr_vector_int &ninput_items, gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items __attribute__((unused)))
|
||||
|
@ -61,8 +61,8 @@ pcps_cccwsr_acquisition_cc::pcps_cccwsr_acquisition_cc(
|
||||
unsigned int sampled_ms, unsigned int max_dwells,
|
||||
unsigned int doppler_max, long freq, long fs_in,
|
||||
int samples_per_ms, int samples_per_code,
|
||||
bool dump, std::string dump_filename) :
|
||||
gr::block("pcps_cccwsr_acquisition_cc",
|
||||
bool dump,
|
||||
std::string dump_filename) : gr::block("pcps_cccwsr_acquisition_cc",
|
||||
gr::io_signature::make(1, 1, sizeof(gr_complex) * sampled_ms * samples_per_ms),
|
||||
gr::io_signature::make(0, 0, sizeof(gr_complex) * sampled_ms * samples_per_ms))
|
||||
{
|
||||
@ -211,7 +211,8 @@ void pcps_cccwsr_acquisition_cc::set_state(int state)
|
||||
d_test_statistics = 0.0;
|
||||
}
|
||||
else if (d_state == 0)
|
||||
{}
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(ERROR) << "State can only be set to 0 or 1";
|
||||
@ -223,7 +224,6 @@ int pcps_cccwsr_acquisition_cc::general_work(int noutput_items,
|
||||
gr_vector_int &ninput_items, gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items __attribute__((unused)))
|
||||
{
|
||||
|
||||
int acquisition_message = -1; //0=STOP_CHANNEL 1=ACQ_SUCCEES 2=ACQ_FAIL
|
||||
|
||||
switch (d_state)
|
||||
|
@ -58,8 +58,8 @@
|
||||
#include <volk/volk.h>
|
||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||
#include "control_message_factory.h"
|
||||
#include "fft_base_kernels.h"
|
||||
#include "fft_internal.h"
|
||||
#include "opencl/fft_base_kernels.h"
|
||||
#include "opencl/fft_internal.h"
|
||||
#include "GPS_L1_CA.h" //GPS_TWO_PI
|
||||
|
||||
|
||||
@ -73,7 +73,6 @@ pcps_opencl_acquisition_cc_sptr pcps_make_opencl_acquisition_cc(
|
||||
bool dump,
|
||||
std::string dump_filename)
|
||||
{
|
||||
|
||||
return pcps_opencl_acquisition_cc_sptr(
|
||||
new pcps_opencl_acquisition_cc(sampled_ms, max_dwells, doppler_max, freq, fs_in, samples_per_ms,
|
||||
samples_per_code, bit_transition_flag, dump, dump_filename));
|
||||
@ -85,8 +84,7 @@ pcps_opencl_acquisition_cc::pcps_opencl_acquisition_cc(
|
||||
int samples_per_ms, int samples_per_code,
|
||||
bool bit_transition_flag,
|
||||
bool dump,
|
||||
std::string dump_filename) :
|
||||
gr::block("pcps_opencl_acquisition_cc",
|
||||
std::string dump_filename) : gr::block("pcps_opencl_acquisition_cc",
|
||||
gr::io_signature::make(1, 1, sizeof(gr_complex) * sampled_ms * samples_per_ms),
|
||||
gr::io_signature::make(0, 0, sizeof(gr_complex) * sampled_ms * samples_per_ms))
|
||||
{
|
||||
@ -140,11 +138,9 @@ pcps_opencl_acquisition_cc::pcps_opencl_acquisition_cc(
|
||||
// For dumping samples into a file
|
||||
d_dump = dump;
|
||||
d_dump_filename = dump_filename;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
pcps_opencl_acquisition_cc::~pcps_opencl_acquisition_cc()
|
||||
{
|
||||
if (d_num_doppler_bins > 0)
|
||||
@ -194,7 +190,6 @@ pcps_opencl_acquisition_cc::~pcps_opencl_acquisition_cc()
|
||||
}
|
||||
|
||||
|
||||
|
||||
int pcps_opencl_acquisition_cc::init_opencl_environment(std::string kernel_filename)
|
||||
{
|
||||
//get all platforms (drivers)
|
||||
@ -286,7 +281,6 @@ int pcps_opencl_acquisition_cc::init_opencl_environment(std::string kernel_filen
|
||||
}
|
||||
|
||||
|
||||
|
||||
void pcps_opencl_acquisition_cc::init()
|
||||
{
|
||||
d_gnss_synchro->Flag_valid_acquisition = false;
|
||||
@ -356,8 +350,7 @@ void pcps_opencl_acquisition_cc::set_local_code(std::complex<float> * code)
|
||||
sizeof(gr_complex) * (d_fft_size_pow2 - 2 * d_fft_size),
|
||||
d_zero_vector);
|
||||
|
||||
d_cl_queue->enqueueWriteBuffer(*d_cl_buffer_2, CL_TRUE, sizeof(gr_complex)
|
||||
*(d_fft_size_pow2 - d_fft_size),
|
||||
d_cl_queue->enqueueWriteBuffer(*d_cl_buffer_2, CL_TRUE, sizeof(gr_complex) * (d_fft_size_pow2 - d_fft_size),
|
||||
sizeof(gr_complex) * d_fft_size, code);
|
||||
|
||||
clFFT_ExecuteInterleaved((*d_cl_queue)(), d_cl_fft_plan, d_cl_fft_batch_size,
|
||||
@ -686,7 +679,8 @@ void pcps_opencl_acquisition_cc::set_state(int state)
|
||||
d_sample_counter_buffer.clear();
|
||||
}
|
||||
else if (d_state == 0)
|
||||
{}
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(ERROR) << "State can only be set to 0 or 1";
|
||||
|
@ -57,11 +57,11 @@
|
||||
#include <gnuradio/block.h>
|
||||
#include <gnuradio/gr_complex.h>
|
||||
#include <gnuradio/fft/fft.h>
|
||||
#include "fft_internal.h"
|
||||
#include "opencl/fft_internal.h"
|
||||
#include "gnss_synchro.h"
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include "cl.hpp"
|
||||
#include "opencl/cl.hpp"
|
||||
#else
|
||||
#include <CL/cl.hpp>
|
||||
#endif
|
||||
|
@ -67,8 +67,8 @@ pcps_quicksync_acquisition_cc::pcps_quicksync_acquisition_cc(
|
||||
unsigned int doppler_max, long freq, long fs_in,
|
||||
int samples_per_ms, int samples_per_code,
|
||||
bool bit_transition_flag,
|
||||
bool dump, std::string dump_filename):
|
||||
gr::block("pcps_quicksync_acquisition_cc",
|
||||
bool dump,
|
||||
std::string dump_filename) : gr::block("pcps_quicksync_acquisition_cc",
|
||||
gr::io_signature::make(1, 1, (sizeof(gr_complex) * sampled_ms * samples_per_ms)),
|
||||
gr::io_signature::make(0, 0, (sizeof(gr_complex) * sampled_ms * samples_per_ms)))
|
||||
{
|
||||
@ -187,7 +187,6 @@ void pcps_quicksync_acquisition_cc::set_local_code(std::complex<float>* code)
|
||||
|
||||
//Conjugate the local code
|
||||
volk_32fc_conjugate_32fc(d_fft_codes, d_fft_if->get_outbuf(), d_fft_size);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -246,7 +245,8 @@ void pcps_quicksync_acquisition_cc::set_state(int state)
|
||||
d_active = 1;
|
||||
}
|
||||
else if (d_state == 0)
|
||||
{}
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(ERROR) << "State can only be set to 0 or 1";
|
||||
@ -432,7 +432,6 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items,
|
||||
|
||||
for (int i = 0; i < static_cast<int>(d_folding_factor); i++)
|
||||
{
|
||||
|
||||
/*Copy a signal of 1 code length into suggested buffer.
|
||||
The copied signal must have doppler effect corrected*/
|
||||
memcpy(in_1code, &in_temp[d_possible_delay[i]],
|
||||
@ -449,7 +448,6 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items,
|
||||
{
|
||||
complex_acumulator[i] += (corr_output[j]);
|
||||
}
|
||||
|
||||
}
|
||||
/*Obtain maximun value of correlation given the possible delay selected */
|
||||
volk_32fc_magnitude_squared_32f(d_corr_output_f, complex_acumulator, d_folding_factor);
|
||||
|
@ -76,8 +76,8 @@ pcps_tong_acquisition_cc::pcps_tong_acquisition_cc(
|
||||
long freq, long fs_in, int samples_per_ms,
|
||||
int samples_per_code, unsigned int tong_init_val,
|
||||
unsigned int tong_max_val, unsigned int tong_max_dwells,
|
||||
bool dump, std::string dump_filename) :
|
||||
gr::block("pcps_tong_acquisition_cc",
|
||||
bool dump,
|
||||
std::string dump_filename) : gr::block("pcps_tong_acquisition_cc",
|
||||
gr::io_signature::make(1, 1, sizeof(gr_complex) * sampled_ms * samples_per_ms),
|
||||
gr::io_signature::make(0, 0, sizeof(gr_complex) * sampled_ms * samples_per_ms))
|
||||
{
|
||||
@ -228,7 +228,8 @@ void pcps_tong_acquisition_cc::set_state(int state)
|
||||
}
|
||||
}
|
||||
else if (d_state == 0)
|
||||
{}
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(ERROR) << "State can only be set to 0 or 1";
|
||||
|
@ -212,4 +212,3 @@ void Channel::start_acquisition()
|
||||
}
|
||||
DLOG(INFO) << "Channel start_acquisition()";
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,6 @@ class TelemetryDecoderInterface;
|
||||
*/
|
||||
class Channel : public ChannelInterface
|
||||
{
|
||||
|
||||
public:
|
||||
//! Constructor
|
||||
Channel(ConfigurationInterface* configuration, unsigned int channel,
|
||||
|
@ -34,7 +34,6 @@
|
||||
#include <glog/logging.h>
|
||||
|
||||
|
||||
|
||||
ChannelFsm::ChannelFsm()
|
||||
{
|
||||
acq_ = nullptr;
|
||||
@ -44,9 +43,7 @@ ChannelFsm::ChannelFsm()
|
||||
}
|
||||
|
||||
|
||||
|
||||
ChannelFsm::ChannelFsm(std::shared_ptr<AcquisitionInterface> acquisition) :
|
||||
acq_(acquisition)
|
||||
ChannelFsm::ChannelFsm(std::shared_ptr<AcquisitionInterface> acquisition) : acq_(acquisition)
|
||||
{
|
||||
trk_ = nullptr;
|
||||
channel_ = 0;
|
||||
|
@ -62,7 +62,6 @@ public:
|
||||
bool Event_failed_tracking_standby();
|
||||
|
||||
private:
|
||||
|
||||
void start_acquisition();
|
||||
void start_tracking();
|
||||
void request_satellite();
|
||||
|
@ -82,8 +82,7 @@ void channel_msg_receiver_cc::msg_handler_events(pmt::pmt_t msg)
|
||||
}
|
||||
|
||||
|
||||
channel_msg_receiver_cc::channel_msg_receiver_cc(std::shared_ptr<ChannelFsm> channel_fsm, bool repeat) :
|
||||
gr::block("channel_msg_receiver_cc", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0))
|
||||
channel_msg_receiver_cc::channel_msg_receiver_cc(std::shared_ptr<ChannelFsm> channel_fsm, bool repeat) : gr::block("channel_msg_receiver_cc", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0))
|
||||
{
|
||||
this->message_port_register_in(pmt::mp("events"));
|
||||
this->set_msg_handler(pmt::mp("events"), boost::bind(&channel_msg_receiver_cc::msg_handler_events, this, _1));
|
||||
@ -93,5 +92,4 @@ channel_msg_receiver_cc::channel_msg_receiver_cc(std::shared_ptr<ChannelFsm> cha
|
||||
}
|
||||
|
||||
|
||||
channel_msg_receiver_cc::~channel_msg_receiver_cc()
|
||||
{}
|
||||
channel_msg_receiver_cc::~channel_msg_receiver_cc() {}
|
||||
|
@ -54,7 +54,6 @@ private:
|
||||
|
||||
public:
|
||||
~channel_msg_receiver_cc(); //!< Default destructor
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -38,18 +38,21 @@ using google::LogMessage;
|
||||
// Constructor
|
||||
ArraySignalConditioner::ArraySignalConditioner(ConfigurationInterface *configuration,
|
||||
std::shared_ptr<GNSSBlockInterface> data_type_adapt, std::shared_ptr<GNSSBlockInterface> in_filt,
|
||||
std::shared_ptr<GNSSBlockInterface> res, std::string role, std::string implementation) :
|
||||
data_type_adapt_(data_type_adapt),
|
||||
in_filt_(in_filt), res_(res), role_(role), implementation_(implementation)
|
||||
std::shared_ptr<GNSSBlockInterface> res, std::string role, std::string implementation) : data_type_adapt_(data_type_adapt),
|
||||
in_filt_(in_filt),
|
||||
res_(res),
|
||||
role_(role),
|
||||
implementation_(implementation)
|
||||
{
|
||||
connected_ = false;
|
||||
if(configuration){ };
|
||||
if (configuration)
|
||||
{
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
// Destructor
|
||||
ArraySignalConditioner::~ArraySignalConditioner()
|
||||
{}
|
||||
ArraySignalConditioner::~ArraySignalConditioner() {}
|
||||
|
||||
|
||||
void ArraySignalConditioner::connect(gr::top_block_sptr top_block)
|
||||
@ -76,7 +79,6 @@ void ArraySignalConditioner::connect(gr::top_block_sptr top_block)
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ArraySignalConditioner::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (!connected_)
|
||||
@ -105,9 +107,7 @@ gr::basic_block_sptr ArraySignalConditioner::get_left_block()
|
||||
}
|
||||
|
||||
|
||||
|
||||
gr::basic_block_sptr ArraySignalConditioner::get_right_block()
|
||||
{
|
||||
return res_->get_right_block();
|
||||
}
|
||||
|
||||
|
@ -38,18 +38,21 @@ using google::LogMessage;
|
||||
// Constructor
|
||||
SignalConditioner::SignalConditioner(ConfigurationInterface *configuration,
|
||||
std::shared_ptr<GNSSBlockInterface> data_type_adapt, std::shared_ptr<GNSSBlockInterface> in_filt,
|
||||
std::shared_ptr<GNSSBlockInterface> res, std::string role, std::string implementation) :
|
||||
data_type_adapt_(data_type_adapt),
|
||||
in_filt_(in_filt), res_(res), role_(role), implementation_(implementation)
|
||||
std::shared_ptr<GNSSBlockInterface> res, std::string role, std::string implementation) : data_type_adapt_(data_type_adapt),
|
||||
in_filt_(in_filt),
|
||||
res_(res),
|
||||
role_(role),
|
||||
implementation_(implementation)
|
||||
{
|
||||
connected_ = false;
|
||||
if(configuration){ };
|
||||
if (configuration)
|
||||
{
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
// Destructor
|
||||
SignalConditioner::~SignalConditioner()
|
||||
{}
|
||||
SignalConditioner::~SignalConditioner() {}
|
||||
|
||||
|
||||
void SignalConditioner::connect(gr::top_block_sptr top_block)
|
||||
@ -102,4 +105,3 @@ gr::basic_block_sptr SignalConditioner::get_right_block()
|
||||
{
|
||||
return res_->get_right_block();
|
||||
}
|
||||
|
||||
|
@ -36,9 +36,7 @@
|
||||
using google::LogMessage;
|
||||
|
||||
ByteToShort::ByteToShort(ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) :
|
||||
config_(configuration), role_(role), in_streams_(in_streams),
|
||||
out_streams_(out_streams)
|
||||
unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
std::string default_input_item_type = "byte";
|
||||
std::string default_output_item_type = "short";
|
||||
@ -66,7 +64,8 @@ ByteToShort::ByteToShort(ConfigurationInterface* configuration, std::string role
|
||||
|
||||
|
||||
ByteToShort::~ByteToShort()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void ByteToShort::connect(gr::top_block_sptr top_block)
|
||||
@ -91,16 +90,13 @@ void ByteToShort::disconnect(gr::top_block_sptr top_block)
|
||||
}
|
||||
|
||||
|
||||
|
||||
gr::basic_block_sptr ByteToShort::get_left_block()
|
||||
{
|
||||
return gr_char_to_short_;
|
||||
}
|
||||
|
||||
|
||||
|
||||
gr::basic_block_sptr ByteToShort::get_right_block()
|
||||
{
|
||||
return gr_char_to_short_;
|
||||
}
|
||||
|
||||
|
@ -37,9 +37,7 @@
|
||||
using google::LogMessage;
|
||||
|
||||
IbyteToCbyte::IbyteToCbyte(ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) :
|
||||
config_(configuration), role_(role), in_streams_(in_streams),
|
||||
out_streams_(out_streams)
|
||||
unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
std::string default_input_item_type = "byte";
|
||||
std::string default_output_item_type = "lv_8sc_t";
|
||||
@ -72,7 +70,8 @@ IbyteToCbyte::IbyteToCbyte(ConfigurationInterface* configuration, std::string ro
|
||||
|
||||
|
||||
IbyteToCbyte::~IbyteToCbyte()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void IbyteToCbyte::connect(gr::top_block_sptr top_block)
|
||||
|
@ -35,9 +35,7 @@
|
||||
using google::LogMessage;
|
||||
|
||||
IbyteToComplex::IbyteToComplex(ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) :
|
||||
config_(configuration), role_(role), in_streams_(in_streams),
|
||||
out_streams_(out_streams)
|
||||
unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
std::string default_input_item_type = "byte";
|
||||
std::string default_output_item_type = "gr_complex";
|
||||
@ -70,7 +68,8 @@ IbyteToComplex::IbyteToComplex(ConfigurationInterface* configuration, std::strin
|
||||
|
||||
|
||||
IbyteToComplex::~IbyteToComplex()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void IbyteToComplex::connect(gr::top_block_sptr top_block)
|
||||
|
@ -38,9 +38,7 @@
|
||||
using google::LogMessage;
|
||||
|
||||
IbyteToCshort::IbyteToCshort(ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) :
|
||||
config_(configuration), role_(role), in_streams_(in_streams),
|
||||
out_streams_(out_streams)
|
||||
unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
std::string default_input_item_type = "byte";
|
||||
std::string default_output_item_type = "cshort";
|
||||
@ -73,7 +71,8 @@ IbyteToCshort::IbyteToCshort(ConfigurationInterface* configuration, std::string
|
||||
|
||||
|
||||
IbyteToCshort::~IbyteToCshort()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void IbyteToCshort::connect(gr::top_block_sptr top_block)
|
||||
|
@ -35,9 +35,7 @@
|
||||
using google::LogMessage;
|
||||
|
||||
IshortToComplex::IshortToComplex(ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) :
|
||||
config_(configuration), role_(role), in_streams_(in_streams),
|
||||
out_streams_(out_streams)
|
||||
unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
std::string default_input_item_type = "short";
|
||||
std::string default_output_item_type = "gr_complex";
|
||||
@ -70,7 +68,8 @@ IshortToComplex::IshortToComplex(ConfigurationInterface* configuration, std::str
|
||||
|
||||
|
||||
IshortToComplex::~IshortToComplex()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void IshortToComplex::connect(gr::top_block_sptr top_block)
|
||||
|
@ -37,9 +37,7 @@
|
||||
using google::LogMessage;
|
||||
|
||||
IshortToCshort::IshortToCshort(ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) :
|
||||
config_(configuration), role_(role), in_streams_(in_streams),
|
||||
out_streams_(out_streams)
|
||||
unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
std::string default_input_item_type = "short";
|
||||
std::string default_output_item_type = "cshort";
|
||||
@ -72,7 +70,8 @@ IshortToCshort::IshortToCshort(ConfigurationInterface* configuration, std::strin
|
||||
|
||||
|
||||
IshortToCshort::~IshortToCshort()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void IshortToCshort::connect(gr::top_block_sptr top_block)
|
||||
|
@ -40,7 +40,6 @@ interleaved_byte_to_complex_byte_sptr make_interleaved_byte_to_complex_byte()
|
||||
}
|
||||
|
||||
|
||||
|
||||
interleaved_byte_to_complex_byte::interleaved_byte_to_complex_byte() : sync_decimator("interleaved_byte_to_complex_byte",
|
||||
gr::io_signature::make(1, 1, sizeof(int8_t)),
|
||||
gr::io_signature::make(1, 1, sizeof(lv_8sc_t)), // lv_8sc_t is a Volk's typedef for std::complex<signed char>
|
||||
|
@ -49,6 +49,7 @@ class interleaved_byte_to_complex_byte : public gr::sync_decimator
|
||||
{
|
||||
private:
|
||||
friend interleaved_byte_to_complex_byte_sptr make_interleaved_byte_to_complex_byte();
|
||||
|
||||
public:
|
||||
interleaved_byte_to_complex_byte();
|
||||
|
||||
|
@ -40,7 +40,6 @@ interleaved_byte_to_complex_short_sptr make_interleaved_byte_to_complex_short()
|
||||
}
|
||||
|
||||
|
||||
|
||||
interleaved_byte_to_complex_short::interleaved_byte_to_complex_short() : sync_decimator("interleaved_byte_to_complex_short",
|
||||
gr::io_signature::make(1, 1, sizeof(int8_t)),
|
||||
gr::io_signature::make(1, 1, sizeof(lv_16sc_t)), // lv_16sc_t is a Volk's typedef for std::complex<short int>
|
||||
|
@ -48,6 +48,7 @@ class interleaved_byte_to_complex_short : public gr::sync_decimator
|
||||
{
|
||||
private:
|
||||
friend interleaved_byte_to_complex_short_sptr make_interleaved_byte_to_complex_short();
|
||||
|
||||
public:
|
||||
interleaved_byte_to_complex_short();
|
||||
|
||||
|
@ -40,7 +40,6 @@ interleaved_short_to_complex_short_sptr make_interleaved_short_to_complex_short(
|
||||
}
|
||||
|
||||
|
||||
|
||||
interleaved_short_to_complex_short::interleaved_short_to_complex_short() : sync_decimator("interleaved_short_to_complex_short",
|
||||
gr::io_signature::make(1, 1, sizeof(int16_t)),
|
||||
gr::io_signature::make(1, 1, sizeof(lv_16sc_t)), // lv_16sc_t is a Volk's typedef for std::complex<short int>
|
||||
|
@ -48,6 +48,7 @@ class interleaved_short_to_complex_short : public gr::sync_decimator
|
||||
{
|
||||
private:
|
||||
friend interleaved_short_to_complex_short_sptr make_interleaved_short_to_complex_short();
|
||||
|
||||
public:
|
||||
interleaved_short_to_complex_short();
|
||||
|
||||
|
@ -39,8 +39,7 @@ using google::LogMessage;
|
||||
|
||||
BeamformerFilter::BeamformerFilter(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_stream, unsigned int out_stream) :
|
||||
role_(role), in_stream_(in_stream), out_stream_(out_stream)
|
||||
unsigned int in_stream, unsigned int out_stream) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
|
||||
{
|
||||
std::string default_item_type = "gr_complex";
|
||||
std::string default_dump_file = "./data/input_filter.dat";
|
||||
@ -55,7 +54,6 @@ BeamformerFilter::BeamformerFilter(
|
||||
beamformer_ = make_beamformer();
|
||||
DLOG(INFO) << "Item size " << item_size_;
|
||||
DLOG(INFO) << "resampler(" << beamformer_->unique_id() << ")";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -76,7 +74,6 @@ BeamformerFilter::BeamformerFilter(
|
||||
BeamformerFilter::~BeamformerFilter() {}
|
||||
|
||||
|
||||
|
||||
void BeamformerFilter::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (dump_)
|
||||
|
@ -40,14 +40,11 @@
|
||||
using google::LogMessage;
|
||||
|
||||
FirFilter::FirFilter(ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) :
|
||||
config_(configuration), role_(role), in_streams_(in_streams),
|
||||
out_streams_(out_streams)
|
||||
unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
size_t item_size;
|
||||
(*this).init();
|
||||
if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
item_size = sizeof(gr_complex);
|
||||
fir_filter_ccf_ = gr::filter::fir_filter_ccf::make(1, taps_);
|
||||
@ -58,8 +55,7 @@ FirFilter::FirFilter(ConfigurationInterface* configuration, std::string role,
|
||||
file_sink_ = gr::blocks::file_sink::make(item_size, dump_filename_.c_str());
|
||||
}
|
||||
}
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0)
|
||||
&& (output_item_type_.compare("cshort") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0) && (output_item_type_.compare("cshort") == 0))
|
||||
{
|
||||
item_size = sizeof(lv_16sc_t);
|
||||
cshort_to_float_x2_ = make_cshort_to_float_x2();
|
||||
@ -76,8 +72,7 @@ FirFilter::FirFilter(ConfigurationInterface* configuration, std::string role,
|
||||
file_sink_ = gr::blocks::file_sink::make(item_size, dump_filename_.c_str());
|
||||
}
|
||||
}
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
item_size = sizeof(gr_complex);
|
||||
cshort_to_float_x2_ = make_cshort_to_float_x2();
|
||||
@ -93,8 +88,7 @@ FirFilter::FirFilter(ConfigurationInterface* configuration, std::string role,
|
||||
}
|
||||
}
|
||||
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
item_size = sizeof(gr_complex);
|
||||
cbyte_to_float_x2_ = make_complex_byte_to_float_x2();
|
||||
@ -112,8 +106,7 @@ FirFilter::FirFilter(ConfigurationInterface* configuration, std::string role,
|
||||
file_sink_ = gr::blocks::file_sink::make(item_size, dump_filename_.c_str());
|
||||
}
|
||||
}
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0)
|
||||
&& (output_item_type_.compare("cbyte") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0) && (output_item_type_.compare("cbyte") == 0))
|
||||
{
|
||||
item_size = sizeof(lv_8sc_t);
|
||||
cbyte_to_float_x2_ = make_complex_byte_to_float_x2();
|
||||
@ -141,16 +134,14 @@ FirFilter::FirFilter(ConfigurationInterface* configuration, std::string role,
|
||||
}
|
||||
|
||||
|
||||
|
||||
FirFilter::~FirFilter()
|
||||
{}
|
||||
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void FirFilter::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
if (dump_)
|
||||
{
|
||||
@ -161,8 +152,7 @@ void FirFilter::connect(gr::top_block_sptr top_block)
|
||||
DLOG(INFO) << "Nothing to connect internally";
|
||||
}
|
||||
}
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0)
|
||||
&& (output_item_type_.compare("cshort") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0) && (output_item_type_.compare("cshort") == 0))
|
||||
{
|
||||
top_block->connect(cshort_to_float_x2_, 0, fir_filter_fff_1_, 0);
|
||||
top_block->connect(cshort_to_float_x2_, 1, fir_filter_fff_2_, 0);
|
||||
@ -175,8 +165,7 @@ void FirFilter::connect(gr::top_block_sptr top_block)
|
||||
top_block->connect(short_x2_to_cshort_, 0, file_sink_, 0);
|
||||
}
|
||||
}
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
top_block->connect(cbyte_to_float_x2_, 0, fir_filter_fff_1_, 0);
|
||||
top_block->connect(cbyte_to_float_x2_, 1, fir_filter_fff_2_, 0);
|
||||
@ -187,8 +176,7 @@ void FirFilter::connect(gr::top_block_sptr top_block)
|
||||
top_block->connect(float_to_complex_, 0, file_sink_, 0);
|
||||
}
|
||||
}
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0)
|
||||
&& (output_item_type_.compare("cbyte") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0) && (output_item_type_.compare("cbyte") == 0))
|
||||
{
|
||||
top_block->connect(cbyte_to_float_x2_, 0, fir_filter_fff_1_, 0);
|
||||
top_block->connect(cbyte_to_float_x2_, 1, fir_filter_fff_2_, 0);
|
||||
@ -201,8 +189,7 @@ void FirFilter::connect(gr::top_block_sptr top_block)
|
||||
top_block->connect(char_x2_cbyte_, 0, file_sink_, 0);
|
||||
}
|
||||
}
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
top_block->connect(cshort_to_float_x2_, 0, fir_filter_fff_1_, 0);
|
||||
top_block->connect(cshort_to_float_x2_, 1, fir_filter_fff_2_, 0);
|
||||
@ -220,19 +207,16 @@ void FirFilter::connect(gr::top_block_sptr top_block)
|
||||
}
|
||||
|
||||
|
||||
|
||||
void FirFilter::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
if (dump_)
|
||||
{
|
||||
top_block->disconnect(fir_filter_ccf_, 0, file_sink_, 0);
|
||||
}
|
||||
}
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
top_block->disconnect(fir_filter_fff_2_, 0, float_to_complex_, 1);
|
||||
top_block->disconnect(fir_filter_fff_1_, 0, float_to_complex_, 0);
|
||||
@ -243,8 +227,7 @@ void FirFilter::disconnect(gr::top_block_sptr top_block)
|
||||
top_block->disconnect(float_to_complex_, 0, file_sink_, 0);
|
||||
}
|
||||
}
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0)
|
||||
&& (output_item_type_.compare("cshort") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0) && (output_item_type_.compare("cshort") == 0))
|
||||
{
|
||||
top_block->disconnect(cshort_to_float_x2_, 0, fir_filter_fff_1_, 0);
|
||||
top_block->disconnect(cshort_to_float_x2_, 1, fir_filter_fff_2_, 0);
|
||||
@ -257,8 +240,7 @@ void FirFilter::disconnect(gr::top_block_sptr top_block)
|
||||
top_block->disconnect(short_x2_to_cshort_, 0, file_sink_, 0);
|
||||
}
|
||||
}
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0)
|
||||
&& (output_item_type_.compare("cbyte") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0) && (output_item_type_.compare("cbyte") == 0))
|
||||
{
|
||||
top_block->disconnect(float_to_char_2_, 0, char_x2_cbyte_, 1);
|
||||
top_block->disconnect(float_to_char_1_, 0, char_x2_cbyte_, 0);
|
||||
@ -271,8 +253,7 @@ void FirFilter::disconnect(gr::top_block_sptr top_block)
|
||||
top_block->disconnect(char_x2_cbyte_, 0, file_sink_, 0);
|
||||
}
|
||||
}
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
top_block->disconnect(cshort_to_float_x2_, 0, fir_filter_fff_1_, 0);
|
||||
top_block->disconnect(cshort_to_float_x2_, 1, fir_filter_fff_2_, 0);
|
||||
@ -290,31 +271,25 @@ void FirFilter::disconnect(gr::top_block_sptr top_block)
|
||||
}
|
||||
|
||||
|
||||
|
||||
gr::basic_block_sptr FirFilter::get_left_block()
|
||||
{
|
||||
if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
return fir_filter_ccf_;
|
||||
}
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0)
|
||||
&& (output_item_type_.compare("cshort") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0) && (output_item_type_.compare("cshort") == 0))
|
||||
{
|
||||
return cshort_to_float_x2_;
|
||||
}
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
return cbyte_to_float_x2_;
|
||||
}
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0)
|
||||
&& (output_item_type_.compare("cbyte") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0) && (output_item_type_.compare("cbyte") == 0))
|
||||
{
|
||||
return cbyte_to_float_x2_;
|
||||
}
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
return cshort_to_float_x2_;
|
||||
}
|
||||
@ -326,31 +301,25 @@ gr::basic_block_sptr FirFilter::get_left_block()
|
||||
}
|
||||
|
||||
|
||||
|
||||
gr::basic_block_sptr FirFilter::get_right_block()
|
||||
{
|
||||
if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
return fir_filter_ccf_;
|
||||
}
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0)
|
||||
&& (output_item_type_.compare("cshort") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0) && (output_item_type_.compare("cshort") == 0))
|
||||
{
|
||||
return short_x2_to_cshort_;
|
||||
}
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
return float_to_complex_;
|
||||
}
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0)
|
||||
&& (output_item_type_.compare("cbyte") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cbyte") == 0) && (output_item_type_.compare("cbyte") == 0))
|
||||
{
|
||||
return char_x2_cbyte_;
|
||||
}
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("cshort") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
return float_to_complex_;
|
||||
}
|
||||
@ -362,7 +331,6 @@ gr::basic_block_sptr FirFilter::get_right_block()
|
||||
}
|
||||
|
||||
|
||||
|
||||
void FirFilter::init()
|
||||
{
|
||||
std::string default_input_item_type = "gr_complex";
|
||||
|
@ -41,9 +41,7 @@
|
||||
using google::LogMessage;
|
||||
|
||||
FreqXlatingFirFilter::FreqXlatingFirFilter(ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) :
|
||||
config_(configuration), role_(role), in_streams_(in_streams),
|
||||
out_streams_(out_streams)
|
||||
unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
size_t item_size;
|
||||
(*this).init();
|
||||
@ -51,32 +49,28 @@ FreqXlatingFirFilter::FreqXlatingFirFilter(ConfigurationInterface* configuration
|
||||
int default_decimation_factor = 1;
|
||||
decimation_factor = config_->property(role_ + ".decimation_factor", default_decimation_factor);
|
||||
|
||||
if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
item_size = sizeof(gr_complex); //output
|
||||
input_size_ = sizeof(gr_complex); //input
|
||||
freq_xlating_fir_filter_ccf_ = gr::filter::freq_xlating_fir_filter_ccf::make(decimation_factor, taps_, intermediate_freq_, sampling_freq_);
|
||||
DLOG(INFO) << "input_filter(" << freq_xlating_fir_filter_ccf_->unique_id() << ")";
|
||||
}
|
||||
else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("float") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("float") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
item_size = sizeof(gr_complex);
|
||||
input_size_ = sizeof(float); //input
|
||||
freq_xlating_fir_filter_fcf_ = gr::filter::freq_xlating_fir_filter_fcf::make(decimation_factor, taps_, intermediate_freq_, sampling_freq_);
|
||||
DLOG(INFO) << "input_filter(" << freq_xlating_fir_filter_fcf_->unique_id() << ")";
|
||||
}
|
||||
else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
item_size = sizeof(gr_complex);
|
||||
input_size_ = sizeof(int16_t); //input
|
||||
freq_xlating_fir_filter_scf_ = gr::filter::freq_xlating_fir_filter_scf::make(decimation_factor, taps_, intermediate_freq_, sampling_freq_);
|
||||
DLOG(INFO) << "input_filter(" << freq_xlating_fir_filter_scf_->unique_id() << ")";
|
||||
}
|
||||
else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0)
|
||||
&& (output_item_type_.compare("cshort") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0) && (output_item_type_.compare("cshort") == 0))
|
||||
{
|
||||
item_size = sizeof(lv_16sc_t);
|
||||
input_size_ = sizeof(int16_t); //input
|
||||
@ -87,8 +81,7 @@ FreqXlatingFirFilter::FreqXlatingFirFilter(ConfigurationInterface* configuration
|
||||
float_to_short_2_ = gr::blocks::float_to_short::make();
|
||||
short_x2_to_cshort_ = make_short_x2_to_cshort();
|
||||
}
|
||||
else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
item_size = sizeof(gr_complex);
|
||||
input_size_ = sizeof(int8_t); //input
|
||||
@ -96,8 +89,7 @@ FreqXlatingFirFilter::FreqXlatingFirFilter(ConfigurationInterface* configuration
|
||||
freq_xlating_fir_filter_scf_ = gr::filter::freq_xlating_fir_filter_scf::make(decimation_factor, taps_, intermediate_freq_, sampling_freq_);
|
||||
DLOG(INFO) << "input_filter(" << freq_xlating_fir_filter_scf_->unique_id() << ")";
|
||||
}
|
||||
else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0)
|
||||
&& (output_item_type_.compare("cbyte") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0) && (output_item_type_.compare("cbyte") == 0))
|
||||
{
|
||||
item_size = sizeof(lv_8sc_t);
|
||||
input_size_ = sizeof(int8_t); //input
|
||||
@ -122,40 +114,35 @@ FreqXlatingFirFilter::FreqXlatingFirFilter(ConfigurationInterface* configuration
|
||||
}
|
||||
|
||||
|
||||
|
||||
FreqXlatingFirFilter::~FreqXlatingFirFilter()
|
||||
{}
|
||||
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void FreqXlatingFirFilter::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
if (dump_)
|
||||
{
|
||||
top_block->connect(freq_xlating_fir_filter_ccf_, 0, file_sink_, 0);
|
||||
}
|
||||
}
|
||||
else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("float") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("float") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
if (dump_)
|
||||
{
|
||||
top_block->connect(freq_xlating_fir_filter_fcf_, 0, file_sink_, 0);
|
||||
}
|
||||
}
|
||||
else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
if (dump_)
|
||||
{
|
||||
top_block->connect(freq_xlating_fir_filter_scf_, 0, file_sink_, 0);
|
||||
}
|
||||
}
|
||||
else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0)
|
||||
&& (output_item_type_.compare("cshort") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0) && (output_item_type_.compare("cshort") == 0))
|
||||
{
|
||||
top_block->connect(freq_xlating_fir_filter_scf_, 0, complex_to_float_, 0);
|
||||
top_block->connect(complex_to_float_, 0, float_to_short_1_, 0);
|
||||
@ -167,8 +154,7 @@ void FreqXlatingFirFilter::connect(gr::top_block_sptr top_block)
|
||||
top_block->connect(short_x2_to_cshort_, 0, file_sink_, 0);
|
||||
}
|
||||
}
|
||||
else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
top_block->connect(gr_char_to_short_, 0, freq_xlating_fir_filter_scf_, 0);
|
||||
if (dump_)
|
||||
@ -176,8 +162,7 @@ void FreqXlatingFirFilter::connect(gr::top_block_sptr top_block)
|
||||
top_block->connect(freq_xlating_fir_filter_scf_, 0, file_sink_, 0);
|
||||
}
|
||||
}
|
||||
else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0)
|
||||
&& (output_item_type_.compare("cbyte") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0) && (output_item_type_.compare("cbyte") == 0))
|
||||
{
|
||||
top_block->connect(gr_char_to_short_, 0, freq_xlating_fir_filter_scf_, 0);
|
||||
top_block->connect(freq_xlating_fir_filter_scf_, 0, complex_to_complex_byte_, 0);
|
||||
@ -193,35 +178,30 @@ void FreqXlatingFirFilter::connect(gr::top_block_sptr top_block)
|
||||
}
|
||||
|
||||
|
||||
|
||||
void FreqXlatingFirFilter::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
if (dump_)
|
||||
{
|
||||
top_block->disconnect(freq_xlating_fir_filter_ccf_, 0, file_sink_, 0);
|
||||
}
|
||||
}
|
||||
else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("float") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("float") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
if (dump_)
|
||||
{
|
||||
top_block->disconnect(freq_xlating_fir_filter_fcf_, 0, file_sink_, 0);
|
||||
}
|
||||
}
|
||||
else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
if (dump_)
|
||||
{
|
||||
top_block->disconnect(freq_xlating_fir_filter_scf_, 0, file_sink_, 0);
|
||||
}
|
||||
}
|
||||
else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0)
|
||||
&& (output_item_type_.compare("cshort") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0) && (output_item_type_.compare("cshort") == 0))
|
||||
{
|
||||
top_block->disconnect(freq_xlating_fir_filter_scf_, 0, complex_to_float_, 0);
|
||||
top_block->disconnect(complex_to_float_, 0, float_to_short_1_, 0);
|
||||
@ -233,8 +213,7 @@ void FreqXlatingFirFilter::disconnect(gr::top_block_sptr top_block)
|
||||
top_block->disconnect(short_x2_to_cshort_, 0, file_sink_, 0);
|
||||
}
|
||||
}
|
||||
else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
top_block->disconnect(gr_char_to_short_, 0, freq_xlating_fir_filter_scf_, 0);
|
||||
if (dump_)
|
||||
@ -242,8 +221,7 @@ void FreqXlatingFirFilter::disconnect(gr::top_block_sptr top_block)
|
||||
top_block->disconnect(freq_xlating_fir_filter_scf_, 0, file_sink_, 0);
|
||||
}
|
||||
}
|
||||
else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0)
|
||||
&& (output_item_type_.compare("cbyte") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0) && (output_item_type_.compare("cbyte") == 0))
|
||||
{
|
||||
top_block->disconnect(gr_char_to_short_, 0, freq_xlating_fir_filter_scf_, 0);
|
||||
top_block->disconnect(freq_xlating_fir_filter_scf_, 0, complex_to_complex_byte_, 0);
|
||||
@ -261,33 +239,27 @@ void FreqXlatingFirFilter::disconnect(gr::top_block_sptr top_block)
|
||||
|
||||
gr::basic_block_sptr FreqXlatingFirFilter::get_left_block()
|
||||
{
|
||||
if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
return freq_xlating_fir_filter_ccf_;
|
||||
}
|
||||
else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("float") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("float") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
return freq_xlating_fir_filter_fcf_;
|
||||
}
|
||||
else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
return freq_xlating_fir_filter_scf_;
|
||||
}
|
||||
else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0)
|
||||
&& (output_item_type_.compare("cshort") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0) && (output_item_type_.compare("cshort") == 0))
|
||||
{
|
||||
return freq_xlating_fir_filter_scf_;
|
||||
}
|
||||
else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
return gr_char_to_short_;
|
||||
}
|
||||
else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0)
|
||||
&& (output_item_type_.compare("cbyte") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0) && (output_item_type_.compare("cbyte") == 0))
|
||||
{
|
||||
return gr_char_to_short_;
|
||||
}
|
||||
@ -301,33 +273,27 @@ gr::basic_block_sptr FreqXlatingFirFilter::get_left_block()
|
||||
|
||||
gr::basic_block_sptr FreqXlatingFirFilter::get_right_block()
|
||||
{
|
||||
if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("gr_complex") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
return freq_xlating_fir_filter_ccf_;
|
||||
}
|
||||
else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("float") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("float") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
return freq_xlating_fir_filter_fcf_;
|
||||
}
|
||||
else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
return freq_xlating_fir_filter_scf_;
|
||||
}
|
||||
else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0)
|
||||
&& (output_item_type_.compare("cshort") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("short") == 0) && (output_item_type_.compare("cshort") == 0))
|
||||
{
|
||||
return short_x2_to_cshort_;
|
||||
}
|
||||
else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0)
|
||||
&& (output_item_type_.compare("gr_complex") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0) && (output_item_type_.compare("gr_complex") == 0))
|
||||
{
|
||||
return freq_xlating_fir_filter_scf_;
|
||||
}
|
||||
else if((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0)
|
||||
&& (output_item_type_.compare("cbyte") == 0))
|
||||
else if ((taps_item_type_.compare("float") == 0) && (input_item_type_.compare("byte") == 0) && (output_item_type_.compare("cbyte") == 0))
|
||||
{
|
||||
return complex_to_complex_byte_;
|
||||
}
|
||||
|
@ -39,9 +39,7 @@
|
||||
using google::LogMessage;
|
||||
|
||||
NotchFilter::NotchFilter(ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) :
|
||||
role_(role), in_streams_(in_streams),
|
||||
out_streams_(out_streams)
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
size_t item_size_;
|
||||
float pfa;
|
||||
@ -71,7 +69,6 @@ NotchFilter::NotchFilter(ConfigurationInterface* configuration, std::string role
|
||||
notch_filter_ = make_notch_filter(pfa, p_c_factor, length_, n_segments_est, n_segments_reset);
|
||||
DLOG(INFO) << "Item size " << item_size_;
|
||||
DLOG(INFO) << "input filter(" << notch_filter_->unique_id() << ")";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -88,7 +85,8 @@ NotchFilter::NotchFilter(ConfigurationInterface* configuration, std::string role
|
||||
|
||||
|
||||
NotchFilter::~NotchFilter()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void NotchFilter::connect(gr::top_block_sptr top_block)
|
||||
|
@ -69,7 +69,6 @@ public:
|
||||
gr::basic_block_sptr get_right_block();
|
||||
|
||||
private:
|
||||
|
||||
bool dump_;
|
||||
std::string dump_filename_;
|
||||
std::string role_;
|
||||
|
@ -39,9 +39,7 @@
|
||||
using google::LogMessage;
|
||||
|
||||
NotchFilterLite::NotchFilterLite(ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) :
|
||||
role_(role), in_streams_(in_streams),
|
||||
out_streams_(out_streams)
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
size_t item_size_;
|
||||
float p_c_factor;
|
||||
@ -94,7 +92,8 @@ NotchFilterLite::NotchFilterLite(ConfigurationInterface* configuration, std::str
|
||||
|
||||
|
||||
NotchFilterLite::~NotchFilterLite()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void NotchFilterLite::connect(gr::top_block_sptr top_block)
|
||||
|
@ -69,7 +69,6 @@ public:
|
||||
gr::basic_block_sptr get_right_block();
|
||||
|
||||
private:
|
||||
|
||||
bool dump_;
|
||||
std::string dump_filename_;
|
||||
std::string role_;
|
||||
|
@ -39,9 +39,7 @@
|
||||
using google::LogMessage;
|
||||
|
||||
PulseBlankingFilter::PulseBlankingFilter(ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) :
|
||||
config_(configuration), role_(role), in_streams_(in_streams),
|
||||
out_streams_(out_streams)
|
||||
unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
size_t item_size;
|
||||
xlat_ = false;
|
||||
@ -99,10 +97,9 @@ PulseBlankingFilter::PulseBlankingFilter(ConfigurationInterface* configuration,
|
||||
}
|
||||
|
||||
|
||||
|
||||
PulseBlankingFilter::~PulseBlankingFilter()
|
||||
{}
|
||||
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void PulseBlankingFilter::connect(gr::top_block_sptr top_block)
|
||||
@ -126,7 +123,6 @@ void PulseBlankingFilter::connect(gr::top_block_sptr top_block)
|
||||
}
|
||||
|
||||
|
||||
|
||||
void PulseBlankingFilter::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (input_item_type_.compare("gr_complex") == 0)
|
||||
|
@ -49,7 +49,9 @@ beamformer::beamformer()
|
||||
{
|
||||
//initialize weight vector
|
||||
|
||||
if (posix_memalign((void**)&weight_vector, 16, GNSS_SDR_BEAMFORMER_CHANNELS * sizeof(gr_complex)) == 0){};
|
||||
if (posix_memalign((void **)&weight_vector, 16, GNSS_SDR_BEAMFORMER_CHANNELS * sizeof(gr_complex)) == 0)
|
||||
{
|
||||
};
|
||||
|
||||
for (int i = 0; i < GNSS_SDR_BEAMFORMER_CHANNELS; i++)
|
||||
{
|
||||
|
@ -50,7 +50,6 @@ notch_sptr make_notch_filter(float pfa, float p_c_factor,
|
||||
class Notch : public gr::block
|
||||
{
|
||||
private:
|
||||
|
||||
float pfa;
|
||||
float noise_pow_est;
|
||||
float thres_;
|
||||
@ -69,7 +68,6 @@ private:
|
||||
std::unique_ptr<gr::fft::fft_complex> d_fft;
|
||||
|
||||
public:
|
||||
|
||||
Notch(float pfa, float p_c_factor, int length_, int n_segments_est, int n_segments_reset);
|
||||
|
||||
~Notch();
|
||||
|
@ -49,7 +49,6 @@ notch_lite_sptr make_notch_filter_lite(float p_c_factor, float pfa, int length_,
|
||||
class NotchLite : public gr::block
|
||||
{
|
||||
private:
|
||||
|
||||
int length_;
|
||||
int n_segments;
|
||||
int n_segments_est;
|
||||
@ -72,7 +71,6 @@ private:
|
||||
std::unique_ptr<gr::fft::fft_complex> d_fft;
|
||||
|
||||
public:
|
||||
|
||||
NotchLite(float p_c_factor, float pfa, int length_, int n_segments_est, int n_segments_reset, int n_segments_coeff);
|
||||
|
||||
~NotchLite();
|
||||
|
@ -44,7 +44,6 @@ pulse_blanking_cc_sptr make_pulse_blanking_cc(float pfa, int length_, int n_segm
|
||||
class pulse_blanking_cc : public gr::block
|
||||
{
|
||||
private:
|
||||
|
||||
int length_;
|
||||
int n_segments;
|
||||
int n_segments_est;
|
||||
@ -57,7 +56,6 @@ private:
|
||||
gr_complex *zeros_;
|
||||
|
||||
public:
|
||||
|
||||
pulse_blanking_cc(float pfa, int length_, int n_segments_est, int n_segments_reset);
|
||||
|
||||
~pulse_blanking_cc();
|
||||
@ -66,7 +64,6 @@ public:
|
||||
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
|
||||
|
||||
void forecast(int noutput_items, gr_vector_int &ninput_items_required);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -41,9 +41,9 @@ set(GNSS_SPLIBS_SOURCES
|
||||
|
||||
if(OPENCL_FOUND)
|
||||
set(GNSS_SPLIBS_SOURCES ${GNSS_SPLIBS_SOURCES}
|
||||
fft_execute.cc # Needs OpenCL
|
||||
fft_setup.cc # Needs OpenCL
|
||||
fft_kernelstring.cc # Needs OpenCL
|
||||
opencl/fft_execute.cc # Needs OpenCL
|
||||
opencl/fft_setup.cc # Needs OpenCL
|
||||
opencl/fft_kernelstring.cc # Needs OpenCL
|
||||
)
|
||||
endif(OPENCL_FOUND)
|
||||
|
||||
|
@ -40,7 +40,6 @@ byte_x2_to_complex_byte_sptr make_byte_x2_to_complex_byte()
|
||||
}
|
||||
|
||||
|
||||
|
||||
byte_x2_to_complex_byte::byte_x2_to_complex_byte() : sync_block("byte_x2_to_complex_byte",
|
||||
gr::io_signature::make(2, 2, sizeof(int8_t)), // int8_t, defined in stdint.h and included in volk.h (signed char)
|
||||
gr::io_signature::make(1, 1, sizeof(lv_8sc_t))) // lv_8sc_t is a Volk's typedef for std::complex<signed char>
|
||||
|
@ -49,6 +49,7 @@ class byte_x2_to_complex_byte : public gr::sync_block
|
||||
{
|
||||
private:
|
||||
friend byte_x2_to_complex_byte_sptr make_byte_x2_to_complex_byte();
|
||||
|
||||
public:
|
||||
byte_x2_to_complex_byte();
|
||||
|
||||
|
@ -40,7 +40,6 @@ complex_byte_to_float_x2_sptr make_complex_byte_to_float_x2()
|
||||
}
|
||||
|
||||
|
||||
|
||||
complex_byte_to_float_x2::complex_byte_to_float_x2() : sync_block("complex_byte_to_float_x2",
|
||||
gr::io_signature::make(1, 1, sizeof(lv_8sc_t)), // lv_8sc_t is a Volk's typedef for std::complex<signed char>
|
||||
gr::io_signature::make(2, 2, sizeof(float)))
|
||||
|
@ -49,6 +49,7 @@ class complex_byte_to_float_x2 : public gr::sync_block
|
||||
{
|
||||
private:
|
||||
friend complex_byte_to_float_x2_sptr make_complex_byte_to_float_x2();
|
||||
|
||||
public:
|
||||
complex_byte_to_float_x2();
|
||||
|
||||
|
@ -40,7 +40,6 @@ complex_float_to_complex_byte_sptr make_complex_float_to_complex_byte()
|
||||
}
|
||||
|
||||
|
||||
|
||||
complex_float_to_complex_byte::complex_float_to_complex_byte() : sync_block("complex_float_to_complex_byte",
|
||||
gr::io_signature::make(1, 1, sizeof(gr_complex)),
|
||||
gr::io_signature::make(1, 1, sizeof(lv_8sc_t))) // lv_8sc_t is a Volk's typedef for std::complex<signed char>
|
||||
|
@ -47,6 +47,7 @@ class complex_float_to_complex_byte : public gr::sync_block
|
||||
{
|
||||
private:
|
||||
friend complex_float_to_complex_byte_sptr make_complex_float_to_complex_byte();
|
||||
|
||||
public:
|
||||
complex_float_to_complex_byte();
|
||||
|
||||
|
@ -48,6 +48,7 @@ class conjugate_cc : public gr::sync_block
|
||||
{
|
||||
private:
|
||||
friend conjugate_cc_sptr make_conjugate_cc();
|
||||
|
||||
public:
|
||||
conjugate_cc();
|
||||
|
||||
|
@ -48,6 +48,7 @@ class conjugate_ic : public gr::sync_block
|
||||
{
|
||||
private:
|
||||
friend conjugate_ic_sptr make_conjugate_ic();
|
||||
|
||||
public:
|
||||
conjugate_ic();
|
||||
|
||||
|
@ -48,6 +48,7 @@ class conjugate_sc : public gr::sync_block
|
||||
{
|
||||
private:
|
||||
friend conjugate_sc_sptr make_conjugate_sc();
|
||||
|
||||
public:
|
||||
conjugate_sc();
|
||||
|
||||
|
@ -40,7 +40,6 @@ cshort_to_float_x2_sptr make_cshort_to_float_x2()
|
||||
}
|
||||
|
||||
|
||||
|
||||
cshort_to_float_x2::cshort_to_float_x2() : sync_block("cshort_to_float_x2",
|
||||
gr::io_signature::make(1, 1, sizeof(lv_16sc_t)), // lv_8sc_t is a Volk's typedef for std::complex<signed char>
|
||||
gr::io_signature::make(2, 2, sizeof(float)))
|
||||
|
@ -49,6 +49,7 @@ class cshort_to_float_x2 : public gr::sync_block
|
||||
{
|
||||
private:
|
||||
friend cshort_to_float_x2_sptr make_cshort_to_float_x2();
|
||||
|
||||
public:
|
||||
cshort_to_float_x2();
|
||||
|
||||
|
@ -1,277 +0,0 @@
|
||||
|
||||
//
|
||||
// File: fft_base_kernels.h
|
||||
//
|
||||
// Version: <1.0>
|
||||
//
|
||||
// Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple")
|
||||
// in consideration of your agreement to the following terms, and your use,
|
||||
// installation, modification or redistribution of this Apple software
|
||||
// constitutes acceptance of these terms. If you do not agree with these
|
||||
// terms, please do not use, install, modify or redistribute this Apple
|
||||
// software.
|
||||
//
|
||||
// In consideration of your agreement to abide by the following terms, and
|
||||
// subject to these terms, Apple grants you a personal, non - exclusive
|
||||
// license, under Apple's copyrights in this original Apple software ( the
|
||||
// "Apple Software" ), to use, reproduce, modify and redistribute the Apple
|
||||
// Software, with or without modifications, in source and / or binary forms;
|
||||
// provided that if you redistribute the Apple Software in its entirety and
|
||||
// without modifications, you must retain this notice and the following text
|
||||
// and disclaimers in all such redistributions of the Apple Software. Neither
|
||||
// the name, trademarks, service marks or logos of Apple Inc. may be used to
|
||||
// endorse or promote products derived from the Apple Software without specific
|
||||
// prior written permission from Apple. Except as expressly stated in this
|
||||
// notice, no other rights or licenses, express or implied, are granted by
|
||||
// Apple herein, including but not limited to any patent rights that may be
|
||||
// infringed by your derivative works or by other works in which the Apple
|
||||
// Software may be incorporated.
|
||||
//
|
||||
// The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
|
||||
// WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
|
||||
// WARRANTIES OF NON - INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION
|
||||
// ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
|
||||
//
|
||||
// IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
|
||||
// CONSEQUENTIAL DAMAGES ( INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION ) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION
|
||||
// AND / OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER
|
||||
// UNDER THEORY OF CONTRACT, TORT ( INCLUDING NEGLIGENCE ), STRICT LIABILITY OR
|
||||
// OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Copyright ( C ) 2008 Apple Inc. All Rights Reserved.
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#ifndef __CL_FFT_BASE_KERNELS_
|
||||
#define __CL_FFT_BASE_KERNELS_
|
||||
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
static string baseKernels = string(
|
||||
"#ifndef M_PI\n"
|
||||
"#define M_PI 0x1.921fb54442d18p+1\n"
|
||||
"#endif\n"
|
||||
"#define complexMul(a,b) ((float2)(mad(-(a).y, (b).y, (a).x * (b).x), mad((a).y, (b).x, (a).x * (b).y)))\n"
|
||||
"#define conj(a) ((float2)((a).x, -(a).y))\n"
|
||||
"#define conjTransp(a) ((float2)(-(a).y, (a).x))\n"
|
||||
"\n"
|
||||
"#define fftKernel2(a,dir) \\\n"
|
||||
"{ \\\n"
|
||||
" float2 c = (a)[0]; \\\n"
|
||||
" (a)[0] = c + (a)[1]; \\\n"
|
||||
" (a)[1] = c - (a)[1]; \\\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"#define fftKernel2S(d1,d2,dir) \\\n"
|
||||
"{ \\\n"
|
||||
" float2 c = (d1); \\\n"
|
||||
" (d1) = c + (d2); \\\n"
|
||||
" (d2) = c - (d2); \\\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"#define fftKernel4(a,dir) \\\n"
|
||||
"{ \\\n"
|
||||
" fftKernel2S((a)[0], (a)[2], dir); \\\n"
|
||||
" fftKernel2S((a)[1], (a)[3], dir); \\\n"
|
||||
" fftKernel2S((a)[0], (a)[1], dir); \\\n"
|
||||
" (a)[3] = (float2)(dir)*(conjTransp((a)[3])); \\\n"
|
||||
" fftKernel2S((a)[2], (a)[3], dir); \\\n"
|
||||
" float2 c = (a)[1]; \\\n"
|
||||
" (a)[1] = (a)[2]; \\\n"
|
||||
" (a)[2] = c; \\\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"#define fftKernel4s(a0,a1,a2,a3,dir) \\\n"
|
||||
"{ \\\n"
|
||||
" fftKernel2S((a0), (a2), dir); \\\n"
|
||||
" fftKernel2S((a1), (a3), dir); \\\n"
|
||||
" fftKernel2S((a0), (a1), dir); \\\n"
|
||||
" (a3) = (float2)(dir)*(conjTransp((a3))); \\\n"
|
||||
" fftKernel2S((a2), (a3), dir); \\\n"
|
||||
" float2 c = (a1); \\\n"
|
||||
" (a1) = (a2); \\\n"
|
||||
" (a2) = c; \\\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"#define bitreverse8(a) \\\n"
|
||||
"{ \\\n"
|
||||
" float2 c; \\\n"
|
||||
" c = (a)[1]; \\\n"
|
||||
" (a)[1] = (a)[4]; \\\n"
|
||||
" (a)[4] = c; \\\n"
|
||||
" c = (a)[3]; \\\n"
|
||||
" (a)[3] = (a)[6]; \\\n"
|
||||
" (a)[6] = c; \\\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"#define fftKernel8(a,dir) \\\n"
|
||||
"{ \\\n"
|
||||
" const float2 w1 = (float2)(0x1.6a09e6p-1f, dir*0x1.6a09e6p-1f); \\\n"
|
||||
" const float2 w3 = (float2)(-0x1.6a09e6p-1f, dir*0x1.6a09e6p-1f); \\\n"
|
||||
" float2 c; \\\n"
|
||||
" fftKernel2S((a)[0], (a)[4], dir); \\\n"
|
||||
" fftKernel2S((a)[1], (a)[5], dir); \\\n"
|
||||
" fftKernel2S((a)[2], (a)[6], dir); \\\n"
|
||||
" fftKernel2S((a)[3], (a)[7], dir); \\\n"
|
||||
" (a)[5] = complexMul(w1, (a)[5]); \\\n"
|
||||
" (a)[6] = (float2)(dir)*(conjTransp((a)[6])); \\\n"
|
||||
" (a)[7] = complexMul(w3, (a)[7]); \\\n"
|
||||
" fftKernel2S((a)[0], (a)[2], dir); \\\n"
|
||||
" fftKernel2S((a)[1], (a)[3], dir); \\\n"
|
||||
" fftKernel2S((a)[4], (a)[6], dir); \\\n"
|
||||
" fftKernel2S((a)[5], (a)[7], dir); \\\n"
|
||||
" (a)[3] = (float2)(dir)*(conjTransp((a)[3])); \\\n"
|
||||
" (a)[7] = (float2)(dir)*(conjTransp((a)[7])); \\\n"
|
||||
" fftKernel2S((a)[0], (a)[1], dir); \\\n"
|
||||
" fftKernel2S((a)[2], (a)[3], dir); \\\n"
|
||||
" fftKernel2S((a)[4], (a)[5], dir); \\\n"
|
||||
" fftKernel2S((a)[6], (a)[7], dir); \\\n"
|
||||
" bitreverse8((a)); \\\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"#define bitreverse4x4(a) \\\n"
|
||||
"{ \\\n"
|
||||
" float2 c; \\\n"
|
||||
" c = (a)[1]; (a)[1] = (a)[4]; (a)[4] = c; \\\n"
|
||||
" c = (a)[2]; (a)[2] = (a)[8]; (a)[8] = c; \\\n"
|
||||
" c = (a)[3]; (a)[3] = (a)[12]; (a)[12] = c; \\\n"
|
||||
" c = (a)[6]; (a)[6] = (a)[9]; (a)[9] = c; \\\n"
|
||||
" c = (a)[7]; (a)[7] = (a)[13]; (a)[13] = c; \\\n"
|
||||
" c = (a)[11]; (a)[11] = (a)[14]; (a)[14] = c; \\\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"#define fftKernel16(a,dir) \\\n"
|
||||
"{ \\\n"
|
||||
" const float w0 = 0x1.d906bcp-1f; \\\n"
|
||||
" const float w1 = 0x1.87de2ap-2f; \\\n"
|
||||
" const float w2 = 0x1.6a09e6p-1f; \\\n"
|
||||
" fftKernel4s((a)[0], (a)[4], (a)[8], (a)[12], dir); \\\n"
|
||||
" fftKernel4s((a)[1], (a)[5], (a)[9], (a)[13], dir); \\\n"
|
||||
" fftKernel4s((a)[2], (a)[6], (a)[10], (a)[14], dir); \\\n"
|
||||
" fftKernel4s((a)[3], (a)[7], (a)[11], (a)[15], dir); \\\n"
|
||||
" (a)[5] = complexMul((a)[5], (float2)(w0, dir*w1)); \\\n"
|
||||
" (a)[6] = complexMul((a)[6], (float2)(w2, dir*w2)); \\\n"
|
||||
" (a)[7] = complexMul((a)[7], (float2)(w1, dir*w0)); \\\n"
|
||||
" (a)[9] = complexMul((a)[9], (float2)(w2, dir*w2)); \\\n"
|
||||
" (a)[10] = (float2)(dir)*(conjTransp((a)[10])); \\\n"
|
||||
" (a)[11] = complexMul((a)[11], (float2)(-w2, dir*w2)); \\\n"
|
||||
" (a)[13] = complexMul((a)[13], (float2)(w1, dir*w0)); \\\n"
|
||||
" (a)[14] = complexMul((a)[14], (float2)(-w2, dir*w2)); \\\n"
|
||||
" (a)[15] = complexMul((a)[15], (float2)(-w0, dir*-w1)); \\\n"
|
||||
" fftKernel4((a), dir); \\\n"
|
||||
" fftKernel4((a) + 4, dir); \\\n"
|
||||
" fftKernel4((a) + 8, dir); \\\n"
|
||||
" fftKernel4((a) + 12, dir); \\\n"
|
||||
" bitreverse4x4((a)); \\\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"#define bitreverse32(a) \\\n"
|
||||
"{ \\\n"
|
||||
" float2 c1, c2; \\\n"
|
||||
" c1 = (a)[2]; (a)[2] = (a)[1]; c2 = (a)[4]; (a)[4] = c1; c1 = (a)[8]; (a)[8] = c2; c2 = (a)[16]; (a)[16] = c1; (a)[1] = c2; \\\n"
|
||||
" c1 = (a)[6]; (a)[6] = (a)[3]; c2 = (a)[12]; (a)[12] = c1; c1 = (a)[24]; (a)[24] = c2; c2 = (a)[17]; (a)[17] = c1; (a)[3] = c2; \\\n"
|
||||
" c1 = (a)[10]; (a)[10] = (a)[5]; c2 = (a)[20]; (a)[20] = c1; c1 = (a)[9]; (a)[9] = c2; c2 = (a)[18]; (a)[18] = c1; (a)[5] = c2; \\\n"
|
||||
" c1 = (a)[14]; (a)[14] = (a)[7]; c2 = (a)[28]; (a)[28] = c1; c1 = (a)[25]; (a)[25] = c2; c2 = (a)[19]; (a)[19] = c1; (a)[7] = c2; \\\n"
|
||||
" c1 = (a)[22]; (a)[22] = (a)[11]; c2 = (a)[13]; (a)[13] = c1; c1 = (a)[26]; (a)[26] = c2; c2 = (a)[21]; (a)[21] = c1; (a)[11] = c2; \\\n"
|
||||
" c1 = (a)[30]; (a)[30] = (a)[15]; c2 = (a)[29]; (a)[29] = c1; c1 = (a)[27]; (a)[27] = c2; c2 = (a)[23]; (a)[23] = c1; (a)[15] = c2; \\\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"#define fftKernel32(a,dir) \\\n"
|
||||
"{ \\\n"
|
||||
" fftKernel2S((a)[0], (a)[16], dir); \\\n"
|
||||
" fftKernel2S((a)[1], (a)[17], dir); \\\n"
|
||||
" fftKernel2S((a)[2], (a)[18], dir); \\\n"
|
||||
" fftKernel2S((a)[3], (a)[19], dir); \\\n"
|
||||
" fftKernel2S((a)[4], (a)[20], dir); \\\n"
|
||||
" fftKernel2S((a)[5], (a)[21], dir); \\\n"
|
||||
" fftKernel2S((a)[6], (a)[22], dir); \\\n"
|
||||
" fftKernel2S((a)[7], (a)[23], dir); \\\n"
|
||||
" fftKernel2S((a)[8], (a)[24], dir); \\\n"
|
||||
" fftKernel2S((a)[9], (a)[25], dir); \\\n"
|
||||
" fftKernel2S((a)[10], (a)[26], dir); \\\n"
|
||||
" fftKernel2S((a)[11], (a)[27], dir); \\\n"
|
||||
" fftKernel2S((a)[12], (a)[28], dir); \\\n"
|
||||
" fftKernel2S((a)[13], (a)[29], dir); \\\n"
|
||||
" fftKernel2S((a)[14], (a)[30], dir); \\\n"
|
||||
" fftKernel2S((a)[15], (a)[31], dir); \\\n"
|
||||
" (a)[17] = complexMul((a)[17], (float2)(0x1.f6297cp-1f, dir*0x1.8f8b84p-3f)); \\\n"
|
||||
" (a)[18] = complexMul((a)[18], (float2)(0x1.d906bcp-1f, dir*0x1.87de2ap-2f)); \\\n"
|
||||
" (a)[19] = complexMul((a)[19], (float2)(0x1.a9b662p-1f, dir*0x1.1c73b4p-1f)); \\\n"
|
||||
" (a)[20] = complexMul((a)[20], (float2)(0x1.6a09e6p-1f, dir*0x1.6a09e6p-1f)); \\\n"
|
||||
" (a)[21] = complexMul((a)[21], (float2)(0x1.1c73b4p-1f, dir*0x1.a9b662p-1f)); \\\n"
|
||||
" (a)[22] = complexMul((a)[22], (float2)(0x1.87de2ap-2f, dir*0x1.d906bcp-1f)); \\\n"
|
||||
" (a)[23] = complexMul((a)[23], (float2)(0x1.8f8b84p-3f, dir*0x1.f6297cp-1f)); \\\n"
|
||||
" (a)[24] = complexMul((a)[24], (float2)(0x0p+0f, dir*0x1p+0f)); \\\n"
|
||||
" (a)[25] = complexMul((a)[25], (float2)(-0x1.8f8b84p-3f, dir*0x1.f6297cp-1f)); \\\n"
|
||||
" (a)[26] = complexMul((a)[26], (float2)(-0x1.87de2ap-2f, dir*0x1.d906bcp-1f)); \\\n"
|
||||
" (a)[27] = complexMul((a)[27], (float2)(-0x1.1c73b4p-1f, dir*0x1.a9b662p-1f)); \\\n"
|
||||
" (a)[28] = complexMul((a)[28], (float2)(-0x1.6a09e6p-1f, dir*0x1.6a09e6p-1f)); \\\n"
|
||||
" (a)[29] = complexMul((a)[29], (float2)(-0x1.a9b662p-1f, dir*0x1.1c73b4p-1f)); \\\n"
|
||||
" (a)[30] = complexMul((a)[30], (float2)(-0x1.d906bcp-1f, dir*0x1.87de2ap-2f)); \\\n"
|
||||
" (a)[31] = complexMul((a)[31], (float2)(-0x1.f6297cp-1f, dir*0x1.8f8b84p-3f)); \\\n"
|
||||
" fftKernel16((a), dir); \\\n"
|
||||
" fftKernel16((a) + 16, dir); \\\n"
|
||||
" bitreverse32((a)); \\\n"
|
||||
"}\n\n"
|
||||
);
|
||||
|
||||
static string twistKernelInterleaved = string(
|
||||
"__kernel void \\\n"
|
||||
"clFFT_1DTwistInterleaved(__global float2 *in, unsigned int startRow, unsigned int numCols, unsigned int N, unsigned int numRowsToProcess, int dir) \\\n"
|
||||
"{ \\\n"
|
||||
" float2 a, w; \\\n"
|
||||
" float ang; \\\n"
|
||||
" unsigned int j; \\\n"
|
||||
" unsigned int i = get_global_id(0); \\\n"
|
||||
" unsigned int startIndex = i; \\\n"
|
||||
" \\\n"
|
||||
" if(i < numCols) \\\n"
|
||||
" { \\\n"
|
||||
" for(j = 0; j < numRowsToProcess; j++) \\\n"
|
||||
" { \\\n"
|
||||
" a = in[startIndex]; \\\n"
|
||||
" ang = 2.0f * M_PI * dir * i * (startRow + j) / N; \\\n"
|
||||
" w = (float2)(native_cos(ang), native_sin(ang)); \\\n"
|
||||
" a = complexMul(a, w); \\\n"
|
||||
" in[startIndex] = a; \\\n"
|
||||
" startIndex += numCols; \\\n"
|
||||
" } \\\n"
|
||||
" } \\\n"
|
||||
"} \\\n"
|
||||
);
|
||||
|
||||
static string twistKernelPlannar = string(
|
||||
"__kernel void \\\n"
|
||||
"clFFT_1DTwistSplit(__global float *in_real, __global float *in_imag , unsigned int startRow, unsigned int numCols, unsigned int N, unsigned int numRowsToProcess, int dir) \\\n"
|
||||
"{ \\\n"
|
||||
" float2 a, w; \\\n"
|
||||
" float ang; \\\n"
|
||||
" unsigned int j; \\\n"
|
||||
" unsigned int i = get_global_id(0); \\\n"
|
||||
" unsigned int startIndex = i; \\\n"
|
||||
" \\\n"
|
||||
" if(i < numCols) \\\n"
|
||||
" { \\\n"
|
||||
" for(j = 0; j < numRowsToProcess; j++) \\\n"
|
||||
" { \\\n"
|
||||
" a = (float2)(in_real[startIndex], in_imag[startIndex]); \\\n"
|
||||
" ang = 2.0f * M_PI * dir * i * (startRow + j) / N; \\\n"
|
||||
" w = (float2)(native_cos(ang), native_sin(ang)); \\\n"
|
||||
" a = complexMul(a, w); \\\n"
|
||||
" in_real[startIndex] = a.x; \\\n"
|
||||
" in_imag[startIndex] = a.y; \\\n"
|
||||
" startIndex += numCols; \\\n"
|
||||
" } \\\n"
|
||||
" } \\\n"
|
||||
"} \\\n"
|
||||
);
|
||||
|
||||
|
||||
|
||||
#endif
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user