From: drowe67 Date: Thu, 10 Sep 2009 07:21:16 +0000 (+0000) Subject: convience shell scripts for automating coding and listening X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=7994b8260dfd3435eec1646a1400ee371a01e2c8;p=freetel-svn-tracking.git convience shell scripts for automating coding and listening git-svn-id: https://svn.code.sf.net/p/freetel/code@54 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/codec2/octave/plphase.m b/codec2/octave/plphase.m index 4af9577a..689615ab 100644 --- a/codec2/octave/plphase.m +++ b/codec2/octave/plphase.m @@ -84,9 +84,10 @@ function plphase(samname, f) phase_err_label = sprintf(";phase_err SNR %4.2f dB;",snr_phase); plot((1:L)*Wo*4000/pi, 20*log10(orig-synth), phase_err_label); - hold off; endif + hold off; + if (file_in_path(".",phase_name)) figure(3); plot((1:L)*Wo*4000/pi, phase(f,1:L)*180/pi, "-o;phase;"); diff --git a/codec2/src/code.sh b/codec2/src/code.sh new file mode 100644 index 00000000..1a37c417 --- /dev/null +++ b/codec2/src/code.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# code.sh +# David Rowe 10 Sep 2009 +# +# Run steps to encode a speech sample + +../unittest/tnlp ../raw/$1.raw ../unittest/$1_nlp.p +../src/sinenc ../raw/$1.raw %1.mdl 300 ../unittest/$1_nlp.p +../src/sinedec ../raw/$1.raw %1.mdl -o $1_uq.raw +../src/sinedec ../raw/$1.raw %1.mdl --phase 0 -o $1_phase0.raw + diff --git a/codec2/src/listen.sh b/codec2/src/listen.sh new file mode 100755 index 00000000..281e68ea --- /dev/null +++ b/codec2/src/listen.sh @@ -0,0 +1,9 @@ +#!/bin/sh +# listen1.sh +# David Rowe 10 Sep 2009 +# +# Run menu with common sample file options, headphone version + +../script/menu.sh ../raw/$1.raw $1_uq.raw $1_phase0.raw -d /dev/dsp1 + + diff --git a/codec2/src/listen1.sh b/codec2/src/listen1.sh new file mode 100755 index 00000000..281e68ea --- /dev/null +++ b/codec2/src/listen1.sh @@ -0,0 +1,9 @@ +#!/bin/sh +# listen1.sh +# David Rowe 10 Sep 2009 +# +# Run menu with common sample file options, headphone version + +../script/menu.sh ../raw/$1.raw $1_uq.raw $1_phase0.raw -d /dev/dsp1 + + diff --git a/codec2/src/nlp.c b/codec2/src/nlp.c index c2ffbde5..ef555095 100644 --- a/codec2/src/nlp.c +++ b/codec2/src/nlp.c @@ -45,7 +45,7 @@ #define PI 3.141592654 /* mathematical constant */ #define T 0.1 /* threshold for local minima candidate */ #define F0_MAX 500 -#define CNLP 0.5 /* post processor constant */ +#define CNLP 0.3 /* post processor constant */ /*---------------------------------------------------------------------------*\ diff --git a/codec2/src/phase.c b/codec2/src/phase.c index f455fd1e..faba8853 100644 --- a/codec2/src/phase.c +++ b/codec2/src/phase.c @@ -160,6 +160,7 @@ float phase_model_first_order( /* Sample LPC model at harmonics */ + //#define NO_LPC_PHASE #ifdef NO_LPC_PHASE /* useful for testing with Sn[] an impulse train */ for(m=1; m<=PHASE_LPC_ORD; m++)