Skip to content

Commit

Permalink
hack: also demod TCH_C1 uplinks
Browse files Browse the repository at this point in the history
  • Loading branch information
schneider42 committed Dec 12, 2024
1 parent 78e153b commit 321593d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
7 changes: 5 additions & 2 deletions lib/burst_downmix_next_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,10 @@ burst_downmix_next_impl::generate_sync_word(::iridium::direction direction)
//std::vector<gr_complex> uw_dl = { s0, s1, s1, s1, s1, s0, s0, s0, s1, s0, s0, s1 };
//std::vector<gr_complex> uw_dl = { s0, s0, s0, s0, s0, s1, s1, s0, s1, s1, s0, s1 s0, s1, s0, s1, s1, s0, s0, s1, s0, s1, s1, s1, s1, s0, s1, s1, s1, s0, s1, s0, s0};
std::vector<gr_complex> uw_dl = { s1, s1, s0, s1, s1, s0, s1, s0, s1, s0, s1, s1 };//, s0, s0, s1, s0, s1, s1, s1, s1, s0, s1, s1, s1, s0, s1, s0, s0};
std::vector<gr_complex> uw_ul = { s1, s1, s0, s0, s0, s1, s0, s0, s1, s0, s1, s1 };
// 101 000 111 001 10001001
//std::vector<gr_complex> uw_ul = { s1, s0, s1, s0, s0, s0, s1, s1, s1, s0, s0, s1 };
// 01 00 00 00 10 10 00 11 10 01 10001001
std::vector<gr_complex> uw_ul = { s0, s1, s0, s0, s0, s0, s0, s0, s1, s0, s1, s0 };
int i;

if (direction == ::iridium::direction::DOWNLINK) {
Expand Down Expand Up @@ -653,7 +656,7 @@ int burst_downmix_next_impl::process_next_frame(float sample_rate,
float correction;
::iridium::direction direction;

if (max_dl > max_ul || 1) {
if (max_dl > max_ul) {
direction = ::iridium::direction::DOWNLINK;
corr_offset = corr_offset_dl;
correction = correction_dl;
Expand Down
5 changes: 5 additions & 0 deletions lib/iridium.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ enum class direction {
DOWNLINK = 1,
UPLINK = 2,
DOWNLINK_NEXT = 3,
UPLINK_NEXT = 4,
};

const int SYMBOLS_PER_SECOND = 25000;
Expand All @@ -28,4 +29,8 @@ const int UW_UL[] = { 2, 2, 0, 0, 0, 2, 0, 0, 2, 0, 2, 2 };

// std::vector<gr_complex> uw_dl = { s1, s1, s0, s1, s1, s0, s1, s0, s1, s0, s1, s1 };//, s0, s0, s1, s0, s1, s1, s1, s1, s0, s1, s1, s1, s0, s1, s0, s0};
const int UW_DL_NEXT[] = { 2, 2, 0, 2, 2, 0, 2, 0, 2, 0, 2, 2 };
// std::vector<gr_complex> uw_ul = { s1, s0, s1, s0, s0, s0, s1, s1, s1, s0, s0, s1 };
//const int UW_UL_NEXT[] = { 2, 0, 2, 0, 0, 2, 2, 2, 2, 0, 0, 2 };
// std::vector<gr_complex> uw_ul = { s0, s1, s0, s0, s0, s0, s0, s0, s1, s0, s1, s0 };
const int UW_UL_NEXT[] = { 0, 2, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0 };
} // namespace iridium
9 changes: 8 additions & 1 deletion lib/iridium_qpsk_demod_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,11 @@ bool iridium_qpsk_demod_impl::check_sync_word(int* demodulated_burst,
uw_len = sizeof(::iridium::UW_DL) / sizeof(*::iridium::UW_DL);
}

if (direction == ::iridium::direction::UPLINK_NEXT) {
uw = ::iridium::UW_UL_NEXT;
uw_len = sizeof(::iridium::UW_UL_NEXT) / sizeof(*::iridium::UW_UL_NEXT);
}

int diffs = 0;
for (int i = 0; i < uw_len; i++) {
int diff = abs(demodulated_burst[i] - uw[i]);
Expand Down Expand Up @@ -390,9 +395,11 @@ void iridium_qpsk_demod_impl::handler(int channel, pmt::pmt_t msg)
check_sync_word(d_demodulated_burst, n_symbols, ::iridium::direction::UPLINK);
bool dl_next_uw_ok =
check_sync_word(d_demodulated_burst, n_symbols, ::iridium::direction::DOWNLINK_NEXT);
bool ul_next_uw_ok =
check_sync_word(d_demodulated_burst, n_symbols, ::iridium::direction::UPLINK_NEXT);
d_n_handled_bursts++;

if (!dl_uw_ok && !ul_uw_ok && !dl_next_uw_ok) {
if (!dl_uw_ok && !ul_uw_ok && !dl_next_uw_ok && !ul_next_uw_ok) {
// Drop frames which have no valid sync word
return;
}
Expand Down

0 comments on commit 321593d

Please sign in to comment.