Skip to content
Snippets Groups Projects
Commit 6367aa8a authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

Controlling training offset

parent 088ee4ff
No related branches found
No related tags found
No related merge requests found
......@@ -305,9 +305,9 @@ int main(int argc, char **argv) {
compute_frame_features(st, X, P, Ex, Ep, Exp, features, x);
fwrite(features, sizeof(float), NB_FEATURES, ffeat);
/* PCM is delayed by 1/2 frame to make the features centered on the frames. */
for (i=0;i<FRAME_SIZE/2;i++) pcm[i+FRAME_SIZE/2] = float2short(x[i]);
for (i=0;i<FRAME_SIZE-TRAINING_OFFSET;i++) pcm[i+TRAINING_OFFSET] = float2short(x[i]);
if (fpcm) fwrite(pcm, sizeof(short), FRAME_SIZE, fpcm);
for (i=0;i<FRAME_SIZE/2;i++) pcm[i] = float2short(x[i+FRAME_SIZE/2]);
for (i=0;i<TRAINING_OFFSET;i++) pcm[i] = float2short(x[i+FRAME_SIZE-TRAINING_OFFSET]);
old_speech_gain = speech_gain;
count++;
}
......
......@@ -30,10 +30,13 @@
#define FRAME_SIZE_5MS (2)
#define OVERLAP_SIZE_5MS (2)
#define TRAINING_OFFSET_5MS (1)
#define WINDOW_SIZE_5MS (FRAME_SIZE_5MS + OVERLAP_SIZE_5MS)
#define FRAME_SIZE (80*FRAME_SIZE_5MS)
#define OVERLAP_SIZE (80*OVERLAP_SIZE_5MS)
#define TRAINING_OFFSET (80*TRAINING_OFFSET_5MS)
#define WINDOW_SIZE (FRAME_SIZE + OVERLAP_SIZE)
#define FREQ_SIZE (WINDOW_SIZE/2 + 1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment