mirror of https://github.com/drowe67/codec2.git
custom config debugging: dump ofdm config from a FreeDV API function
parent
cfa9cd02e4
commit
b2311e5a96
|
@ -1626,3 +1626,7 @@ unsigned short freedv_gen_crc16(unsigned char *data_p, int length) {
|
|||
|
||||
return crc;
|
||||
}
|
||||
|
||||
void freedv_ofdm_print_info(struct freedv *freedv) {
|
||||
ofdm_print_info(freedv->ofdm);
|
||||
}
|
||||
|
|
|
@ -341,6 +341,9 @@ int freedv_get_bits_per_modem_frame(struct freedv *freedv);
|
|||
int freedv_get_sz_error_pattern(struct freedv *freedv);
|
||||
int freedv_get_protocol_bits(struct freedv *freedv);
|
||||
|
||||
// dump OFDM modem config
|
||||
void freedv_ofdm_print_info(struct freedv *freedv);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -278,8 +278,13 @@ int main(int argc, char *argv[]) {
|
|||
memcpy(ofdm_config.tx_uw, uw, sizeof(uw));
|
||||
memcpy(&ofdm_config.tx_uw[ofdm_config.nuwbits - sizeof(uw)], uw,
|
||||
sizeof(uw));
|
||||
/* set up a trivial Tx band pass filter as a demo */
|
||||
static float tx_bpf[] = {1.0, 1.0, 1.0};
|
||||
ofdm_config.tx_bpf_proto = tx_bpf;
|
||||
ofdm_config.tx_bpf_proto_n = 3;
|
||||
adv.config = (void *)&ofdm_config;
|
||||
freedv = freedv_open_advanced(mode, &adv);
|
||||
freedv_ofdm_print_info(freedv);
|
||||
} else {
|
||||
freedv = freedv_open(mode);
|
||||
}
|
||||
|
|
|
@ -2669,6 +2669,11 @@ void ofdm_print_info(struct OFDM *ofdm) {
|
|||
ofdm->phase_est_en ? "true" : "false");
|
||||
fprintf(stderr, "ofdm->tx_bpf_en = %s\n", ofdm->tx_bpf_en ? "true" : "false");
|
||||
fprintf(stderr, "ofdm->rx_bpf_en = %s\n", ofdm->rx_bpf_en ? "true" : "false");
|
||||
fprintf(stderr, "ofdm->tx_bpf_proto_n = %d\n", ofdm->tx_bpf_proto_n);
|
||||
fprintf(stderr, "ofdm->tx_bpf_proto:\n");
|
||||
for (int i = 0; i < ofdm->tx_bpf_proto_n; i++)
|
||||
fprintf(stderr, "%f\t", ofdm->tx_bpf_proto[i]);
|
||||
fprintf(stderr, "\n");
|
||||
fprintf(stderr, "ofdm->dpsk_en = %s\n", ofdm->dpsk_en ? "true" : "false");
|
||||
fprintf(stderr, "ofdm->phase_est_bandwidth_mode = %s\n",
|
||||
phase_est_bandwidth_mode[ofdm->phase_est_bandwidth_mode]);
|
||||
|
|
Loading…
Reference in New Issue