1.4.2.40 DSP_TransformWindow_Hamm32 Function
Perform a Hamming window on a vector.
Description
void DSP_TransformWindow_Hamm32(int32_t *OutVector, int32_t *InVector, int N);
Compute a Hamming Window on the first N samples of the input vector, InVector. The output is stored in OutVector. Operations are performed at higher resolution and rounded for the most accuracy possible. Input and output values are in Q31 fractional format. The Hamming Window follows the equation:
Window(n) = 0.54 - 0.46 * COS(2Pin/N) where n is the window sample number, N is the total number of samples
The functional output computes WinVector(n) = Window(n) * InVector(n)
Preconditions
N must be a positive number.
OutWindow must be declared with N elements or larger.
Parameters
OutWindow pointer to output array of elements (int32_t)
N number of samples (int)
Returns
None.
Remarks
This function is performed in C. The function may be optimized for the library. It is dependent on the floating point math library.
Example
int32_t OutVector32[8]={0}; int WindowN = 8; for (i=0;i<WindowN;i++) { InVector32[i]= 0x40000000; _// constant 0.5 for functional testing_ } DSP_TransformWindow_Hamm32(OutVector32, InVector32, WindowN); _// OutWindow = 0x051EB860, 0x0DBE26C0, 0x228F5C40, 0x37609200, 0x40000000,_ _// 0x37609200, 0x228F5C40, 0x0DBE26C0_
C
void DSP_TransformWindow_Hamm32 (int32_t * OutVector , int32_t * InVector , int N );