osmo-gmr 0.2.104-2b98
Osmocom GMR-1
pi4cxpsk.h
Go to the documentation of this file.
1/* GMR-1 SDR - pi2-CBPSK, pi4-CBPSK and pi4-CQPSK modulation support */
2/* See GMR-1 05.004 (ETSI TS 101 376-5-4 V1.2.1) - Section 5.1 & 5.2 */
3
4/* (C) 2011-2019 by Sylvain Munaut <tnt@246tNt.com>
5 * All Rights Reserved
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Affero General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Affero General Public License for more details.
16 *
17 * You should have received a copy of the GNU Affero General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef __OSMO_GMR1_SDR_PI4CXPSK_H__
22#define __OSMO_GMR1_SDR_PI4CXPSK_H__
23
33#include <stdint.h>
34#include <osmocom/core/bits.h>
35#include <osmocom/dsp/cxvec.h>
36
37
38#define GMR1_MAX_SYM_EBITS 2
39#define GMR1_MAX_SYNC 4
40#define GMR1_MAX_SYNC_SYMS 32
45 short idx;
47 float mod_phase;
48 float complex mod_val;
49};
50
53 float rotation;
54 int nbits;
57};
58
59
63
64
67 int pos;
68 int len;
70 struct osmo_cxvec *_ref;
71};
72
75 int pos;
76 int len;
77};
78
83
88
90 int len;
92 int ebits;
93
98};
99
100
101int
103 struct osmo_cxvec *burst_in, int sps, float freq_shift,
104 sbit_t *ebits,
105 int *sync_id_p, float *toa_p, float *freq_err_p);
106
107int
108gmr1_pi4cxpsk_detect(struct gmr1_pi4cxpsk_burst **burst_types, float e_toa,
109 struct osmo_cxvec *burst_in, int sps, float freq_shift,
110 int *bt_id_p, int *sync_id_p, float *toa_p);
111
112int
113gmr1_pi4cxpsk_mod_order(struct osmo_cxvec *burst_in, int sps, float freq_shift);
114
115int
116gmr1_pi4cxpsk_mod(struct gmr1_pi4cxpsk_burst *burst_type,
117 ubit_t *ebits, int sync_id, struct osmo_cxvec *burst_out);
118
119
122#endif /* __OSMO_GMR1_SDR_PI4CXPSK_H__ */
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.
Definition: pi4cxpsk.c:618
struct gmr1_pi4cxpsk_modulation gmr1_pi2cbpsk
pi2-CBPSK modulation description
Definition: pi4cxpsk.c:77
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.
Definition: pi4cxpsk.c:521
#define GMR1_MAX_SYM_EBITS
Max e bits in a symbol.
Definition: pi4cxpsk.h:38
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)
Definition: pi4cxpsk.c:742
struct gmr1_pi4cxpsk_modulation gmr1_pi4cqpsk
pi4-CQPSK modulation description
Definition: pi4cxpsk.c:110
#define GMR1_MAX_SYNC
Max diff. sync seqs
Definition: pi4cxpsk.h:39
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.
Definition: pi4cxpsk.c:694
#define GMR1_MAX_SYNC_SYMS
Max sym in a sync seq
Definition: pi4cxpsk.h:40
struct gmr1_pi4cxpsk_modulation gmr1_pi4cbpsk
pi4-CBPSK modulation description
Definition: pi4cxpsk.c:85
pi4-CxPSK Burst format description
Definition: pi4cxpsk.h:80
int guard_pre
Beginning guard period.
Definition: pi4cxpsk.h:85
int guard_post
End guard period
Definition: pi4cxpsk.h:87
struct gmr1_pi4cxpsk_sync * sync[GMR1_MAX_SYNC]
Sync sequences.
Definition: pi4cxpsk.h:95
struct gmr1_pi4cxpsk_data * data
Data chunks.
Definition: pi4cxpsk.h:97
int ebits
Number of encoded bits.
Definition: pi4cxpsk.h:92
struct gmr1_pi4cxpsk_modulation * mod
Modulation scheme
Definition: pi4cxpsk.h:82
int len
Total len with guard.
Definition: pi4cxpsk.h:90
pi4-CxPSK Data segment description
Definition: pi4cxpsk.h:74
int len
Data chunk length
Definition: pi4cxpsk.h:76
int pos
Data chunk position
Definition: pi4cxpsk.h:75
pi4-CxPSK modulation description
Definition: pi4cxpsk.h:52
struct gmr1_pi4cxpsk_symbol * bits
Symbols (bit order)
Definition: pi4cxpsk.h:56
float rotation
rotation per symbol
Definition: pi4cxpsk.h:53
int nbits
ebits/sym
Definition: pi4cxpsk.h:54
struct gmr1_pi4cxpsk_symbol * syms
Symbols (sym order)
Definition: pi4cxpsk.h:55
pi4-CxPSK symbol description
Definition: pi4cxpsk.h:44
ubit_t data[GMR1_MAX_SYM_EBITS]
Encoded data bits
Definition: pi4cxpsk.h:46
float complex mod_val
e^(1j*mod_phase)
Definition: pi4cxpsk.h:48
short idx
Symbol number
Definition: pi4cxpsk.h:45
float mod_phase
Phase used during mod.
Definition: pi4cxpsk.h:47
pi4-CxPSK Synchronization sequence segment description
Definition: pi4cxpsk.h:66
struct osmo_cxvec * _ref
Ref signal
Definition: pi4cxpsk.h:70
int len
Sync Length
Definition: pi4cxpsk.h:68
uint8_t syms[GMR1_MAX_SYNC_SYMS]
Sync Symbols
Definition: pi4cxpsk.h:69
int pos
Sync Position
Definition: pi4cxpsk.h:67