convience shell scripts for automating coding and listening
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 10 Sep 2009 07:21:16 +0000 (07:21 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 10 Sep 2009 07:21:16 +0000 (07:21 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@54 01035d8c-6547-0410-b346-abe4f91aad63

codec2/octave/plphase.m
codec2/src/code.sh [new file with mode: 0644]
codec2/src/listen.sh [new file with mode: 0755]
codec2/src/listen1.sh [new file with mode: 0755]
codec2/src/nlp.c
codec2/src/phase.c

index 4af9577afc7da4e03934c325449b2613bf5aece7..689615ab483b282c58cc278f045efccfa4c8a4fb 100644 (file)
@@ -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 (file)
index 0000000..1a37c41
--- /dev/null
@@ -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 (executable)
index 0000000..281e68e
--- /dev/null
@@ -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 (executable)
index 0000000..281e68e
--- /dev/null
@@ -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
+
+
index c2ffbde5c3331f662be3d788de8d0c0ec1271a76..ef555095d3a5962f600c377d809a79e7833db0b8 100644 (file)
@@ -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              */
 
 /*---------------------------------------------------------------------------*\
                                                                             
index f455fd1e7bfb934a5add9756b66b4cda8437ac50..faba88533fc864e1c6850cc3bbbe693dfaaf47f2 100644 (file)
@@ -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++)