GNSS-SDR  0.0.13
An Open Source GNSS Software Defined Receiver
Functions | Variables
convolutional.h File Reference

General functions used to implement convolutional encoding. More...

#include <volk_gnsssdr/volk_gnsssdr.h>
#include <vector>

Go to the source code of this file.

Functions

int parity_counter (int symbol, int length)
 Determines if a symbol has odd (1) or even (0) parity Output parameters: More...
 
int nsc_enc_bit (int state_out_p[], int input, int state_in, const int g[], int KK, int nn)
 Convolutionally encodes a single bit using a rate 1/n encoder. Takes in one input bit at a time, and produces a n-bit output. More...
 
void nsc_transit (int output_p[], int trans_p[], int input, int g[], int KK, int nn)
 Function that creates the transit and output vectors. More...
 
float Gamma (const float rec_array[], int symbol, int nn)
 Computes the branch metric used for decoding. More...
 
void Viterbi (int output_u_int[], const int out0[], const int state0[], const int out1[], const int state1[], const float input_c[], int KK, int nn, int LL)
 Uses the Viterbi algorithm to perform hard-decision decoding of a convolutional code. More...
 

Variables

const float MAXLOG = 1e7
 

Detailed Description

General functions used to implement convolutional encoding.

Author
Matthew C. Valenti, 2006-2008.
C. Fernandez-Prades, 2019.

Copyright (C) 2006-2008 Matthew C. Valenti Copyright (C) 2019 C. Fernandez-Prades

GNSS-SDR is a software defined Global Navigation Satellite Systems receiver

This file is part of GNSS-SDR.

SPDX-License-Identifier: GPL-3.0-or-later

This file is a derived work of the original file, which had this note:

The functions in this file are part of the Iterative Solutions Coded Modulation Library. The Iterative Solutions Coded Modulation Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

Definition in file convolutional.h.

Function Documentation

◆ Gamma()

float Gamma ( const float  rec_array[],
int  symbol,
int  nn 
)
inline

Computes the branch metric used for decoding.

Returns
(returned float) The metric between the hypothetical symbol and the received vector
Parameters
[in]rec_arrayThe received vector, of length nn
[in]symbolThe hypothetical symbol
[in]nnThe length of the received vector

Definition at line 145 of file convolutional.h.

◆ nsc_enc_bit()

int nsc_enc_bit ( int  state_out_p[],
int  input,
int  state_in,
const int  g[],
int  KK,
int  nn 
)
inline

Convolutionally encodes a single bit using a rate 1/n encoder. Takes in one input bit at a time, and produces a n-bit output.

Parameters
[in]inputThe input data bit (i.e. a 0 or 1).
[in]state_inThe starting state of the encoder (an int from 0 to 2^m-1).
[in]g[]An n-element vector containing the code generators in binary form.
[in]KKThe constraint length of the convolutional code.
[out]output_p[]An n-element vector containing the encoded bits.
[out]state_out_p[]An integer containing the final state of the encoder (i.e. the state after encoding this bit)

This function is used by nsc_transit()

Definition at line 86 of file convolutional.h.

References parity_counter().

Referenced by nsc_transit().

◆ nsc_transit()

void nsc_transit ( int  output_p[],
int  trans_p[],
int  input,
int  g[],
int  KK,
int  nn 
)
inline

Function that creates the transit and output vectors.

Definition at line 116 of file convolutional.h.

References nsc_enc_bit().

◆ parity_counter()

int parity_counter ( int  symbol,
int  length 
)
inline

Determines if a symbol has odd (1) or even (0) parity Output parameters:

Returns
(returned int): The symbol's parity = 1 for odd and 0 for even
Parameters
[in]symbolThe integer-valued symbol
[in]lengthThe highest bit position in the symbol

This function is used by nsc_enc_bit(), rsc_enc_bit(), and rsc_tail()

Definition at line 58 of file convolutional.h.

Referenced by nsc_enc_bit().

◆ Viterbi()

void Viterbi ( int  output_u_int[],
const int  out0[],
const int  state0[],
const int  out1[],
const int  state1[],
const float  input_c[],
int  KK,
int  nn,
int  LL 
)
inline

Uses the Viterbi algorithm to perform hard-decision decoding of a convolutional code.

Parameters
[in]out0[]The output bits for each state if input is a 0.
[in]state0[]The next state if input is a 0.
[in]out1[]The output bits for each state if input is a 1.
[in]state1[]The next state if input is a 1.
[in]r[]The received signal in LLR-form. For BPSK, must be in form r = 2*a*y/(sigma^2).
[in]KKThe constraint length of the convolutional code.
[in]LLThe number of data bits.
[out]output_u_int[]Hard decisions on the data bits

Definition at line 177 of file convolutional.h.