kopia lustrzana https://github.com/bristol-seds/pico-tracker
Fixed APRS pre-emphasis using custom FIR filter. Not sure on the deviation yet but it looks good in audacity
rodzic
4fb5a30e5f
commit
c5a01bab25
|
@ -42,11 +42,9 @@
|
|||
/**
|
||||
* The fm deviation setting for the si radio
|
||||
*
|
||||
* See https://github.com/bristol-seds/pico-tracker/blob/master/sim/si_fir_filter/si_fir_filter.ipynb
|
||||
* for the source of these values
|
||||
* More work required to determine this value..
|
||||
*/
|
||||
#define AX25_DEVIATION_MARK 1800 /* 1600 Hz */ /* TODO currently this deviation is used for both mark and space */
|
||||
#define AX25_DEVIATION_SPACE 4800 /* 3000 Hz */
|
||||
#define AX25_DEVIATION 1800 /* corresponds to about ±2.5kHz maybe */
|
||||
|
||||
/**
|
||||
* How often our handler gets called
|
||||
|
|
|
@ -242,6 +242,7 @@ enum {
|
|||
SI_MODEM_TX_NCO_TXOSR_20X = (0x02 << 26),
|
||||
SI_MODEM_FREQ_DEV = 0x0a,
|
||||
SI_MODEM_FREQ_OFFSET = 0x0d,
|
||||
SI_MODEM_TX_FILTER_COEFF8 = 0x0f,
|
||||
SI_MODEM_CLKGEN_BAND = 0x51,
|
||||
SI_MODEM_CLKGEN_SY_SEL_0 = (0x00 << 3), /* low power */
|
||||
SI_MODEM_CLKGEN_SY_SEL_1 = (0x01 << 3), /* default */
|
||||
|
|
|
@ -101,7 +101,7 @@ uint8_t aprs_start(void)
|
|||
/* Encode the information field */
|
||||
/* Compressed Lat/Long position report, no timestamp */
|
||||
uint32_t information_len = sprintf(information,
|
||||
"!%c%s%s%c%s%c/A=%06ld RTTY/434.6U8N2",
|
||||
"!%c%s%s%c%s%c/A=%06ld TESTING",// RTTY/434.6U8N2",
|
||||
APRS_SYMBOL[0], /* Symbol Table ID */
|
||||
compressed_lat,
|
||||
compressed_lon,
|
||||
|
|
|
@ -273,6 +273,25 @@ static void si_trx_modem_set_tx_datarate(uint32_t rate)
|
|||
SI_MODEM_DATA_RATE,
|
||||
rate & 0xFFFFFF);
|
||||
}
|
||||
/**
|
||||
* Writes the coefficients of the modem tx filter
|
||||
*
|
||||
*/
|
||||
static void si_trx_modem_tx_filter_coefficients(uint8_t* coeff_array)
|
||||
{
|
||||
uint8_t buffer[4+9];
|
||||
|
||||
buffer[0] = SI_CMD_SET_PROPERTY;
|
||||
buffer[1] = SI_PROPERTY_GROUP_MODEM; // group
|
||||
buffer[2] = 9;
|
||||
buffer[3] = SI_MODEM_TX_FILTER_COEFF8; // prop
|
||||
/* Write filter coefficents 8 to 0 */
|
||||
for (int i = 0; i < 9; i++) {
|
||||
buffer[4+i] = coeff_array[8-i];
|
||||
}
|
||||
|
||||
_si_trx_transfer(4+9, 0, buffer);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
@ -428,7 +447,10 @@ void si_trx_reset(uint8_t modulation_type, uint32_t frequency,
|
|||
si_trx_set_frequency(frequency, deviation);
|
||||
si_trx_set_tx_power(power);
|
||||
|
||||
si_trx_modem_set_tx_datarate(3000);
|
||||
uint8_t p_si_coeff[] = {0x6, 0x8, 0x1, 0xf2, 0xe4, 0xe7, 0xff, 0x1d, 0x2b};
|
||||
|
||||
si_trx_modem_set_tx_datarate(1600);
|
||||
si_trx_modem_tx_filter_coefficients(p_si_coeff);
|
||||
|
||||
/* RTTY from GPIO1 */
|
||||
si_trx_modem_set_modulation(SI_MODEM_MOD_DIRECT_MODE_SYNC, // ASYNC
|
||||
|
|
|
@ -328,7 +328,7 @@ void telemetry_tick(void) {
|
|||
|
||||
/* Radio on */
|
||||
si_trx_on(SI_MODEM_MOD_TYPE_2GFSK, _aprs_frequency,
|
||||
AX25_DEVIATION_MARK, APRS_POWER);
|
||||
AX25_DEVIATION, APRS_POWER);
|
||||
radio_on = 1;
|
||||
} else {
|
||||
/* Stop immediately */
|
||||
|
|
File diff suppressed because one or more lines are too long
Ładowanie…
Reference in New Issue