mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-09-11 17:19:29 +00:00
EPIRB TX application update (#3120)
This commit is contained in:
@@ -46,15 +46,15 @@ void EPIRBTXProcessor::execute(const buffer_c8_t& buffer) {
|
||||
if (mode_bpsk) {
|
||||
// BPSK Manchester beacon signal
|
||||
if (bpsk_pre_count < config_pre_count) {
|
||||
// Pre-count state: send a negative phase carrier during pre-count
|
||||
// Pre-count state: send carrier only during pre-count
|
||||
bpsk_pre_count++;
|
||||
re = i_neg;
|
||||
im = q_neg;
|
||||
re = i_carrier;
|
||||
im = q_carrier;
|
||||
} else if (bpsk_post_count > 0) {
|
||||
// Post-count: send a negative phase carrier during post-count
|
||||
// Post-count: send carrier only during post-count
|
||||
bpsk_post_count++;
|
||||
re = i_neg;
|
||||
im = q_neg;
|
||||
re = i_carrier;
|
||||
im = q_carrier;
|
||||
if (bpsk_post_count >= config_post_count) {
|
||||
// End transmission here
|
||||
byte_index = 0;
|
||||
|
||||
@@ -60,14 +60,17 @@ class EPIRBTXProcessor : public BasebandProcessor {
|
||||
// Size of the frame to send in BPSK mode
|
||||
uint8_t frame_data_len = 0;
|
||||
|
||||
// BPSK parameters: Target phase +/-63° as per COSPAS/SARSAT specifications
|
||||
static constexpr float phase_rad = 63.0f * M_PI / 180.0f;
|
||||
// BPSK parameters: Target phase +/-1.1 RAD as per COSPAS/SARSAT specifications
|
||||
static constexpr float phase_rad = 1.1f;
|
||||
|
||||
// I/Q values for BPSK (positive phase and negative phase)
|
||||
int8_t i_pos = (int8_t)(cos(phase_rad) * 127);
|
||||
int8_t q_pos = (int8_t)(sin(phase_rad) * 127);
|
||||
int8_t i_neg = i_pos;
|
||||
int8_t q_neg = -q_pos;
|
||||
// I/Q values for carrier only
|
||||
static constexpr int8_t i_carrier = 127;
|
||||
static constexpr int8_t q_carrier = 0;
|
||||
|
||||
// COSPAS/SARSAT signal is manchester (2 states per bit) encoded 400 bit/sec
|
||||
static const uint32_t samples_per_halfbit = TONES_SAMPLERATE / 400 / 2;
|
||||
|
||||
Reference in New Issue
Block a user