windowing.c
// Function to implement the hann window
Function to implement the hann window
Function to implement the hann window
float * hann(int N)
{
    float *x  = (float *) MALLOC(N * sizeof(float) );
    for (int i = 0; i < N+2; i++) {
	if (i > 0 && i < N + 1) { 
	    float temp = ((float)i) / (N+1);
	    x[i-1] = 0.5 * (1. - cos(2 * M_PI * temp));
	}
    }
    return x;
}
float * hann ( int N ) { float * x = ( float * ) MALLOC ( N * sizeof ( float ) ) ; for ( int i = 0 ; i < N + 2 ; i ++ ) { if ( i > 0 && i < N + 1 ) { float temp = ( ( float ) i ) / ( N + 1 ) ; x [ i - 1 ] = 0.5 * ( 1. - cos ( 2 * M_PI * temp ) ) ; } } return x ; }
Function to implement the hann window
Function to implement the hann window
// matlab has no zeroes at the beginning/end for hanning, only for hann (?!)