From: drowe67 Date: Mon, 13 Dec 2010 09:45:30 +0000 (+0000) Subject: v0.1a wav file, edits to README, LSP trajectory octave plotscript X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=5a6b6ba575bc44dd1da35f47c9e7702fa4c591ae;p=freetel-svn-tracking.git v0.1a wav file, edits to README, LSP trajectory octave plotscript git-svn-id: https://svn.code.sf.net/p/freetel/code@271 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/codec2/README b/codec2/README deleted file mode 100644 index 687ef141..00000000 --- a/codec2/README +++ /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 diff --git a/codec2/README.txt b/codec2/README.txt index 7c061440..3a1a8d19 100644 --- a/codec2/README.txt +++ b/codec2/README.txt @@ -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 ----------- diff --git a/codec2/octave/pl.m b/codec2/octave/pl.m index 4f0e2960..0d547882 100644 --- a/codec2/octave/pl.m +++ b/codec2/octave/pl.m @@ -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 index 00000000..f66e7ab2 --- /dev/null +++ b/codec2/octave/pllsp.m @@ -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 index 00000000..60bc3f06 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 index 00000000..3e60bca0 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 index 00000000..6f800525 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 index 00000000..848ef23d Binary files /dev/null and b/codec2/wav/mmt1_lpc10.wav differ