windowing.c
// Function to implement generalized hamming window
Function to implement generalized hamming window
Function to implement generalized hamming window
float * general_hamming(int N, float alpha)
{
    int half; 
    float temp;
    float *x = (float *) MALLOC( N*sizeof(float) );  
    if (N % 2)
	half = (N+1)/2;
    else
	half = N/2;
    for (int i =0; i<N; i++)
    {
	if (i <= half -1)
	{
	    temp = ((float) i)/(N-1);
	    x[i] = alpha - (1 - alpha)*cos(2*M_PI*temp);
	}
	else
	{
	    x[i] = x[N-1-i];
	}
    }
    return x;
}
float * general_hamming ( int N , float alpha ) { int half ; float temp ; float * x = ( float * ) MALLOC ( N * sizeof ( float ) ) ; if ( N % 2 ) half = ( N + 1 ) / 2 ; else half = N / 2 ; for ( int i = 0 ; i < N ; i ++ ) { if ( i <= half - 1 ) { temp = ( ( float ) i ) / ( N - 1 ) ; x [ i ] = alpha - ( 1 - alpha ) * cos ( 2 * M_PI * temp ) ; } else { x [ i ] = x [ N - 1 - i ] ; } } return x ; }
Function to implement generalized hamming window
Function to implement generalized hamming window