+++ /dev/null
-Codec 2 README
---------------
-
-Codec 2 is an open source 2400 bit/s speech codec (LGPL licensed).
-For more information please see:
-
- http://rowetel.com/codec2.html
-
-Quickstart
-----------
-
-$ ./configure
-$ make
-$ cd src
-$ ./c2enc ../raw/hts1a.raw hts1a_c2.bit
-$ ./c2dec hts1a_c2.bit hts1a_c2.raw
-$ ../script/menu.sh ../raw/hts1a.raw hts1a_c2.raw
-
-For playback testing, menu.sh requires either the 'play', 'aplay' or
-'ossplay' programs to be installed (see http://sox.sourceforge.net/,
-http://www.alsa-project.org/, or http://www.opensound.com/ respectively).
-
-To enable dump files build using:
-
-$ make clean
-$ CFLAGS=-DDUMP ./configure
-$ make
-
-Programs
---------
-
-1/ c2enc encodes a file of speech sample to a file of encoded bits.
-
-2/ c2dec decodes a file of bits to a file of speech samples.
-
-3/ c2sim is a simulation/development version of codec 2. It allows
-selective use of the various codec 2 algorithms. For example
-switching phase modelling or LSP quantisation on and off.
-
-Directories
------------
-
- script - shell scripts for playing and converting raw files
- src - C source code
- octave - Octave scripts used for visualising internal signals
- during development
- raw - speech files in raw format (16 bits signed linear 8 KHz)
- unittest - unit test source code
- wav - speech files in wave file format
- voicing - hand estimated voicing files
selective use of the various Codec 2 algorithms. For example
switching phase modelling or LSP quantisation on and off.
+Debugging
+---------
+
+1/ For dump file support:
+
+ $ cd codec2
+ $ CFLAGS=-DDUMP ./configure
+ $ make clean && make
+
+2/ To use gdb:
+
+ $ $ libtool --mode=execute gdb c2sim
+
Directories
-----------
% Copyright David Rowe 2009
% This program is distributed under the terms of the GNU General Public License
% Version 2
+%
+% Plots a raw speech sample file, you can optionally specify the start and end
+% samples and create a large and small PNGs
function pl(samname1, start_sam, end_sam, pngname)
--- /dev/null
+% Copyright David Rowe 2010
+% This program is distributed under the terms of the GNU General Public License
+% Version 2
+%
+% Plots a bunch of information realted to LSP quantisation:
+% - speech file
+% - LSPs before and after quantisation
+% - SNR for each frame
+%
+% Note: there is a 160 sample (two frame delay) from the when a sample
+% enters the input buffer until it is at the centre of the analysis window
+
+function pl(rawfile,
+ dumpfile_prefix_lpc_only,
+ dumpfile_prefix_lsp,
+ start_f, end_f)
+
+ fs=fopen(rawfile,"rb");
+ s=fread(fs,Inf,"short");
+
+ lpc_snr_name = strcat(dumpfile_prefix_lpc_only,"_lpc_snr.txt");
+ lpc10_snr = load(lpc_snr_name);
+ lpc_snr_name = strcat(dumpfile_prefix_lsp,"_lpc_snr.txt");
+ lsp_snr = load(lpc_snr_name);
+
+ lsp_name = strcat(dumpfile_prefix_lsp,"_lsp.txt");
+ lsps = load(lsp_name);
+ [m,n]=size(lsps);
+ lsp = lsps(1:2:m,:);
+ lsp_ = lsps(2:2:m,:);
+
+ figure(1);
+ clf;
+ subplot(211);
+ sp = s((start_f-2)*80:(end_f-2)*80);
+ plot(sp);
+
+ subplot(212);
+ plot(lpc10_snr((start_f+1):end_f)-lsp_snr((start_f+1):end_f));
+
+ figure(2);
+ plot((4000/pi)*lsp((start_f+1):end_f,:));
+ hold on;
+ plot((4000/pi)*lsp_((start_f+1):end_f,:));
+ hold off;
+endfunction