GNSS-SDR  0.0.13
An Open Source GNSS Software Defined Receiver
lock_detectors.h
Go to the documentation of this file.
1 /*!
2  * \file lock_detectors.h
3  * \brief Interface of a library with a set of code and carrier phase lock detectors.
4  *
5  * SNV_CN0 is a Carrier-to-Noise (CN0) estimator
6  * based on the Signal-to-Noise Variance (SNV) estimator [1].
7  * Carrier lock detector using normalised estimate of the cosine
8  * of twice the carrier phase error [2].
9  *
10  * [1] Marco Pini, Emanuela Falletti and Maurizio Fantino, "Performance
11  * Evaluation of C/N0 Estimators using a Real Time GNSS Software Receiver,"
12  * IEEE 10th International Symposium on Spread Spectrum Techniques and
13  * Applications, pp.28-30, August 2008.
14  *
15  * [2] Van Dierendonck, A.J. (1996), Global Positioning System: Theory and
16  * Applications,
17  * Volume I, Chapter 8: GPS Receivers, AJ Systems, Los Altos, CA 94024.
18  * Inc.: 329-407.
19  * \authors <ul>
20  * <li> Javier Arribas, 2011. jarribas(at)cttc.es
21  * <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com
22  * </ul>
23  * -----------------------------------------------------------------------------
24  *
25  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
26  *
27  * GNSS-SDR is a software defined Global Navigation
28  * Satellite Systems receiver
29  *
30  * This file is part of GNSS-SDR.
31  *
32  * SPDX-License-Identifier: GPL-3.0-or-later
33  *
34  * -----------------------------------------------------------------------------
35  */
36 
37 #ifndef GNSS_SDR_LOCK_DETECTORS_H
38 #define GNSS_SDR_LOCK_DETECTORS_H
39 
40 #include <gnuradio/gr_complex.h>
41 
42 
43 /*! \brief cn0_svn_estimator is a Carrier-to-Noise (CN0) estimator
44  * based on the Signal-to-Noise Variance (SNV) estimator
45  *
46  * Signal-to-Noise (SNR) (\f$ \rho \f$) estimator using the Signal-to-Noise Variance (SNV) estimator:
47  * \f{equation}
48  * \hat{\rho}=\frac{\hat{P}_s}{\hat{P}_n}=\frac{\hat{P}_s}{\hat{P}_{tot}-\hat{P}_s},
49  * \f}
50  * where \f$ \hat{P}_s=\left(\frac{1}{N}\sum^{N-1}_{i=0}|Re(Pc(i))|\right)^2 \f$ is the estimation of the signal power,
51  * \f$ \hat{P}_{tot}=\frac{1}{N}\sum^{N-1}_{i=0}|Pc(i)|^2 \f$ is the estimator of the total power, \f$ |\cdot| \f$ is the absolute value,
52  * \f$ Re(\cdot) \f$ stands for the real part of the value, and \f$ Pc(i) \f$ is the prompt correlator output for the sample index i.
53  *
54  * The SNR value is converted to CN0 [dB-Hz], taking into account the coherent integration time, using the following formula:
55  * \f{equation}
56  * CN0_{dB}=10*log(\hat{\rho})-10*log(T_{int}),
57  * \f}
58  * where \f$ T_{int} \f$ is the coherent integration time, in seconds.
59  *
60  * Ref: Marco Pini, Emanuela Falletti and Maurizio Fantino, "Performance
61  * Evaluation of C/N0 Estimators using a Real Time GNSS Software Receiver,"
62  * IEEE 10th International Symposium on Spread Spectrum Techniques and
63  * Applications, pp.28-30, August 2008.
64  */
65 float cn0_svn_estimator(const gr_complex* Prompt_buffer, int length, float coh_integration_time_s);
66 
67 
68 /*! \brief cn0_m2m4_estimator is a Carrier-to-Noise (CN0) estimator
69  * based on the Second- and Fourth-Order Moments Method (M2M4)
70  *
71  * Signal-to-Noise (SNR) (\f$ \rho \f$) estimator using the Moments Method:
72  * \f{equation}
73  * \hat{\rho}=\frac{\sqrt{2 \hat{M}_2^2 - \hat{M}_4 }}{\hat{M}_2-\sqrt{2 \hat{M}_2^2 - \hat{M}_4 }},
74  * \f}
75  * where
76  * \f$ \hat{M}_2=\frac{1}{N}\sum^{K-1}_{k=0}|P[k]|^2 \f$, \f$ \hat{M}_4 = \frac{1}{K}\sum^{K-1}_{k=0}|P[k]|^4 \f$, \f$ |\cdot| \f$ is the absolute value,
77  * and \f$ P[k] \f$ is the prompt correlator output for the sample index k.
78  *
79  * The SNR value is converted to CN0 [dB-Hz] taking into account the coherent integration time, using the following formula:
80  * \f{equation}
81  * CN0_{dB}=10*log(\hat{\rho})-10*log(T_{int}),
82  * \f}
83  * where \f$ T_{int} \f$ is the coherent integration time, in seconds.
84  *
85  * Ref: D. R. Pauluzzi, N. C. Beaulieu, "A comparison of SNR estimation
86  * techniques for the AWGN channel," IEEE Trans. on Comm., vol. 48,
87  * no. 10, pp. 1681–1691, Oct. 2000.
88  */
89 float cn0_m2m4_estimator(const gr_complex* Prompt_buffer, int length, float coh_integration_time_s);
90 
91 
92 /*! \brief A carrier lock detector
93  *
94  * The Carrier Phase Lock Detector block uses the estimate of the cosine of twice the carrier phase error is given by
95  * \f{equation}
96  * C2\phi=\frac{NBD}{NBP},
97  * \f}
98  * where \f$ NBD=(\sum^{N-1}_{i=0}|Im(Pc(i))|)^2+(\sum^{N-1}_{i=0}|Re(Pc(i))|)^2 \f$,
99  * \f$ NBP=\sum^{N-1}_{i=0}Im(Pc(i))^2-\sum^{N-1}_{i=0}Re(Pc(i))^2 \f$, and
100  * \f$ Pc(i) \f$ is the prompt correlator output for the sample index i.
101  * Ref: Van Dierendonck, A.J. (1996), Global Positioning System: Theory and
102  * Applications,
103  * Volume I, Chapter 8: GPS Receivers, AJ Systems, Los Altos, CA 94024.
104  * Inc.: 329-407.
105  */
106 float carrier_lock_detector(gr_complex* Prompt_buffer, int length);
107 
108 #endif
float cn0_m2m4_estimator(const gr_complex *Prompt_buffer, int length, float coh_integration_time_s)
cn0_m2m4_estimator is a Carrier-to-Noise (CN0) estimator based on the Second- and Fourth-Order Moment...
float carrier_lock_detector(gr_complex *Prompt_buffer, int length)
A carrier lock detector.
float cn0_svn_estimator(const gr_complex *Prompt_buffer, int length, float coh_integration_time_s)
cn0_svn_estimator is a Carrier-to-Noise (CN0) estimator based on the Signal-to-Noise Variance (SNV) e...