aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrowe67 <[email protected]>2024-05-04 07:16:26 +0930
committerDavid Rowe <[email protected]>2024-05-04 07:16:26 +0930
commitb2311e5a967e09e5b293578bb596c83c50af536d (patch)
treedeaf61be8918a4333b51e14848c6afa5d318c26e /src
parentcfa9cd02e44652cdf625cbed729bd15905045523 (diff)
custom config debugging: dump ofdm config from a FreeDV API function
Diffstat (limited to 'src')
-rw-r--r--src/freedv_api.c4
-rw-r--r--src/freedv_api.h3
-rw-r--r--src/freedv_data_raw_tx.c5
-rw-r--r--src/ofdm.c5
4 files changed, 17 insertions, 0 deletions
diff --git a/src/freedv_api.c b/src/freedv_api.c
index d04dd7c..3c812ca 100644
--- a/src/freedv_api.c
+++ b/src/freedv_api.c
@@ -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);
+}
diff --git a/src/freedv_api.h b/src/freedv_api.h
index 9f72c8f..0ca80ce 100644
--- a/src/freedv_api.h
+++ b/src/freedv_api.h
@@ -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
diff --git a/src/freedv_data_raw_tx.c b/src/freedv_data_raw_tx.c
index ce5da56..7fa1e84 100644
--- a/src/freedv_data_raw_tx.c
+++ b/src/freedv_data_raw_tx.c
@@ -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);
}
diff --git a/src/ofdm.c b/src/ofdm.c
index 8d7a6df..953179f 100644
--- a/src/ofdm.c
+++ b/src/ofdm.c
@@ -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]);