From 01439076b2f2aa7facbdb57a1eef50da9b2512ca Mon Sep 17 00:00:00 2001
From: dttsp <dttsp>
Date: Fri, 3 Jun 2005 15:13:30 +0000
Subject: [PATCH] Small rearrangement in tx to put compansion before filtering

---
 jDttSP/sdr.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/jDttSP/sdr.c b/jDttSP/sdr.c
index 9374813..178e991 100644
--- a/jDttSP/sdr.c
+++ b/jDttSP/sdr.c
@@ -313,12 +313,12 @@ setup_tx(void) {
 			     CXBbase(tx.buf.o));
   tx.agc.flag = TRUE;
 
-  tx.spr.gen = newSpeechProc(0.4, 10.0, CXBbase(tx.buf.o), CXBsize(tx.buf.o));
+  tx.spr.gen = newSpeechProc(0.4, 10.0, CXBbase(tx.buf.i), CXBsize(tx.buf.o));
   tx.spr.flag = FALSE;
 
   tx.cpd.gen = newWSCompander(uni.cpdlen,
 			      0.0,
-			      tx.buf.o);
+			      tx.buf.i);
   tx.cpd.flag = FALSE;
 
   tx.scl.dc = cxzero;
@@ -485,7 +485,7 @@ do_tx_meter(CXB buf, int tap) {
   case PWR:
     for(i = 0, uni.meter.tx.val[tap] = 1e-20; i < CXBhave(tx.buf.o); i++)
       uni.meter.tx.val[tap] += Csqrmag(CXBdata(tx.buf.o, i));
-    uni.meter.tx.val[tap] /= 2048.0;
+    uni.meter.tx.val[tap] /= uni.buflen;
     break;
   case PKPWR:
     for(i = 0, uni.meter.tx.val[tap] = 1e-20; i < CXBhave(tx.buf.o); i++) 
@@ -740,6 +740,9 @@ do_tx_pre(void) {
 
   if (tx.dcb.flag) DCBlock(tx.dcb.gen);
 
+  if (tx.spr.flag) SpeechProcessor(tx.spr.gen);
+  if (tx.cpd.flag) WSCompand(tx.cpd.gen);
+
   if (tx.tick == 0) reset_OvSv(tx.filt.ovsv);
   filter_OvSv(tx.filt.ovsv);
 
@@ -761,9 +764,6 @@ do_tx_post(void) {
       CXBdata(tx.buf.o, i) = Cscl(CXBdata(tx.buf.o, i), tx.scl.post.val);
   }
 
-  if (tx.spr.flag) SpeechProcessor(tx.spr.gen);
-  if (tx.cpd.flag) WSCompand(tx.cpd.gen);
-
   if (uni.spec.flag)
     do_tx_spectrum(tx.buf.o);
 
-- 
2.45.2