cut_off

Signal Processing Library

Program name: cut_off

Language: C

In file: window_lib.c

Objective: Calculate cutoff frame.

Usage: int cut_off(double offset, int sample_rate, int window_size, int overlap);

Parameters:

  • offset - seconds (fraction) where we will start or stop saving data
  • sample_rate - Number of data samples per second (25K or 50K)
  • window_size - The size of the frame (window)
  • overlap - The type of overlap used (2 in our case)
Return
  • Number of the frame

Mathematical Description:

Comments: Routine is used to calculate cutoff frame according to offset

User Comments

Code:

int cut_off(double offset, int sample_rate, int window_size, int overlap)
{
        int aux;

        if(sample_rate == 50000) {
                aux = offset * sample_rate * overlap / (window_size * 2);
        } else {
                aux = offset * sample_rate * overlap / window_size;
        }
        return(aux);
}