]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
new_protocol TX Panadapter changes
authorJohn Melton - G0ORX/N6LYT <john.d.melton@googlemail.com>
Fri, 19 Aug 2016 15:05:19 +0000 (15:05 +0000)
committerJohn Melton - G0ORX/N6LYT <john.d.melton@googlemail.com>
Fri, 19 Aug 2016 15:05:19 +0000 (15:05 +0000)
Makefile
main.c
panadapter.c
pihpsdr
release/pihpsdr.tar
release/pihpsdr/pihpsdr
wdsp_init.c

index 83f900bf0064fca9ec78ca2018034fd70a2b85f8..3da5170b942bb5c720dfb2346eaaa8bc9e9c4be3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,7 @@ UNAME_N=raspberrypi
 CC=gcc
 LINK=gcc
 
-# uncomment the line below for various denug facilities
+# uncomment the line below for various debug facilities
 #DEBUG_OPTION=-D DEBUG
 
 # uncomment the line below for LimeSDR (uncomment line below)
diff --git a/main.c b/main.c
index df5448c51d7f9e692f6983cdf3070ec100052005..ac0427c969b308ff264f3c6ff4f664f7ca6db526 100644 (file)
--- a/main.c
+++ b/main.c
@@ -508,7 +508,11 @@ fprintf(stderr,"protocol=%d name=%s\n",d->protocol,d->name);
 
   radioRestoreState();
 
-  samples=malloc(display_width*sizeof(float)*2);
+  if(protocol==NEW_PROTOCOL) {
+    samples=malloc(display_width*sizeof(float)*2*4); // 192 -> 48
+  } else {
+    samples=malloc(display_width*sizeof(float)*2);
+  }
 
   //splash_status("Initializing wdsp ...");
   wdsp_init(0,display_width,d->protocol);
index 9d34bafdd46616c2d81a4de6a3b6e8abd32774df..8c9608dd7053948c04d49404424db86a0a3a9d88 100644 (file)
@@ -194,11 +194,11 @@ void panadapter_update(float *data,int tx) {
 
                 panadapter_high=20;
                 panadapter_low=-80;
-                if(protocol==ORIGINAL_PROTOCOL) {
+                //if(protocol==ORIGINAL_PROTOCOL) {
                     hz_per_pixel=48000.0/(double)display_width;
-                } else {
-                    hz_per_pixel=192000.0/(double)display_width;
-                }
+                //} else {
+                //    hz_per_pixel=192000.0/(double)display_width;
+                //}
             }
 
             //clear_panadater_surface();
@@ -312,7 +312,7 @@ void panadapter_update(float *data,int tx) {
             }
             
             // agc
-            if(agc!=AGC_OFF) {
+            if(agc!=AGC_OFF && !tx) {
                 double hang=0.0;
                 double thresh=0;
 
@@ -365,17 +365,34 @@ void panadapter_update(float *data,int tx) {
             double s1,s2;
             samples[0]=-200.0;
             samples[display_width-1]=-200.0;
-            s1=(double)samples[0]+(double)get_attenuation()-20.0;
-            s1 = floor((panadapter_high - s1)
-                        * (double) display_height
-                        / (panadapter_high - panadapter_low));
-            cairo_move_to(cr, 0.0, s1);
-            for(i=1;i<display_width;i++) {
-                s2=(double)samples[i]+(double)get_attenuation()-20.0;
-                s2 = floor((panadapter_high - s2)
-                            * (double) display_height
-                            / (panadapter_high - panadapter_low));
-                cairo_line_to(cr, (double)i, s2);
+
+            if(tx && protocol==NEW_PROTOCOL) {
+              int offset=1200;
+              s1=(double)samples[0+offset]+(double)get_attenuation()-20.0;
+              s1 = floor((panadapter_high - s1)
+                          * (double) display_height
+                          / (panadapter_high - panadapter_low));
+              cairo_move_to(cr, 0.0, s1);
+              for(i=1;i<display_width;i++) {
+                  s2=(double)samples[i+offset]+(double)get_attenuation()-20.0;
+                  s2 = floor((panadapter_high - s2)
+                              * (double) display_height
+                              / (panadapter_high - panadapter_low));
+                  cairo_line_to(cr, (double)i, s2);
+              }
+            } else {
+              s1=(double)samples[0]+(double)get_attenuation()-20.0;
+              s1 = floor((panadapter_high - s1)
+                          * (double) display_height
+                          / (panadapter_high - panadapter_low));
+              cairo_move_to(cr, 0.0, s1);
+              for(i=1;i<display_width;i++) {
+                  s2=(double)samples[i]+(double)get_attenuation()-20.0;
+                  s2 = floor((panadapter_high - s2)
+                              * (double) display_height
+                              / (panadapter_high - panadapter_low));
+                  cairo_line_to(cr, (double)i, s2);
+              }
             }
             if(display_filled) {
               cairo_close_path (cr);
diff --git a/pihpsdr b/pihpsdr
index 6bafc432f0e94f108ae5bbedeb7cf6bf0c437d96..90ed4ba87c0a423756110806f3009a8ced647ad4 100755 (executable)
Binary files a/pihpsdr and b/pihpsdr differ
index c78b7c04d1f810e577b0b07d7ae308c1435e9e48..1b4e51a53f9ec6aee2e03005b5833a856d8a0bca 100644 (file)
Binary files a/release/pihpsdr.tar and b/release/pihpsdr.tar differ
index 6bafc432f0e94f108ae5bbedeb7cf6bf0c437d96..90ed4ba87c0a423756110806f3009a8ced647ad4 100755 (executable)
Binary files a/release/pihpsdr/pihpsdr and b/release/pihpsdr/pihpsdr differ
index 3884206364585647925ba3e97939efcb327022af..87df8fa43f0938983aa9acbd9797bd814a0340de 100644 (file)
@@ -437,6 +437,9 @@ static void initAnalyzer(int channel,int buffer_size) {
       pixels=spectrumWIDTH;
     }
 #endif
+    if(channel==CHANNEL_TX && protocol==NEW_PROTOCOL) {
+      pixels=spectrumWIDTH*4; // allows 192 -> 48 easy
+    }
     SetAnalyzer(channel,
             n_pixout,
             spur_elimination_ffts, //number of LO frequencies = number of ffts used in elimination