rjw | 6c1fd8f | 2022-11-30 14:33:01 +0800 | [diff] [blame] | 1 | /*============================================================================*/ |
| 2 | /* eCall ANSI C fixed-point reference source code */ |
| 3 | /* */ |
| 4 | /* File: ecall_modem.h */ |
| 5 | /* Version: 8.6.0 (Rel8) / 9.4.0 (Rel9) */ |
| 6 | /* Date: 2011-02-08 */ |
| 7 | /* Description: modulator and demodulator functions (header file) */ |
| 8 | /*----------------------------------------------------------------------------*/ |
| 9 | |
| 10 | #ifndef ECALL_MODEM_H_ |
| 11 | #define ECALL_MODEM_H_ |
| 12 | |
| 13 | #include "ecall_defines.h" |
| 14 | |
| 15 | |
| 16 | typedef enum { |
| 17 | ModUndef, |
| 18 | Mod3bit4smp, |
| 19 | Mod3bit8smp |
| 20 | } ModType; |
| 21 | |
| 22 | typedef struct { |
| 23 | ModType type; /* identifies modulator type */ |
| 24 | |
| 25 | Int16 bpsym; /* bits per symbol */ |
| 26 | Int16 spmf; /* samples per modulation frame */ |
| 27 | Int16 mfpf; /* modulation frames per frame = PCM_LENGTH/spmf */ |
| 28 | Int16 decpos1; /* position 1st decoding trial */ |
| 29 | Int16 decpos2; /* position 2nd decoding trial */ |
| 30 | Int16 wutperiod; /* wakeup tone period in samples */ |
| 31 | Int16 nfmute1; /* number of muting frames 1st interval */ |
| 32 | Int16 nfmute4; /* number of muting frames 4th interval */ |
| 33 | Int16 nfmuteall; /* number of muting frames total */ |
| 34 | Int16 nfdata; /* number of data frames = NRB_CODE_ARQ/(mfpf*bpsym) */ |
| 35 | |
| 36 | const Int16 *ulPulse; |
| 37 | const Int16 *ulPulseMatch; |
| 38 | const Int16 *mgTable; |
| 39 | const Int16 *wakeupSin; |
| 40 | const Int16 *wakeupCos; |
| 41 | } ModState; |
| 42 | |
| 43 | |
| 44 | /*============================================================================*/ |
| 45 | /* Modem functions */ |
| 46 | /*----------------------------------------------------------------------------*/ |
| 47 | |
| 48 | void SetModState(ModState*, ModType); |
| 49 | |
| 50 | void IvsTransmitter(const ModState*, const Ord1*, Int16*, Int16, Int16); |
| 51 | void PsapReceiver(const ModState*, const Int16*, IntLLR*); |
| 52 | |
| 53 | void SymbolMod(const ModState*, Int16, Int16*); |
| 54 | void SymbolDemod(const ModState*, const Int16*, IntLLR*); |
| 55 | |
| 56 | void Byte2Bit(const Ord8*, Ord1*, Int16); |
| 57 | void Bit2Byte(const Ord1*, Ord8*, Int16); |
| 58 | |
| 59 | Int32 MpyLacc(Int32, Int16); |
| 60 | |
| 61 | #endif |