Skip to content

Commit 321593d

Browse files
committed
hack: also demod TCH_C1 uplinks
1 parent 78e153b commit 321593d

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

lib/burst_downmix_next_impl.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,10 @@ burst_downmix_next_impl::generate_sync_word(::iridium::direction direction)
228228
//std::vector<gr_complex> uw_dl = { s0, s1, s1, s1, s1, s0, s0, s0, s1, s0, s0, s1 };
229229
//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};
230230
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};
231-
std::vector<gr_complex> uw_ul = { s1, s1, s0, s0, s0, s1, s0, s0, s1, s0, s1, s1 };
231+
// 101 000 111 001 10001001
232+
//std::vector<gr_complex> uw_ul = { s1, s0, s1, s0, s0, s0, s1, s1, s1, s0, s0, s1 };
233+
// 01 00 00 00 10 10 00 11 10 01 10001001
234+
std::vector<gr_complex> uw_ul = { s0, s1, s0, s0, s0, s0, s0, s0, s1, s0, s1, s0 };
232235
int i;
233236

234237
if (direction == ::iridium::direction::DOWNLINK) {
@@ -653,7 +656,7 @@ int burst_downmix_next_impl::process_next_frame(float sample_rate,
653656
float correction;
654657
::iridium::direction direction;
655658

656-
if (max_dl > max_ul || 1) {
659+
if (max_dl > max_ul) {
657660
direction = ::iridium::direction::DOWNLINK;
658661
corr_offset = corr_offset_dl;
659662
correction = correction_dl;

lib/iridium.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ enum class direction {
66
DOWNLINK = 1,
77
UPLINK = 2,
88
DOWNLINK_NEXT = 3,
9+
UPLINK_NEXT = 4,
910
};
1011

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

2930
// 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};
3031
const int UW_DL_NEXT[] = { 2, 2, 0, 2, 2, 0, 2, 0, 2, 0, 2, 2 };
32+
// std::vector<gr_complex> uw_ul = { s1, s0, s1, s0, s0, s0, s1, s1, s1, s0, s0, s1 };
33+
//const int UW_UL_NEXT[] = { 2, 0, 2, 0, 0, 2, 2, 2, 2, 0, 0, 2 };
34+
// std::vector<gr_complex> uw_ul = { s0, s1, s0, s0, s0, s0, s0, s0, s1, s0, s1, s0 };
35+
const int UW_UL_NEXT[] = { 0, 2, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0 };
3136
} // namespace iridium

lib/iridium_qpsk_demod_impl.cc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,11 @@ bool iridium_qpsk_demod_impl::check_sync_word(int* demodulated_burst,
306306
uw_len = sizeof(::iridium::UW_DL) / sizeof(*::iridium::UW_DL);
307307
}
308308

309+
if (direction == ::iridium::direction::UPLINK_NEXT) {
310+
uw = ::iridium::UW_UL_NEXT;
311+
uw_len = sizeof(::iridium::UW_UL_NEXT) / sizeof(*::iridium::UW_UL_NEXT);
312+
}
313+
309314
int diffs = 0;
310315
for (int i = 0; i < uw_len; i++) {
311316
int diff = abs(demodulated_burst[i] - uw[i]);
@@ -390,9 +395,11 @@ void iridium_qpsk_demod_impl::handler(int channel, pmt::pmt_t msg)
390395
check_sync_word(d_demodulated_burst, n_symbols, ::iridium::direction::UPLINK);
391396
bool dl_next_uw_ok =
392397
check_sync_word(d_demodulated_burst, n_symbols, ::iridium::direction::DOWNLINK_NEXT);
398+
bool ul_next_uw_ok =
399+
check_sync_word(d_demodulated_burst, n_symbols, ::iridium::direction::UPLINK_NEXT);
393400
d_n_handled_bursts++;
394401

395-
if (!dl_uw_ok && !ul_uw_ok && !dl_next_uw_ok) {
402+
if (!dl_uw_ok && !ul_uw_ok && !dl_next_uw_ok && !ul_next_uw_ok) {
396403
// Drop frames which have no valid sync word
397404
return;
398405
}

0 commit comments

Comments
 (0)