From: drowe67 Date: Thu, 12 Jan 2017 02:51:43 +0000 (+0000) Subject: set up start conditions in Octave and C, tests passing OK, time to build up Codec... X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=d783109a52eed8421905bacb4ce6c5ebd5be04fb;p=freetel-svn-tracking.git set up start conditions in Octave and C, tests passing OK, time to build up Codec 2 mode git-svn-id: https://svn.code.sf.net/p/freetel/code@2960 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/codec2-dev/octave/tnewamp1.m b/codec2-dev/octave/tnewamp1.m index d405090f..6adc9348 100644 --- a/codec2-dev/octave/tnewamp1.m +++ b/codec2-dev/octave/tnewamp1.m @@ -96,6 +96,10 @@ function tnewamp1(input_prefix) model_ = zeros(frames, max_amp+2); voicing_ = zeros(1,frames); H = zeros(frames, max_amp); + model_(1,1) = Wo_left = 2*pi/100; + voicing_left = 0; + left_vec = zeros(1,K); + for f=1:M:frames if voicing(f) index = encode_log_Wo(model(f,1), 6); @@ -108,14 +112,15 @@ function tnewamp1(input_prefix) end if f > M - Wo1 = model_(f-M,1); - Wo2 = model_(f,1); - [Wo_ avoicing_] = interp_Wo_v(Wo1, Wo2, voicing(f-M), voicing(f)); + %Wo1 = model_(f-M,1); + Wo_right = model_(f,1); + voicing_right = voicing(f); + [Wo_ avoicing_] = interp_Wo_v(Wo_left, Wo_right, voicing_left, voicing_right); model_(f-M:f-1,1) = Wo_; voicing_(f-M:f-1) = avoicing_; model_(f-M:f-1,2) = floor(pi ./ model_(f-M:f-1,1)); % calculate L for each interpolated Wo - left_vec = rate_K_surface_(f-M,:); + %left_vec = rate_K_surface_(f-M,:); right_vec = rate_K_surface_(f,:); sample_points = [f-M f]; resample_points = f-M:f-1; @@ -132,6 +137,12 @@ function tnewamp1(input_prefix) end end + + % update for next time + + Wo_left = Wo_right; + voicing_left = voicing_right; + left_vec = right_vec; end end diff --git a/codec2-dev/unittest/tnewamp1.c b/codec2-dev/unittest/tnewamp1.c index b385cf4c..50161100 100644 --- a/codec2-dev/unittest/tnewamp1.c +++ b/codec2-dev/unittest/tnewamp1.c @@ -170,6 +170,7 @@ int main(int argc, char *argv[]) { float Wo_left; int voicing_left; + /* for(k=0; k