From bbc82cb14d2ef172d92b88aca17135de8110b162 Mon Sep 17 00:00:00 2001 From: Zilog80 Date: Sat, 12 Aug 2023 23:36:04 +0200 Subject: [PATCH] dft_detect: add Weathex WxR-301D --- scan/dft_detect.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/scan/dft_detect.c b/scan/dft_detect.c index 01aeeac..32ea4cd 100644 --- a/scan/dft_detect.c +++ b/scan/dft_detect.c @@ -108,8 +108,13 @@ static char imet1rs_header[] = // C34/C50: 2400 baud, 1:2900Hz/0:4800Hz static char c34_preheader[] = -"01010101010101010101010101010101"; // 2900 Hz tone -// dft, dB-max(1000Hz..5000Hz) = 2900Hz ? + "01010101010101010101010101010101"; // 2900 Hz tone + // dft, dB-max(1000Hz..5000Hz) = 2900Hz ? + + +static char weathex_header[] = + "10101010""10101010""10101010" // AA AA AA (preamble) + "00101101""11010100"; //"10101010"; // 2D D4 55/AA typedef struct { @@ -145,6 +150,7 @@ static float set_lpIQ = 0.0; #define tn_MRZ 12 #define tn_MTS01 13 #define tn_C34C50 15 +#define tn_WXR301 16 #define tn_MK2LMS 18 #define tn_IMET5 24 #define tn_IMETa 25 @@ -152,10 +158,10 @@ static float set_lpIQ = 0.0; #define tn_IMET1rs 28 #define tn_IMET1ab 29 -#define Nrs 15 -#define idxIMETafsk 12 -#define idxRS 13 -#define idxI4 14 +#define Nrs 16 +#define idxIMETafsk 13 +#define idxRS 14 +#define idxI4 15 static rsheader_t rs_hdr[Nrs] = { { 2500, 0, 0, dfm_header, 1.0, 0.0, 0.65, 2, NULL, "DFM9", tn_DFM, 0, 1, 0.0, 0.0}, // DFM6: -2 ? { 4800, 0, 0, rs41_header, 0.5, 0.0, 0.70, 2, NULL, "RS41", tn_RS41, 0, 1, 0.0, 0.0}, @@ -168,6 +174,7 @@ static rsheader_t rs_hdr[Nrs] = { { 2400, 0, 0, mrz_header, 1.5, 0.0, 0.80, 2, NULL, "MRZ", tn_MRZ, 0, 1, 0.0, 0.0}, { 1200, 0, 0, mts01_header, 1.0, 0.0, 0.65, 2, NULL, "MTS01", tn_MTS01, 0, 0, 0.0, 0.0}, { 5800, 0, 0, c34_preheader, 1.5, 0.0, 0.80, 2, NULL, "C34C50", tn_C34C50, 0, 2, 0.0, 0.0}, // C34/C50 2900 Hz tone + { 4800, 0, 0, weathex_header, 1.0, 0.0, 0.65, 2, NULL, "WXR301", tn_WXR301, 0, 3, 0.0, 0.0}, { 9600, 0, 0, imet1ab_header, 1.0, 0.0, 0.80, 2, NULL, "IMET1AB", tn_IMET1ab, 1, 3, 0.0, 0.0}, // (rs_hdr[idxAB]) { 9600, 0, 0, imet_preamble, 0.5, 0.0, 0.80, 4, NULL, "IMETafsk", tn_IMETa , 1, 1, 0.0, 0.0}, // IMET1AB, IMET1RS (IQ)IMET4 { 9600, 0, 0, imet1rs_header, 0.5, 0.0, 0.80, 2, NULL, "IMET1RS", tn_IMET1rs, 0, 3, 0.0, 0.0}, // (rs_hdr[idxRS]) IMET4: lpIQ=0 ... @@ -176,6 +183,7 @@ static rsheader_t rs_hdr[Nrs] = { static int idx_MTS01 = -1, idx_C34C50 = -1, + idx_WXR301 = -1, idx_IMET1AB = -1; @@ -1133,6 +1141,9 @@ static int init_buffers() { #ifdef NOC34C50 if ( strncmp(rs_hdr[j].type, "C34C50", 6) == 0 ) idx_C34C50 = j; #endif + #ifdef NOWXR301 + if ( strncmp(rs_hdr[j].type, "WXR301", 5) == 0 ) idx_WXR301 = j; + #endif #ifdef NOIMET1AB if ( strncmp(rs_hdr[j].type, "IMET1AB", 7) == 0 ) idx_IMET1AB = j; #endif @@ -1142,7 +1153,7 @@ static int init_buffers() { rs_hdr[j].spb = sample_rate/(float)rs_hdr[j].sps; rs_hdr[j].hLen = strlen(rs_hdr[j].header); rs_hdr[j].L = rs_hdr[j].hLen * rs_hdr[j].spb + 0.5; - if (j != idx_MTS01 && j != idx_C34C50 && j != idx_IMET1AB) { + if (j != idx_MTS01 && j != idx_C34C50 && j != idx_WXR301 && j != idx_IMET1AB) { if (rs_hdr[j].hLen > hLen) hLen = rs_hdr[j].hLen; if (rs_hdr[j].L > Lmax) Lmax = rs_hdr[j].L; } @@ -1465,6 +1476,7 @@ int main(int argc, char **argv) { if ( j == idx_MTS01 ) continue; // only ifdef NOMTS01 if ( j == idx_C34C50 ) continue; // only ifdef NOC34C50 + if ( j == idx_WXR301 ) continue; // only ifdef NOWXR301 if ( j == idx_IMET1AB ) continue; // only ifdef NOIMET1AB mv0_pos[j] = mv_pos[j];