From: Ramakrishnan Muthukrishnan <ram@rkrishnan.org>
Date: Mon, 2 Jan 2023 09:03:06 +0000 (+0530)
Subject: same/restore nr4 properties between reboots
X-Git-Url: https://git.rkrishnan.org/pf/components/vdrive/(%5B%5E?a=commitdiff_plain;h=a04df2eb5bfa2052b70d11b23dfcf84b866c97e9;p=pihpsdr.git

same/restore nr4 properties between reboots
---

diff --git a/receiver.c b/receiver.c
index 29bf9ba..7f2d4c7 100644
--- a/receiver.c
+++ b/receiver.c
@@ -302,6 +302,26 @@ void receiver_save_state(RECEIVER *rx) {
     sprintf(value,"%d",rx->nr4);
     setProperty(name,value);
 
+    sprintf(name,"receiver.%d.nr4_reduction_amount",rx->id);
+    sprintf(value,"%d",rx->nr4_reduction_amount);
+    setProperty(name,value);
+
+    sprintf(name,"receiver.%d.nr4_smoothing_factor",rx->id);
+    sprintf(value,"%d",rx->nr4_smoothing_factor);
+    setProperty(name,value);
+
+    sprintf(name,"receiver.%d.nr4_whitening_factor",rx->id);
+    sprintf(value,"%d",rx->nr4_whitening_factor);
+    setProperty(name,value);
+
+    sprintf(name,"receiver.%d.nr4_noise_rescale",rx->id);
+    sprintf(value,"%d",rx->nr4_noise_rescale);
+    setProperty(name,value);
+
+    sprintf(name,"receiver.%d.nr4_post_filter_threshold",rx->id);
+    sprintf(value,"%d",rx->nr4_post_filter_threshold);
+    setProperty(name,value);
+
     sprintf(name,"receiver.%d.anf",rx->id);
     sprintf(value,"%d",rx->anf);
     setProperty(name,value);
@@ -527,6 +547,26 @@ g_print("%s: id=%d\n",__FUNCTION__,rx->id);
     value=getProperty(name);
     if(value) rx->nr4=atoi(value);
 
+    sprintf(name,"receiver.%d.nr4_reduction_amount",rx->id);
+    value=getProperty(name);
+    if(value) rx->nr4_reduction_amount = atoi(value);
+
+    sprintf(name,"receiver.%d.nr4_smoothing_factor",rx->id);
+    value=getProperty(name);
+    if(value) rx->nr4_smoothing_factor = atoi(value);
+
+    sprintf(name,"receiver.%d.nr4_whitening_factor",rx->id);
+    value=getProperty(name);
+    if(value) rx->nr4_whitening_factor = atoi(value);
+
+    sprintf(name,"receiver.%d.nr4_noise_rescale",rx->id);
+    value=getProperty(name);
+    if(value) rx->nr4_noise_rescale = atoi(value);
+
+    sprintf(name,"receiver.%d.nr4_post_filter_threshold",rx->id);
+    value=getProperty(name);
+    if(value) rx->nr4_post_filter_threshold = atoi(value);
+
     sprintf(name,"receiver.%d.anf",rx->id);
     value=getProperty(name);
     if(value) rx->anf=atoi(value);