README
======


This directory contains an executable specification of the GSM
Enhanced Full Rate (EFR) speech encoder (GSM 06.60) modeled in the SpecC
language [TR9911]. The EFR-Coder performs speech compression using the 
CELP coding model. It takes its input as 13-bit speech samples at a sample
rate of 8kHz, gathers them to frames of 160 samples and for every frame 
produces an encoded block of 244 bits. These blocks can be transmitted 
over the wireless link and decoded at the receiver side to reobtain the 
speech data.

To extract the EFR-coder model type

    gzip -d vocoder.tar.gz
    mkdir vocoder
    cd vocoder
    tar xvf ../vocoder.tar

To compile the testbench using the SpecC reference compiler (scrc), type

    make

Or, if you are using UCI's SpecC compiler (scc), type
  
    make SCC=scc
    
If you want to enable the additional features of the UCI compiler, type    
    
    make -f Makefile.scc
    
instead. This builds the testbench using binary import of precompiled
SpecC code (SIR). In addition, this will generate the simulation library
EFR_Coder_simlib.a which is necessary for the IP example (see below).

Type

    make test

to make sure that all files are up to date and then run the
testbench. The testbench reads a file with 16-bit speech samples and
passes the 13 most significant bits of the samples along to the
coder. For every 160 speech samples the coder produces a block of 244
bits. The encoded blocks are captured in a file which is then compared
to a file of known good output data for the particular speech file.


TOOLS:
------

The Makefile also contains a tools target. Type

    make tools  (or: make SCC=scc tools / make -f Makefile.scc tools)

to build the tools, currently bit2cod and bitcat.

bitcat provides a means to inspect the output of the testbench. It
reads the bitstream file and displays the content of the encoded
blocks frame by frame.

bit2cod converts the bitstream file generated by the testbench to a
format where each bit is stored as a short integer (2 bytes) set to
either 0x0000 or 0x0001. This is the format the decoder included with
the original simulation code from the ETSI expects.


IP EXAMPLE:
-----------

Note: The IP example only works with the UCI SpecC compiler (scc). The
      SpecC reference compiler (scrc) does not support IP protection.

The IP subdirectory contains a testbench for the EFR-coder simulation
library. An IP vendor selling a coder chip will want to offer
customers a library for fast simulation but not give away any
information about the actual implementation. This is accomplished by
providing a public simulation library together with files describing
the interfaces and ports of the IP component and its behavior.

In the case of the EFR-coder the public files are:
EFR_Coder_simlib.a    : the simulation library
EFR_Coder_public.sc   : contains the interface and ports to the encoder
EFR_Coder_public.sh   : defines and typedefs for the encoder

As before,

    cd IP
    make
    
builds the testbench for the simulation library, and

    make test
    
makes sure all files are up to date and runs the testbench.



REFERENCES:
-----------

[TR9911] A.Gerstlauer, S.Zhao, D.Gajski, A.Horak, "Design of a GSM
         Vocoder using SpecC Methodology," UC Irvine, Technical Report 
	 ICS-TR-99-11, March 1999.

[SpecC]  SpecC Home Page, http://www.cecs.uci.edu/~specc


-- 

Martin von Weymarn <mweymarn@ics.uci.edu>, March 24, 1999:
  Initial version.

Andreas Gerstlauer <gerstl@ics.uci.edu>, December 21, 1999:
  Fixed several bugs in par{} statements which were dependent
  on a certain scheduling order.
  
Andreas Gerstlauer <gerstl@ics.uci.edu>, January 14, 2000:
  Cleaned up homing frame reset handling.
  
Andreas Gerstlauer <gerstl@ics.uci.edu>, June 4, 2001:
  Adapted to version 1.0 of the SpecC language (and compilers).

Andreas Gerstlauer <gerstl@ics.uci.edu>, January 14, 2002:
  Major update to replace pointers with arrays and fix port directions.

Andreas Gerstlauer <gerstl@ics.uci.edu>, July 26, 2002:
  Update to SpecC 2.0
