Skip to content

Commit

Permalink
custom config debugging: dump ofdm config from a FreeDV API function
Browse files Browse the repository at this point in the history
  • Loading branch information
drowe67 committed May 3, 2024
1 parent cfa9cd0 commit b2311e5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/freedv_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
3 changes: 3 additions & 0 deletions src/freedv_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions src/freedv_data_raw_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
5 changes: 5 additions & 0 deletions src/ofdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit b2311e5

Please sign in to comment.