mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2026-10-17 21:12:35 +00:00
- Restore true chip semantics for L1: QZSS_L1_CHIP_RATE is 1.023 Mcps and QZSS_L1_CODE_LENGTH is 1023 chips again. The replica carries QZSS_L1_SAMPLES_PER_CHIP = 2 samples per chip (L1 C/A chips duplicated, L1 C/B sinBOC(1,1) subchips), following the Galileo E1 approach. The generated waveform is unchanged, but Tracking_1J.early_late_space_chips is expressed in chips again, consistently with all other signals. - Normalize the DLL discriminator with the sinBOC(1,1) correlation function when the tracked PRN broadcasts L1 C/B, selected per PRN in start_tracking(); warn if the configured correlator spacing falls outside the BOC(1,1) correlation main peak (> 0.33 chips). - Attribute L1 C/B observables and ephemerides (PRN 203-206) to the PRN of the satellite's nominal PNT signals (RINEX 4.00, Table 6), so RINEX, RTCM and rtklib identify the transmitting satellite correctly and multi-frequency observations of the same satellite are paired instead of counted twice. - Do not search QZSS L5 signals for PRNs above 202, which have no L5 PRN code assigned in IS-QZSS-PNT. - Remove reserved, non-operational PRNs 198 and 202 from the default QZSS search list; they remain selectable via the QZSS.prns option. - Fix a potential std::out_of_range in GNSSFlowgraph::priorize_satellites() when assisted acquisition prioritizes satellites of a constellation with only a subset of its signals configured.
164 lines
4.7 KiB
C++
164 lines
4.7 KiB
C++
/*!
|
|
* \file qzss_code_generation_test.cc
|
|
* \brief This file implements unit tests for the QZSS code generation
|
|
* \author Carles Fernández-Prades, 2026. cfernandez (at)) cttc.es
|
|
*
|
|
*
|
|
* -----------------------------------------------------------------------------
|
|
*
|
|
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
|
* This file is part of GNSS-SDR.
|
|
*
|
|
* Copyright (C) 2010-2026 (see AUTHORS file for a list of contributors)
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
*
|
|
* -----------------------------------------------------------------------------
|
|
*/
|
|
|
|
#include "qzss.h"
|
|
#include "qzss_signal_replica.h"
|
|
#include <gtest/gtest.h>
|
|
#include <vector>
|
|
|
|
|
|
TEST(QzssL1Code, Periodicity)
|
|
{
|
|
constexpr uint32_t prn = 193;
|
|
std::vector<float> code1(QZSS_L1_SAMPLES_PER_CHIP * QZSS_L1_CODE_LENGTH);
|
|
std::vector<float> code2(QZSS_L1_SAMPLES_PER_CHIP * QZSS_L1_CODE_LENGTH);
|
|
|
|
qzss_l1_code_gen_float(code1, prn);
|
|
qzss_l1_code_gen_float(code2, prn);
|
|
|
|
EXPECT_EQ(code1, code2);
|
|
}
|
|
|
|
|
|
TEST(QzssL1Code, GoldenFirst32Chips)
|
|
{
|
|
constexpr uint32_t prn = 193;
|
|
std::vector<float> code(QZSS_L1_SAMPLES_PER_CHIP * QZSS_L1_CODE_LENGTH);
|
|
qzss_l1_code_gen_float(code, prn);
|
|
|
|
const float golden[64] = {
|
|
-1, -1, 1, 1, 1, 1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1,
|
|
1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1,
|
|
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, -1, -1,
|
|
1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1};
|
|
|
|
for (int i = 0; i < 64; ++i)
|
|
{
|
|
EXPECT_FLOAT_EQ(code[i], golden[i]);
|
|
}
|
|
constexpr uint32_t prn2 = 195;
|
|
qzss_l1_code_gen_float(code, prn2);
|
|
const float golden2[64] = {
|
|
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, -1, -1,
|
|
-1, -1, -1, -1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1,
|
|
1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, 1, 1, 1, 1,
|
|
-1, -1, -1, -1, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, -1, -1};
|
|
for (int i = 0; i < 64; ++i)
|
|
{
|
|
EXPECT_FLOAT_EQ(code[i], golden2[i]);
|
|
}
|
|
|
|
constexpr uint32_t prn3 = 199;
|
|
qzss_l1_code_gen_float(code, prn3);
|
|
const float golden3[64] = {
|
|
1, 1, -1, -1, -1, -1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1,
|
|
-1, -1, -1, -1, -1, -1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1,
|
|
-1, -1, 1, 1, -1, -1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1,
|
|
-1, -1, 1, 1, 1, 1, 1, 1, -1, -1, 1, 1, -1, -1, -1, -1};
|
|
for (int i = 0; i < 64; ++i)
|
|
{
|
|
EXPECT_FLOAT_EQ(code[i], golden3[i]);
|
|
}
|
|
|
|
constexpr uint32_t prn4 = 205;
|
|
qzss_l1_code_gen_float(code, prn4);
|
|
const float golden4[64] = {
|
|
1, -1, 1, -1, 1, -1, 1, -1, 1, -1, -1, 1, 1, -1, 1, -1,
|
|
1, -1, 1, -1, 1, -1, -1, 1, -1, 1, -1, 1, 1, -1, -1, 1,
|
|
1, -1, -1, 1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1,
|
|
-1, 1, -1, 1, -1, 1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1};
|
|
for (int i = 0; i < 64; ++i)
|
|
{
|
|
EXPECT_FLOAT_EQ(code[i], golden4[i]);
|
|
}
|
|
}
|
|
|
|
|
|
TEST(QzssL5Code, L5IGoldenFirst32Chips)
|
|
{
|
|
std::vector<float> code(10230);
|
|
qzss_l5i_code_gen_float(code, 193);
|
|
|
|
const float golden[32] = {
|
|
1, -1, -1, -1, 1, -1, 1, 1,
|
|
1, 1, -1, -1, 1, 1, 1, -1,
|
|
1, -1, -1, 1, -1, -1, 1, -1,
|
|
-1, 1, 1, 1, -1, -1, -1, 1};
|
|
|
|
for (int i = 0; i < 32; ++i)
|
|
{
|
|
EXPECT_FLOAT_EQ(code[i], golden[i]);
|
|
}
|
|
|
|
qzss_l5i_code_gen_float(code, 199);
|
|
|
|
const float golden2[32] = {
|
|
1, 1, -1, 1, 1, -1, 1, -1,
|
|
-1, 1, -1, 1, -1, -1, -1, -1,
|
|
1, 1, -1, 1, -1, -1, -1, 1,
|
|
-1, 1, 1, 1, 1, -1, 1, -1};
|
|
|
|
for (int i = 0; i < 32; ++i)
|
|
{
|
|
EXPECT_FLOAT_EQ(code[i], golden2[i]);
|
|
}
|
|
|
|
qzss_l5i_code_gen_float(code, 196);
|
|
|
|
const float golden3[32] = {
|
|
-1, 1, 1, 1, -1, -1, -1, 1,
|
|
-1, -1, -1, -1, -1, -1, -1, -1,
|
|
1, -1, 1, 1, -1, 1, 1, -1,
|
|
1, -1, 1, -1, -1, -1, 1, -1};
|
|
|
|
for (int i = 0; i < 32; ++i)
|
|
{
|
|
EXPECT_FLOAT_EQ(code[i], golden3[i]);
|
|
}
|
|
}
|
|
|
|
|
|
TEST(QzssL5Code, L5QGoldenFirst32Chips)
|
|
{
|
|
std::vector<float> code(10230);
|
|
qzss_l5q_code_gen_float(code, 193);
|
|
|
|
const float golden[32] = {
|
|
-1, -1, -1, 1, 1, 1, 1, -1,
|
|
-1, -1, 1, 1, -1, 1, 1, -1,
|
|
-1, 1, 1, -1, -1, -1, -1, -1,
|
|
1, 1, -1, -1, -1, -1, -1, 1};
|
|
|
|
for (int i = 0; i < 32; ++i)
|
|
{
|
|
EXPECT_FLOAT_EQ(code[i], golden[i]);
|
|
}
|
|
|
|
qzss_l5q_code_gen_float(code, 199);
|
|
|
|
const float golden2[32] = {
|
|
-1, 1, 1, 1, -1, -1, -1, 1,
|
|
1, -1, -1, 1, 1, 1, 1, -1,
|
|
-1, -1, -1, -1, -1, 1, 1, 1,
|
|
-1, 1, 1, -1, 1, -1, -1, 1};
|
|
|
|
for (int i = 0; i < 32; ++i)
|
|
{
|
|
EXPECT_FLOAT_EQ(code[i], golden2[i]);
|
|
}
|
|
}
|