osmo-gmr: pi2-CBPSK, pi4-CBPSK and pi4-CQPSK modulation

osmo-gmr 0.2.104-2b98 Osmocom GMR-1

Files | Data Structures | Macros | Functions | Variables
pi2-CBPSK, pi4-CBPSK and pi4-CQPSK modulation
GMR-1 Software Defined Radio library

## Files
file | pi4cxpsk.h
| Osmocom GMR-1 pi2-CBPSK, pi4-CBPSK and pi4-CQPSK modulation support header.
file | pi4cxpsk.c
| Osmocom GMR-1 pi2-CBPSK, pi4-CBPSK and pi4-CQPSK modulation support implementation.

## Data Structures
struct | gmr1_pi4cxpsk_symbol
| pi4-CxPSK symbol description More...
struct | gmr1_pi4cxpsk_modulation
| pi4-CxPSK modulation description More...
struct | gmr1_pi4cxpsk_sync
| pi4-CxPSK Synchronization sequence segment description More...
struct | gmr1_pi4cxpsk_data
| pi4-CxPSK Data segment description More...
struct | gmr1_pi4cxpsk_burst
| pi4-CxPSK Burst format description More...

## Macros
#define | GMR1_MAX_SYM_EBITS 2
| Max e bits in a symbol.
#define | GMR1_MAX_SYNC 4
| Max diff. sync seqs
#define | GMR1_MAX_SYNC_SYMS 32
| Max sym in a sync seq

## Functions
int | gmr1_pi4cxpsk_demod (struct gmr1_pi4cxpsk_burst *burst_type, struct osmo_cxvec *burst_in, int sps, float freq_shift, sbit_t *ebits, int *sync_id_p, float *toa_p, float *freq_err_p)
| All-in-one pi4-CxPSK demodulation method. More...
int | gmr1_pi4cxpsk_detect (struct gmr1_pi4cxpsk_burst **burst_types, float e_toa, struct osmo_cxvec *burst_in, int sps, float freq_shift, int *bt_id_p, int *sync_id_p, float *toa_p)
| Try to identify burst type by matching training sequences. More...
int | gmr1_pi4cxpsk_mod_order (struct osmo_cxvec *burst_in, int sps, float freq_shift)
| Estimates modulation order by comparing power of x^2 vs x^4. More...
int | gmr1_pi4cxpsk_mod (struct gmr1_pi4cxpsk_burst *burst_type, ubit_t *ebits, int sync_id, struct osmo_cxvec *burst_out)
| Modulates (currently at 1 sps) More...

## Variables
struct gmr1_pi4cxpsk_modulation | gmr1_pi2cbpsk
| pi2-CBPSK modulation description
struct gmr1_pi4cxpsk_modulation | gmr1_pi4cbpsk
| pi4-CBPSK modulation description
struct gmr1_pi4cxpsk_modulation | gmr1_pi4cqpsk
| pi4-CQPSK modulation description
struct gmr1_pi4cxpsk_modulation | gmr1_pi2cbpsk
| pi2-CBPSK modulation description More...
struct gmr1_pi4cxpsk_modulation | gmr1_pi4cbpsk
| pi4-CBPSK modulation description More...
struct gmr1_pi4cxpsk_modulation | gmr1_pi4cqpsk
| pi4-CQPSK modulation description More...

## Detailed Description

## Function Documentation

## ◆ gmr1_pi4cxpsk_demod()

int gmr1_pi4cxpsk_demod | ( | struct gmr1_pi4cxpsk_burst * | burst_type,
|  | struct osmo_cxvec * | burst_in,
|  | int | sps,
|  | float | freq_shift,
|  | sbit_t * | ebits,
|  | int * | sync_id_p,
|  | float * | toa_p,
|  | float * | freq_err_p
| ) |  |

All-in-one pi4-CxPSK demodulation method.

Parameters

  [in] | burst_type | Burst format description
  [in] | burst_in | Complex signal of the burst
  [in] | sps | Oversampling used in the input complex signal
  [in] | freq_shift | Frequency shift to pre-apply to burst_in (rad/sym)
  [out] | ebits | Encoded soft bits return array
  [out] | sync_id_p | Pointer to sync sequence id return variable
  [out] | toa_p | Pointer to TOA return variable
  [out] | freq_err_p | Pointer to frequency error return variable (rad/sym)

Returns
  0 for success. -errno for errors

burst_in is expected to be longer than necessary. Any extra length will be used as 'search window' to find proper alignement. Good practice is to have a few samples too much in front and a few samples after the expected TOA.

## ◆ gmr1_pi4cxpsk_detect()

int gmr1_pi4cxpsk_detect | ( | struct gmr1_pi4cxpsk_burst ** | burst_types,
|  | float | e_toa,
|  | struct osmo_cxvec * | burst_in,
|  | int | sps,
|  | float | freq_shift,
|  | int * | bt_id_p,
|  | int * | sync_id_p,
|  | float * | toa_p
| ) |  |

Try to identify burst type by matching training sequences.

Parameters

  [in] | burst_types | Array of burst types to test (NULL terminated)
  [in] | e_toa | Expected time of arrival
  [in] | burst_in | Complex signal of the burst
  [in] | sps | Oversampling used in the input complex signal
  [in] | freq_shift | Frequency shift to pre-apply to burst_in (rad/sym)
  [out] | bt_id_p | Pointer to burst type ID return variable
  [out] | sync_id_p | Pointer to sync sequence id return variable
  [out] | toa_p | Pointer to TOA return variable

Returns
  -errno for errors, 0 for success

The various burst types must be compatible in length and modulation !

References osmo_cxvec_sig_normalize(), and gmr1_pi4cxpsk_modulation::rotation.

## ◆ gmr1_pi4cxpsk_mod()

int gmr1_pi4cxpsk_mod | ( | struct gmr1_pi4cxpsk_burst * | burst_type,
|  | ubit_t * | ebits,
|  | int | sync_id,
|  | struct osmo_cxvec * | burst_out
| ) |  |

Modulates (currently at 1 sps)

Parameters

  [in] | burst_type | Burst format description
  [in] | ebits | Encoded hard bits to pack in the burst
  [in] | sync_id | The sequence id to use (0 if burst_type only has one)
  [out] | burst_out | Complex signal to fill with modulated symbols

Returns
  0 for success. -errno for errors

burst_out is expected to be long enough to contains the resulting symbols see the burst_type structure for how long that is.

References osmo_cxvec::len, gmr1_pi4cxpsk_burst::len, osmo_cxvec::max_len, and gmr1_pi4cxpsk_burst::mod.

## ◆ gmr1_pi4cxpsk_mod_order()

int gmr1_pi4cxpsk_mod_order | ( | struct osmo_cxvec * | burst_in,
|  | int | sps,
|  | float | freq_shift
| ) |  |

Estimates modulation order by comparing power of x^2 vs x^4.

Parameters

  [in] | burst_in | Complex signal of the burst
  [in] | sps | Oversampling used in the input complex signal
  [in] | freq_shift | Frequency shift to pre-apply to burst_in (rad/sym)

Returns
  <0 for error. 2 for BPSK, 4 for QPSK.

Since x^4 only make sense for pi/4 variant, the pi/4 counter rotation is always applied.

References M_PIf, and osmo_cxvec_sig_normalize().

## Variable Documentation

## ◆ gmr1_pi2cbpsk

struct gmr1_pi4cxpsk_modulation gmr1_pi2cbpsk

Initial value:
= {
.rotation = M_PIf/2,
.nbits = 1,
.syms = gmr1_piNcbpsk_syms_bits,
.bits = gmr1_piNcbpsk_syms_bits,
}
M_PIf
#define M_PIf
Value of pi as a float.
Definition: private.h:118

pi2-CBPSK modulation description

## ◆ gmr1_pi4cbpsk

struct gmr1_pi4cxpsk_modulation gmr1_pi4cbpsk

Initial value:
= {
.rotation = M_PIf/4,
.nbits = 1,
.syms = gmr1_piNcbpsk_syms_bits,
.bits = gmr1_piNcbpsk_syms_bits,
}

pi4-CBPSK modulation description

## ◆ gmr1_pi4cqpsk

struct gmr1_pi4cxpsk_modulation gmr1_pi4cqpsk

Initial value:
= {
.rotation = M_PIf/4,
.nbits = 2,
.syms = gmr1_pi4cqpsk_syms,
.bits = gmr1_pi4cqpsk_bits,
}

pi4-CQPSK modulation description