commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r4807 - in gnuradio/branches/developers/trondeau/cvsd/


From: trondeau
Subject: [Commit-gnuradio] r4807 - in gnuradio/branches/developers/trondeau/cvsd/gr-cvsd-vocoder: . src src/lib src/python
Date: Wed, 28 Mar 2007 10:41:14 -0600 (MDT)

Author: trondeau
Date: 2007-03-28 10:41:13 -0600 (Wed, 28 Mar 2007)
New Revision: 4807

Modified:
   gnuradio/branches/developers/trondeau/cvsd/gr-cvsd-vocoder/
   gnuradio/branches/developers/trondeau/cvsd/gr-cvsd-vocoder/src/
   gnuradio/branches/developers/trondeau/cvsd/gr-cvsd-vocoder/src/lib/
   
gnuradio/branches/developers/trondeau/cvsd/gr-cvsd-vocoder/src/lib/cvsd_decode_bs.cc
   
gnuradio/branches/developers/trondeau/cvsd/gr-cvsd-vocoder/src/lib/cvsd_decode_bs.h
   
gnuradio/branches/developers/trondeau/cvsd/gr-cvsd-vocoder/src/lib/cvsd_encode_sb.cc
   
gnuradio/branches/developers/trondeau/cvsd/gr-cvsd-vocoder/src/lib/cvsd_encode_sb.h
   gnuradio/branches/developers/trondeau/cvsd/gr-cvsd-vocoder/src/python/
   
gnuradio/branches/developers/trondeau/cvsd/gr-cvsd-vocoder/src/python/encdec.py
Log:
fixed typos and cleaned up code; vocoding working


Property changes on: gnuradio/branches/developers/trondeau/cvsd/gr-cvsd-vocoder
___________________________________________________________________
Name: svn:ignore
   + Makefile
Makefile.in




Property changes on: 
gnuradio/branches/developers/trondeau/cvsd/gr-cvsd-vocoder/src
___________________________________________________________________
Name: svn:ignore
   + Makefile
Makefile.in



Property changes on: 
gnuradio/branches/developers/trondeau/cvsd/gr-cvsd-vocoder/src/lib
___________________________________________________________________
Name: svn:ignore
   + Makefile
Makefile.in
.libs
.deps
cvsd_vocoder.cc
cvsd_vocoder.py


Modified: 
gnuradio/branches/developers/trondeau/cvsd/gr-cvsd-vocoder/src/lib/cvsd_decode_bs.cc
===================================================================
--- 
gnuradio/branches/developers/trondeau/cvsd/gr-cvsd-vocoder/src/lib/cvsd_decode_bs.cc
        2007-03-28 03:45:42 UTC (rev 4806)
+++ 
gnuradio/branches/developers/trondeau/cvsd/gr-cvsd-vocoder/src/lib/cvsd_decode_bs.cc
        2007-03-28 16:41:13 UTC (rev 4807)
@@ -1,217 +1,196 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2007 Free Software Foundation, Inc.
- * 
- * This file is part of GNU Radio
- * 
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- * 
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with GNU Radio; see the file COPYING.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street,
- * Boston, MA 02110-1301, USA.
- */
-
-/*
- * config.h is generated by configure.  It contains the results
- * of probing for features, options etc.  It should be the first
- * file included in your .cc file.
- */
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <cvsd_decode_bs.h>
-#include <gr_io_signature.h>
-
-/*
- * Create a new instance of cvsd_decode_bs and return
- * a boost shared_ptr.  This is effectively the public constructor.
- */
-cvsd_decode_bs_sptr 
-cvsd_make_decode_bs (short min_step, short max_step, double step_decay,
-                    double accum_decay,  int K, int J,
-                    short pos_accum_max, short neg_accum_max)
-{
-  return cvsd_decode_bs_sptr (new cvsd_decode_bs (min_step, max_step,
-                                                 step_decay, accum_decay, K, J,
-                                                 pos_accum_max, 
neg_accum_max));
-}
-
-cvsd_decode_bs::cvsd_decode_bs (short min_step, short max_step, double 
step_decay, 
-                               double accum_decay, int K, int J,
-                               short pos_accum_max, short neg_accum_max)
-  : gr_sync_interpolator ("cvsd_decode_bs",
-                         gr_make_io_signature (1, 1, sizeof (unsigned char)),
-                         gr_make_io_signature (1, 1, sizeof (short)),
-                         8),
-    d_min_step (min_step), d_max_step(max_step), d_step_decay(step_decay),
-    d_accum_decay(accum_decay), d_K(K), d_J(J), 
-    d_pos_accum_max(pos_accum_max), d_neg_accum_max(neg_accum_max),
-    d_accum(0), 
-    d_loop_counter(1), 
-    d_runner(0),
-    d_runner_mask(0),
-    d_stepsize(min_step)
-  
-{
-  assert(d_pos_accum_max <= SHRT_MAX);
-  assert(d_neg_accum_max >= -SHRT_MAX);
-  assert(d_K <= 32);
-  assert(d_J <= d_K);
-  
-  // nothing else required in this example
-}
-
-
-cvsd_decode_bs::~cvsd_decode_bs ()
-{
-  // nothing else required in this example
-}
-
-unsigned char cvsd_decode_bs::cvsd_bitwise_sum (unsigned int input)
-{
-  unsigned int temp=input;
-  unsigned char bits=0;
-  
-  while(temp) {
-    temp=temp&(temp-1);
-    bits++;
-  }
-  return bits;
-}
-
-short cvsd_decode_bs::cvsd_round (double input)
-{
-  double temp;
-  temp=input+0.5;
-  temp=floor(temp);
-  
-  return (short)temp;
-}
-
-unsigned int cvsd_decode_bs::cvsd_pow (short radix, short power)
-{
-  double d_radix = (double) radix;
-  int i_power = (int) power;
-  double output;
-  
-  output=pow(d_radix,i_power);
-  return ( (unsigned int) cvsd_round(output));  
-}
-
-
-int 
-cvsd_decode_bs::work (int noutput_items,
-                     gr_vector_const_void_star &input_items,
-                     gr_vector_void_star &output_items)
-{
- 
-
-  const unsigned char *in = (const unsigned char *) input_items[0];
-  short *out = (short *) output_items[0];
-
-  unsigned short i=0;           // 2 bytes, 0 .. 65,535
-  unsigned char output_short=0;         // 2 bytes 0 .. 65,535
-  unsigned char bit_count=0;            // 1 byte, 0 .. 255
-  unsigned int mask=0;          // 4 bytes, 0 .. 4,294,967,295
-  unsigned char input_byte=0;   //  1 bytes
-  unsigned char input_bit=0;    // 1 byte, 0 .. 255
-  
-
-  //printf("\nnoutput_item: %d\n", noutput_items);
-  
-  // Loop through each input data point
-  for(i = 0; i < noutput_items/8.0; i++) {
-
-    input_byte = in[i];
-
-    // i think is unnecessary, but i'm not sure yet...
-    // Read in short from the file
-    //printf("Reading in two bytes from input file...\n");
-    //fread(ptr_input_byte, sizeof(unsigned char), 1, ptr_fin);
-    
-    // Initiliaze bit counter
-    bit_count=0;       
-    
-    while(bit_count<8) {
-      
-      // Compute the Appropriate Mask
-      mask=cvsd_pow(2,7-bit_count);
-      
-      // Pull off the corresponding bit
-      //printf("Adding bits to form a byte.\n");
-      input_bit =  input_byte & mask;
-      
-      // Update the bit counter
-      bit_count++;
-      
-      
-      // Update runner with the next input bit
-      // Runner is a shift-register; shift left, add on newest output bit
-      //printf("Updating the runner.\n");
-      d_runner =  (d_runner<<1) | ((unsigned int) input_bit);
-      
-      // Run this only if you have >= J bits in your shift register
-      if (d_loop_counter>=d_J) {
-       // Update Step Size
-       //printf("Updating stepsize by checking for runs of 1s and 0s.\n");
-       d_runner_mask=(cvsd_pow(2,d_J)-1);
-       if ((cvsd_bitwise_sum(d_runner & 
d_runner_mask)>=d_J)||(cvsd_bitwise_sum((~d_runner) & mask)>=d_J)) {
-         // Runs of 1s and 0s
-          
-         d_stepsize = std::min( (short) (d_stepsize + d_min_step), d_max_step);
-       }
-       else {
-         // No runs of 1s and 0s
-         d_stepsize = std::max( (short) cvsd_round(d_stepsize*d_step_decay), 
d_min_step);
-       }
-      }
-      
-      // Update Accum (i.e. the reference value)
-      // printf("Updating stepsize.\n");
-      if (input_bit) {
-       d_accum=d_accum+d_stepsize;
-      }
-      else {
-       d_accum=d_accum-d_stepsize;
-      }
-      
-      // Multiply by Accum_Decay
-      d_accum=(cvsd_round(d_accum*d_accum_decay));
-      //printf("Multiplying accum by the accum_decay.\n");
-      
-      
-      // Check for overflow
-      //printf("Checking for accum saturation.\n");
-      if (d_accum >= d_pos_accum_max) {
-       d_accum=d_pos_accum_max;
-      }
-      else if (d_accum <= d_neg_accum_max) {
-       d_accum=d_neg_accum_max;
-      }
-      
-      // Find the output short to write to the file
-      output_short=((short) d_accum);
-      
-      if (d_loop_counter <= d_K) {
-       d_loop_counter++;
-      }
-      
-      *(out++) = output_short;
-    } // while ()      
-    
-  } // for()
-  
-  //printf("returning noutput_items: %d.\n\n", noutput_items);
-  
-  return noutput_items;
-}
+/* -*- c++ -*- */
+/*
+ * Copyright 2007 Free Software Foundation, Inc.
+ * 
+ * This file is part of GNU Radio
+ * 
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ * 
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/*
+ * config.h is generated by configure.  It contains the results
+ * of probing for features, options etc.  It should be the first
+ * file included in your .cc file.
+ */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <cvsd_decode_bs.h>
+#include <gr_io_signature.h>
+
+/*
+ * Create a new instance of cvsd_decode_bs and return
+ * a boost shared_ptr.  This is effectively the public constructor.
+ */
+cvsd_decode_bs_sptr 
+cvsd_make_decode_bs (short min_step, short max_step, double step_decay,
+                    double accum_decay,  int K, int J,
+                    short pos_accum_max, short neg_accum_max)
+{
+  return cvsd_decode_bs_sptr (new cvsd_decode_bs (min_step, max_step,
+                                                 step_decay, accum_decay, K, J,
+                                                 pos_accum_max, 
neg_accum_max));
+}
+
+cvsd_decode_bs::cvsd_decode_bs (short min_step, short max_step, double 
step_decay, 
+                               double accum_decay, int K, int J,
+                               short pos_accum_max, short neg_accum_max)
+  : gr_sync_interpolator ("cvsd_decode_bs",
+                         gr_make_io_signature (1, 1, sizeof (unsigned char)),
+                         gr_make_io_signature (1, 1, sizeof (short)),
+                         8),
+    d_min_step (min_step), d_max_step(max_step), d_step_decay(step_decay),
+    d_accum_decay(accum_decay), d_K(K), d_J(J), 
+    d_pos_accum_max(pos_accum_max), d_neg_accum_max(neg_accum_max),
+    d_accum(0), 
+    d_loop_counter(1), 
+    d_runner(0),
+    d_runner_mask(0),
+    d_stepsize(min_step)
+  
+{
+  assert(d_pos_accum_max <= SHRT_MAX);
+  assert(d_neg_accum_max >= -SHRT_MAX);
+  assert(d_K <= 32);
+  assert(d_J <= d_K);
+  
+  // nothing else required in this example
+}
+
+
+cvsd_decode_bs::~cvsd_decode_bs ()
+{
+  // nothing else required in this example
+}
+
+unsigned char cvsd_decode_bs::cvsd_bitwise_sum (unsigned int input)
+{
+  unsigned int temp=input;
+  unsigned char bits=0;
+  
+  while(temp) {
+    temp=temp&(temp-1);
+    bits++;
+  }
+  return bits;
+}
+
+int cvsd_decode_bs::cvsd_round (double input)
+{
+  double temp;
+  temp=input+0.5;
+  temp=floor(temp);
+  
+  return (int)temp;
+}
+
+unsigned int cvsd_decode_bs::cvsd_pow (short radix, short power)
+{
+  double d_radix = (double) radix;
+  int i_power = (int) power;
+  double output;
+  
+  output=pow(d_radix,i_power);
+  return ( (unsigned int) cvsd_round(output));  
+}
+
+
+int 
+cvsd_decode_bs::work (int noutput_items,
+                     gr_vector_const_void_star &input_items,
+                     gr_vector_void_star &output_items)
+{
+ 
+
+  const unsigned char *in = (const unsigned char *) input_items[0];
+  short *out = (short *) output_items[0];
+
+  int i=0;
+  short output_short=0;                 // 2 bytes 0 .. 65,535
+  unsigned char bit_count=0;    // 1 byte, 0 .. 255
+  unsigned int mask=0;          // 4 bytes, 0 .. 4,294,967,295
+  unsigned char input_byte=0;   //  1 bytes
+  unsigned char input_bit=0;    // 1 byte, 0 .. 255
+  
+  // Loop through each input data point
+  for(i = 0; i < noutput_items/8.0; i++) {
+
+    input_byte = in[i];
+    // Initiliaze bit counter
+    bit_count=0;       
+    
+    while(bit_count<8) {
+      // Compute the Appropriate Mask
+      mask=cvsd_pow(2,7-bit_count);
+      
+      // Pull off the corresponding bit
+      input_bit = input_byte & mask;
+      
+      // Update the bit counter
+      bit_count++;
+      
+      // Update runner with the next input bit
+      // Runner is a shift-register; shift left, add on newest output bit
+      d_runner = (d_runner<<1) | ((unsigned int) input_bit);
+      
+      // Run this only if you have >= J bits in your shift register
+      if (d_loop_counter>=d_J) {
+       // Update Step Size
+       d_runner_mask=(cvsd_pow(2,d_J)-1);
+       if ((cvsd_bitwise_sum(d_runner & 
d_runner_mask)>=d_J)||(cvsd_bitwise_sum((~d_runner) & d_runner_mask)>=d_J)) {
+         // Runs of 1s and 0s
+         d_stepsize = std::min( (short) (d_stepsize + d_min_step), d_max_step);
+       }
+       else {
+         // No runs of 1s and 0s
+         d_stepsize = std::max( (short) cvsd_round(d_stepsize*d_step_decay), 
d_min_step);
+       }
+      }
+      
+      // Update Accum (i.e. the reference value)
+      if (input_bit) {
+       d_accum=d_accum+d_stepsize;
+      }
+      else {
+       d_accum=d_accum-d_stepsize;
+      }
+      
+      // Multiply by Accum_Decay
+      d_accum=(cvsd_round(d_accum*d_accum_decay));
+      
+      // Check for overflow
+      if (d_accum >=((int) d_pos_accum_max)) {
+       d_accum=(int)d_pos_accum_max;
+      }
+      else if (d_accum <=((int) d_neg_accum_max)) {
+       d_accum=(int)d_neg_accum_max;
+      }
+      
+      // Find the output short to write to the file
+      output_short=((short) d_accum);
+      
+      if (d_loop_counter <= d_K) {
+       d_loop_counter++;
+      }
+      
+      *(out++) = output_short;
+    } // while ()      
+    
+  } // for()
+  
+  return noutput_items;
+}

Modified: 
gnuradio/branches/developers/trondeau/cvsd/gr-cvsd-vocoder/src/lib/cvsd_decode_bs.h
===================================================================
--- 
gnuradio/branches/developers/trondeau/cvsd/gr-cvsd-vocoder/src/lib/cvsd_decode_bs.h
 2007-03-28 03:45:42 UTC (rev 4806)
+++ 
gnuradio/branches/developers/trondeau/cvsd/gr-cvsd-vocoder/src/lib/cvsd_decode_bs.h
 2007-03-28 16:41:13 UTC (rev 4807)
@@ -53,7 +53,7 @@
                  double accum_decay, int K, int J,
                  short pos_accum_max, short neg_accum_max);
 
-  short cvsd_round(double input);
+  int cvsd_round(double input);
   unsigned int cvsd_pow (short radix, short power);
   unsigned char cvsd_bitwise_sum (unsigned int input);
 

Modified: 
gnuradio/branches/developers/trondeau/cvsd/gr-cvsd-vocoder/src/lib/cvsd_encode_sb.cc
===================================================================
--- 
gnuradio/branches/developers/trondeau/cvsd/gr-cvsd-vocoder/src/lib/cvsd_encode_sb.cc
        2007-03-28 03:45:42 UTC (rev 4806)
+++ 
gnuradio/branches/developers/trondeau/cvsd/gr-cvsd-vocoder/src/lib/cvsd_encode_sb.cc
        2007-03-28 16:41:13 UTC (rev 4807)
@@ -88,13 +88,13 @@
   return bits;
 }
 
-short cvsd_encode_sb::cvsd_round (double input)
+int cvsd_encode_sb::cvsd_round (double input)
 {
   double temp;
   temp=input+0.5;
   temp=floor(temp);
   
-  return (short)temp;
+  return (int)temp;
 }
 
 unsigned int cvsd_encode_sb::cvsd_pow (short radix, short power)
@@ -123,13 +123,8 @@
   unsigned char bit_count=0;            // 1 byte, 0 .. 255
   unsigned int mask=0;          // 4 bytes, 0 .. 4,294,967,295
   
-  //printf("\nnoutput_item: %d\n", noutput_items);
-  
   // Loop through each input data point
   for(i = 0; i < noutput_items*8; i++) {
-    //printf("Input value is: %d \n", in[i]);
-    //printf("Accum value is: %d \n", d_accum);
-
     if((int)in[i] >= d_accum) {    // Note:  sign((data(n)-accum))
       output_bit=1;
     }
@@ -137,10 +132,7 @@
       output_bit=0;
     }
     
-    //printf("Output bit is: %d \n", output_bit);
-    
     // Update Accum (i.e. the reference value)
-    // printf("Updating stepsize.\n");
     if (output_bit) {
       d_accum=d_accum+d_stepsize;
       //printf("Addding %d to the accum; the result is: %d.\n", d_stepsize, 
d_accum);
@@ -152,36 +144,25 @@
 
     // Multiply by Accum_Decay
     d_accum=(cvsd_round(d_accum*d_accum_decay));
-    //printf("Multiplying by the accum; the result %d.\n", d_accum);
 
     // Check for overflow
-    if (d_accum >= d_pos_accum_max) {
-      //printf("The accum is at: %d, and the pos_accum_max is: %d.\n", 
d_accum, d_pos_accum_max);
-      //printf("Warning! Accum is max saturated!\n");
-      d_accum = d_pos_accum_max;
+    if (d_accum >= ((int)d_pos_accum_max)) {
+      d_accum = (int)d_pos_accum_max;
     }
-    else if(d_accum <= d_neg_accum_max) {
-      //printf("The accum is at: %d, and the neg_accum_max is: %d.\n", 
d_accum, d_neg_accum_max);
-      //printf("Warning! Accum is min saturated!\n");
-      d_accum = d_neg_accum_max;
+    else if(d_accum <= ((int) d_neg_accum_max)) {
+      d_accum = (int) d_neg_accum_max;
     }
                 
-    //printf("\n");
-    
     // Update runner with the last output bit
     // Update Step Size
     if (d_loop_counter >= d_J) { // Run this only if you have >= J bits in 
your shift register
       mask=(cvsd_pow(2, d_J) - 1);
       if ((cvsd_bitwise_sum(d_runner & mask) >= d_J) || 
(cvsd_bitwise_sum((~d_runner) & mask) >= d_J)) {
        // Runs of 1s and 0s
-       //printf("\nThe runner value is %d.  The masked runner is %d.  A run 
was detected!!!!\n", 
-       //       d_runner, d_runner & mask);
        d_stepsize = std::min( (short)(d_stepsize + d_min_step), d_max_step);
       }
       else {
        // No runs of 1s and 0s
-       //printf("\nThe runner value is %d.  The masked runner is %d.  No runs 
detected.\n", 
-       //       d_runner, d_runner & mask);
        d_stepsize = std::max( (short)cvsd_round(d_stepsize*d_step_decay), 
d_min_step);     
       }
     }
@@ -208,8 +189,6 @@
       output_byte=0;
     }
   } // While
-            
-  //printf("returning noutput_items: %d.\n\n", noutput_items);
 
   return noutput_items;
 }

Modified: 
gnuradio/branches/developers/trondeau/cvsd/gr-cvsd-vocoder/src/lib/cvsd_encode_sb.h
===================================================================
--- 
gnuradio/branches/developers/trondeau/cvsd/gr-cvsd-vocoder/src/lib/cvsd_encode_sb.h
 2007-03-28 03:45:42 UTC (rev 4806)
+++ 
gnuradio/branches/developers/trondeau/cvsd/gr-cvsd-vocoder/src/lib/cvsd_encode_sb.h
 2007-03-28 16:41:13 UTC (rev 4807)
@@ -53,7 +53,7 @@
                  double accum_decay, int K, int J,
                  short pos_accum_max, short neg_accum_max);
   
-  short cvsd_round(double input);
+  int cvsd_round(double input);
   unsigned int cvsd_pow (short radix, short power);
   unsigned char cvsd_bitwise_sum (unsigned int input);
 


Property changes on: 
gnuradio/branches/developers/trondeau/cvsd/gr-cvsd-vocoder/src/python
___________________________________________________________________
Name: svn:ignore
   + Makefile
Makefile.in
run_tests


Modified: 
gnuradio/branches/developers/trondeau/cvsd/gr-cvsd-vocoder/src/python/encdec.py
===================================================================
--- 
gnuradio/branches/developers/trondeau/cvsd/gr-cvsd-vocoder/src/python/encdec.py 
    2007-03-28 03:45:42 UTC (rev 4806)
+++ 
gnuradio/branches/developers/trondeau/cvsd/gr-cvsd-vocoder/src/python/encdec.py 
    2007-03-28 16:41:13 UTC (rev 4807)
@@ -25,10 +25,12 @@
 from gnuradio.vocoder import cvsd_vocoder
 
 def build_graph():
+    sample_rate = 8000
+    scale_factor = 32000
+    
     fg = gr.flow_graph()
-    #src = audio.source(8000, "plughw:0,0")
-    src = gr.sig_source_f(8000, gr.GR_SIN_WAVE, 100, 1)
-    src_scale = gr.multiply_const_ff(32767)
+    src = audio.source(sample_rate, "plughw:0,0")
+    src_scale = gr.multiply_const_ff(scale_factor)
 
     interp = blks.rational_resampler_fff(fg, 8, 1)
     f2s = gr.float_to_short ()
@@ -39,14 +41,23 @@
     s2f = gr.short_to_float ()
     decim = blks.rational_resampler_fff(fg, 1, 8)
 
-    sink_scale = gr.multiply_const_ff(10000) #1.0/32767.)
-    sink = audio.sink(8000, "plughw:0,0")
+    sink_scale = gr.multiply_const_ff(1.0/scale_factor)
+    sink = audio.sink(sample_rate, "plughw:0,0")
 
     fg.connect(src, src_scale, interp, f2s, enc)
     fg.connect(enc, dec, s2f, decim, sink_scale, sink)
 
-    fg.connect(src, gr.file_sink(gr.sizeof_float, "source.dat"))
-    
+    if 0: # debug
+        fg.connect(src, gr.file_sink(gr.sizeof_float, "source.dat"))
+        fg.connect(src_scale, gr.file_sink(gr.sizeof_float, "src_scale.dat"))
+        fg.connect(interp, gr.file_sink(gr.sizeof_float, "interp.dat"))
+        fg.connect(f2s, gr.file_sink(gr.sizeof_short, "f2s.dat"))
+        fg.connect(enc, gr.file_sink(gr.sizeof_char,  "enc.dat"))
+        fg.connect(dec, gr.file_sink(gr.sizeof_short, "dec.dat"))
+        fg.connect(s2f, gr.file_sink(gr.sizeof_float, "s2f.dat"))
+        fg.connect(decim, gr.file_sink(gr.sizeof_float, "decim.dat"))
+        fg.connect(sink_scale, gr.file_sink(gr.sizeof_float, "sink_scale.dat"))
+        
     return fg
 
 if __name__ == '__main__':





reply via email to

[Prev in Thread] Current Thread [Next in Thread]