pull/1/head
Wojciech Kaczmarski 2022-02-11 21:05:53 +01:00 zatwierdzone przez GitHub
rodzic dbb1405363
commit e385c2bd69
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 103 dodań i 91 usunięć

Wyświetl plik

@ -159,7 +159,7 @@ void pack_LSF(uint8_t* dest, struct LSF *lsf_in, uint8_t crc_too)
//pack Frame //pack Frame
//arg1: output array of packed bytes //arg1: output array of packed bytes
//arg2: frame counter (16-bit) //arg2: FN (frame number, 16-bit)
//arg3: LSF struct //arg3: LSF struct
//arg4: payload (packed array of bytes) //arg4: payload (packed array of bytes)
void pack_Frame(uint8_t* dest, uint16_t frame_cnt, struct LSF *lsf_in, uint8_t *payload) void pack_Frame(uint8_t* dest, uint16_t frame_cnt, struct LSF *lsf_in, uint8_t *payload)
@ -206,18 +206,35 @@ void pack_Frame(uint8_t* dest, uint16_t frame_cnt, struct LSF *lsf_in, uint8_t *
break; break;
} }
packed_LSF_chunk[5]=lich_cnt<<5; packed_LSF_chunk[5]=lich_cnt<<5; //5 LSBs are reserved (don't care)
//time to Golay encode the LICH contents (48->96 bits) //time to Golay encode the LICH contents (48->96 bits)
uint8_t golay_encoded_LICH[12]; uint8_t golay_encoded_LICH[12]; //packet bytes, 96 total
uint32_t g_enc[4]; uint32_t g_enc[4]; //24-bit parts
g_enc[0]=golay_coding(packed_LSF_chunk[0]|((packed_LSF_chunk[1]&0x0F)<<8)); g_enc[0]=golay_coding(packed_LSF_chunk[0]|((packed_LSF_chunk[1]&0x0F)<<8));
g_enc[1]=golay_coding(((packed_LSF_chunk[1]&0xF0)>>4)|(packed_LSF_chunk[2]<<4)); g_enc[1]=golay_coding(((packed_LSF_chunk[1]&0xF0)>>4)|(packed_LSF_chunk[2]<<4));
g_enc[2]=golay_coding(packed_LSF_chunk[3]|((packed_LSF_chunk[4]&0x0F)<<8)); g_enc[2]=golay_coding(packed_LSF_chunk[3]|((packed_LSF_chunk[4]&0x0F)<<8));
g_enc[3]=golay_coding(((packed_LSF_chunk[4]&0xF0)>>4)|(packed_LSF_chunk[5]<<4)); g_enc[3]=golay_coding(((packed_LSF_chunk[4]&0xF0)>>4)|(packed_LSF_chunk[5]<<4));
; //the byte order is just my guess...
golay_encoded_LICH[0]=g_enc[0]&0xFF;
golay_encoded_LICH[1]=(g_enc[0]>>8)&0xFF;
golay_encoded_LICH[2]=(g_enc[0]>>16)&0xFF;
golay_encoded_LICH[3]=g_enc[1]&0xFF;
golay_encoded_LICH[4]=(g_enc[1]>>8)&0xFF;
golay_encoded_LICH[5]=(g_enc[1]>>16)&0xFF;
golay_encoded_LICH[6]=g_enc[2]&0xFF;
golay_encoded_LICH[7]=(g_enc[2]>>8)&0xFF;
golay_encoded_LICH[8]=(g_enc[2]>>16)&0xFF;
golay_encoded_LICH[9]=g_enc[3]&0xFF;
golay_encoded_LICH[10]=(g_enc[3]>>8)&0xFF;
golay_encoded_LICH[11]=(g_enc[3]>>16)&0xFF;
//move to the destination
memcpy(&dest[0], golay_encoded_LICH, 12);
memcpy(&dest[12], (uint8_t*)&frame_cnt, 2);
memcpy(&dest[14], payload, 16);
} }
uint16_t CRC_LSF(struct LSF *lsf_in) uint16_t CRC_LSF(struct LSF *lsf_in)

Wyświetl plik

@ -1,93 +1,88 @@
#ifndef RRC_TAPS #ifndef RRC_TAPS
#define RRC_TAPS #define RRC_TAPS
//taps below are for f_s=48kHz
//10 samples per symbol
//calculated by Rob Riggs, WX9O
const float rrc_coeffs[81]={ const float rrc_coeffs[81]={
-0.0031957, -0.003195702904062,
-0.00293028, -0.002930279157647,
-0.00194067, -0.001940667871554,
-0.000356088, -0.000356087678024,
0.00154701, 0.001547011339078,
0.00338955, 0.003389554791180,
0.0047619, 0.004761898604226,
0.00531086, 0.005310860846139,
0.00482475, 0.004824746306020,
0.00329792, 0.003297923526849,
0.000958711, 0.000958710871219,
-0.00174991, -0.001749908029792,
-0.00423869, -0.004238694106631,
-0.00588178, -0.005881783042102,
-0.00615026, -0.006150256456781,
-0.00474538, -0.004745376707652,
-0.00170419, -0.001704189656474,
0.00254785, 0.002547854551540,
0.00721558, 0.007215575568845,
0.011231, 0.011231038205364,
0.013422, 0.013421952197061,
0.0127305, 0.012730475385624,
0.00844955, 0.008449554307304,
0.000436744, 0.000436744366018,
-0.0107354, -0.010735380379192,
-0.0237269, -0.023726883538258,
-0.036498, -0.036498030780605,
-0.0465009, -0.046500883189991,
-0.0509791, -0.050979050576000,
-0.0473407, -0.047340680079891,
-0.0335549, -0.033554880492652,
-0.00851382, -0.008513823955726,
0.0276965, 0.027696543159614,
0.0736645, 0.073664520037517,
0.126689, 0.126689053778116,
0.182991, 0.182990955139334,
0.23808, 0.238080025892860,
0.287236, 0.287235637987092,
0.32604, 0.326040247765297,
0.350896, 0.350895727088113,
0.359453, 0.359452932027608,
0.350896, 0.350895727088113,
0.32604, 0.326040247765297,
0.287236, 0.287235637987092,
0.23808, 0.238080025892860,
0.182991, 0.182990955139334,
0.126689, 0.126689053778116,
0.0736645, 0.073664520037517,
0.0276965, 0.027696543159614,
-0.00851382, -0.008513823955726,
-0.0335549, -0.033554880492652,
-0.0473407, -0.047340680079891,
-0.0509791, -0.050979050576000,
-0.0465009, -0.046500883189991,
-0.036498, -0.036498030780605,
-0.0237269, -0.023726883538258,
-0.0107354, -0.010735380379192,
0.000436744, 0.000436744366018,
0.00844955, 0.008449554307304,
0.0127305, 0.012730475385624,
0.013422, 0.013421952197061,
0.011231, 0.011231038205364,
0.00721558, 0.007215575568845,
0.00254785, 0.002547854551540,
-0.00170419, -0.001704189656474,
-0.00474538, -0.004745376707652,
-0.00615026, -0.006150256456781,
-0.00588178, -0.005881783042102,
-0.00423869, -0.004238694106631,
-0.00174991, -0.001749908029792,
0.000958711, 0.000958710871219,
0.00329792, 0.003297923526849,
0.00482475, 0.004824746306020,
0.00531086, 0.005310860846139,
0.0047619, 0.004761898604226,
0.00338955, 0.003389554791180,
0.00154701, 0.001547011339078,
-0.000356088, -0.000356087678024,
-0.00194067, -0.001940667871554,
-0.00293028, -0.002930279157647,
-0.0031957, -0.003195702904062
}; };
#endif #endif