dspavankumar/compute-mfcc

why extract frameShiftSamples samples as a frame?

Closed this issue · 1 comments

    // Recalculate buffer size
    bufferLength = frameShiftSamples;
    buffer = new int16_t[bufferLength];
    
    // Read data and process each frame
    wavFp.read((char *) buffer, bufferLength*bufferBPS);
    int frame = 0;
    while (wavFp.gcount() == bufferLength*bufferBPS && !wavFp.eof()) {
        frame += 1;
        mfcFp << processFrame(buffer, bufferLength);
        wavFp.read((char *) buffer, bufferLength*bufferBPS);
    }

is frameShiftSamples equal to winLengthSamples?

At any time instant, the number of "new" samples we need to see to construct a frame is the last frameShiftSamples samples of the frame. The rest of the samples are overlapped with those from the previous frame, which we already have in memory. Hope this helps.