discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] gr-cvsd-vocoder bugfix


From: wayne roberts
Subject: [Discuss-gnuradio] gr-cvsd-vocoder bugfix
Date: Thu, 16 Dec 2010 19:02:15 -0800

Of interest to anybody using CVSD:
I have tried using gr-cvsd-vocoder code on a microcontroller.

The primary problem seen was related to the decoder:
      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);

where the input_bit is not always being added to the LSbit of d_runner.  Should be:
            //d_runner = (d_runner<<1) | ((unsigned int) input_bit);
            d_runner <<= 1;
            if (input_bit)
                d_runner |= 1;    // always add it to the LSbit

Additionally, because I was using on microcontroller, the pow() function is to slow.
Since powers of 2 is needed, pow can be replaced by leftshifting 1.

Also, the d_step_decay effect was being rounded out.

I provide a wave-form of results of my changes, and the source code which runs the test.
screenshot of waveform: http://klogd.qbang.org/cvsd.png
source-code of cvsd: http://klogd.qbang.org/cvsd.zip

The source-code is gr-cvsd-vocoder put into C language using ascii-text files for input and output.
Separate decoder and encoder executables.
I had used a Makefile for MingGW on windows, however a linux makefile could be easily made if necessary.
reply via email to

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