hamnet70/impl/src/config.h
Thomas Kolb f5a367464f Optimized one-shot frequency synchronization
- Ramp-up length increased to 128 symbols (here is room for
  improvement!)
- Try to detect the frequency once during ramp-up. To do so, every
  second symbol is inverted (to remove the +/-1 symbol toggling) and the
  phase difference between neigboring resulting symbols is checked. When
  it is low enough for all symbols, the frequency is estimated and
  corrected. When frequency estimation was done, it is not retried for a
  number of incoming symbols in order to allow the timing estimator to
  converge again.
- This approach was verified in a simulated loopback test with frequency
  offset and AWGN.
2023-05-17 22:28:18 +02:00

64 lines
2.1 KiB
C

#ifndef CONFIG_H
#define CONFIG_H
#include <liquid/liquid.h>
/*** TIMING CONFIG ***/
#define TX_SWITCH_BACKOFF_PREAMBLE_MS 500 // only relevant if packet cannot be decoded
#define TX_SWITCH_BACKOFF_END_OF_PACKET_MS 1
#define TX_SWITCH_BACKOFF_AFTER_RX_ON 500 // time the transceiver must stay in RX mode
/*** LAYER 1 CONFIG ***/
#define SYMBOL_RATE 100e3f
#define PAYLOAD_CHANNEL_CODE LIQUID_FEC_CONV_V27P34
#define PAYLOAD_MODULATION LIQUID_MODEM_QAM16
#define HEADER_CHANNEL_CODE LIQUID_FEC_NONE
#define HEADER_MODULATION LIQUID_MODEM_QPSK
#define PAYLOAD_CRC_SCHEME LIQUID_CRC_16
#define PREAMBLE_MSEQ_M 6
#define PREAMBLE_MSEQ_POLY LIQUID_MSEQUENCE_GENPOLY_M6
#define PREAMBLE_MSEQ_INIT 0x00000001
#define RRC_SPS 4 // samples per symbol
#define RRC_DELAY 7 // delay in symbols
#define RRC_BETA 0.2f
#define TRANSMISSION_RAMP_UP_LEN 128 // symbols
#define TRANSMISSION_RAMP_DOWN_LEN 32 // symbols
/*** SDR CONFIG ***/
#define SDR_IS_FULL_DUPLEX 0
#define SDR_OVERSAMPLING 3 // integer factor!
#define SDR_RX_SAMPLING_RATE (SYMBOL_RATE * RRC_SPS * SDR_OVERSAMPLING)
#define SDR_TX_SAMPLING_RATE SDR_RX_SAMPLING_RATE
// actually transmitted or received signal frequencies, NOT the SDR center frequency.
#define SDR_TX_FREQ 434.100e6f
#define SDR_RX_FREQ 434.115e6f
// shift applied in the baseband, to get rid of SDR DC peak. If the value here
// is not 0, software mixing will be done on the received signal.
#define SDR_TX_IF_SHIFT 0.000e6f
#define SDR_RX_IF_SHIFT 0.150e6f
// NOTE: the SDR center frequency will be SDR_RX_FREQ - SDR_RX_IF_SHIFT.
// gain configuration
#define SDR_GAIN_TX_AMP 0.0f // extra power amplifier. Set to 14.0f to activate.
#define SDR_GAIN_TX_LNA 0.0f // normal variable gain amplifier.
#define SDR_GAIN_RX_AMP 0.0f // extra input amplifier. Set to 14.0f to activate.
#define SDR_GAIN_RX_LNA 30.0f // RF variable gain amplifier.
#define SDR_GAIN_RX_VGA 24.0f // Baseband variable gain amplifier.
#endif // CONFIG_H