voicing_left = 0;
left_vec = zeros(1,K);
- for f=1:M:frames
+ % decoder runs on every M-th frame, 25Hz frame rate, offset at
+ % start is to minimise processing delay (thanks Jeroen!)
+
+ for f=M:M:frames
if voicing(f)
index = encode_log_Wo(model(f,1), 6);
memset(bits, '\0', ((codec2_bits_per_frame(c2) + 7) / 8));
- analyse_one_frame(c2, &model, speech);
+ for(i=0; i<M; i++) {
+ analyse_one_frame(c2, &model, &speech[i*N_SAMP]);
+ }
int K = 20;
float rate_K_vec[K], mean;
rate_K_vec_no_mean,
rate_K_vec_no_mean_);
- for(i=1; i<M; i++) {
- analyse_one_frame(c2, &model, &speech[i*N_SAMP]);
- }
-
pack_natural_or_gray(bits, &nbit, indexes[0], 9, 0);
pack_natural_or_gray(bits, &nbit, indexes[1], 9, 0);
pack_natural_or_gray(bits, &nbit, indexes[2], 4, 0);
voicing_left = 0;
Wo_left = 2.0*M_PI/100.0;
- /* decoder runs on every M-th frame, 25Hz frame rate */
+ /* decoder runs on every M-th frame, 25Hz frame rate, offset at
+ start is to minimise processing delay (thanks Jeroen!) */
fprintf(stderr,"\n");
- for(f=0; f<FRAMES; f+=M) {
+ for(f=M-1; f<FRAMES; f+=M) {
float a_interpolated_surface_[M][K];
newamp1_indexes_to_model(model__,