v0.1a wav file, edits to README, LSP trajectory octave plotscript
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Mon, 13 Dec 2010 09:45:30 +0000 (09:45 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Mon, 13 Dec 2010 09:45:30 +0000 (09:45 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@271 01035d8c-6547-0410-b346-abe4f91aad63

codec2/README [deleted file]
codec2/README.txt
codec2/octave/pl.m
codec2/octave/pllsp.m [new file with mode: 0644]
codec2/wav/hts1a_c2_v0.1a.wav [new file with mode: 0644]
codec2/wav/hts2a_c2_v0.1a.wav [new file with mode: 0644]
codec2/wav/mmt1_c2_v01a.wav [new file with mode: 0644]
codec2/wav/mmt1_lpc10.wav [new file with mode: 0644]

diff --git a/codec2/README b/codec2/README
deleted file mode 100644 (file)
index 687ef14..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-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 
index 7c06144036d443167cc96466e80d20bdc67820c8..3a1a8d19d9b0b1b78e7c000043162d244480e41d 100644 (file)
@@ -42,6 +42,19 @@ samples.
 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
 -----------
 
index 4f0e29601cb76036495cdd69f9cab53224d4a014..0d547882152c15474c8cd1d037ecb9134ae0b3fd 100644 (file)
@@ -1,6 +1,9 @@
 % 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)
   
diff --git a/codec2/octave/pllsp.m b/codec2/octave/pllsp.m
new file mode 100644 (file)
index 0000000..f66e7ab
--- /dev/null
@@ -0,0 +1,46 @@
+% 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
diff --git a/codec2/wav/hts1a_c2_v0.1a.wav b/codec2/wav/hts1a_c2_v0.1a.wav
new file mode 100644 (file)
index 0000000..60bc3f0
Binary files /dev/null and b/codec2/wav/hts1a_c2_v0.1a.wav differ
diff --git a/codec2/wav/hts2a_c2_v0.1a.wav b/codec2/wav/hts2a_c2_v0.1a.wav
new file mode 100644 (file)
index 0000000..3e60bca
Binary files /dev/null and b/codec2/wav/hts2a_c2_v0.1a.wav differ
diff --git a/codec2/wav/mmt1_c2_v01a.wav b/codec2/wav/mmt1_c2_v01a.wav
new file mode 100644 (file)
index 0000000..6f80052
Binary files /dev/null and b/codec2/wav/mmt1_c2_v01a.wav differ
diff --git a/codec2/wav/mmt1_lpc10.wav b/codec2/wav/mmt1_lpc10.wav
new file mode 100644 (file)
index 0000000..848ef23
Binary files /dev/null and b/codec2/wav/mmt1_lpc10.wav differ