vsip_vview_f* vsip_vcreate_kaiser_f(vsip_length n, vsip_scalar_f beta, vsip_memory_hint hint);
This function creates and initializes a vector with coefficients of a Kaiser window of length
. The Kaiser window is defined
by:
![( )
√︂ --(2k----)2
I0 β 1- n-1-1
w[k]= -----------------, 0≤ k< n
I0(β)](VSIPLCoreRef_PG190x.png)
where
is the zeroth-order modified Bessel function of the first kind.
vsip_length n: Length of the window (number of elements in the vector).
vsip_scalar_p beta: Shape parameter that controls the trade-off between main lobe width and side lobe
attenuation,
.
vsip_memory_hint hint: Memory allocation hint:
VSIP_MEM_NONE - No memory hint
VSIP_MEM_RDONLY - The memory is to be used read-only
VSIP_MEM_CONST - The memory will hold constants
VSIP_MEM_SHARED - The memory will be shared
VSIP_MEM_SHARED_RDONLY - The memory will be shared and is read-only
VSIP_MEM_SHARED_CONST - The memory will be shared and will hold constants
On success, returns a pointer to the newly created and initialized vector containing the Kaiser window coefficients.
On error, returns NULL.
vsip_vview_f *kaiser_win; vsip_length n = 64; vsip_scalar_f beta = 6.0f; // Moderate side lobe suppression // Create a Kaiser window kaiser_win = vsip_vcreate_kaiser_f(n, beta, VSIP_MEM_NONE); if (kaiser_win == NULL) { // Handle error } // Use the window in an application // For example, apply it to a signal vsip_vview_f *signal = vsip_vcreate_f(n, VSIP_MEM_NONE); vsip_vview_f *windowed_signal = vsip_vcreate_f(n, VSIP_MEM_NONE); // Initialize signal... // vsip_vramp_f(0.0f, 1.0f, signal); // Apply the window vsip_vmul_f(signal, kaiser_win, windowed_signal); // Clean up vsip_valldestroy_f(kaiser_win); vsip_valldestroy_f(signal); vsip_valldestroy_f(windowed_signal);
The Kaiser window is symmetric for even-length vectors and nearly symmetric for odd-length vectors.
Common
values and their approximate side lobe attenuations:
: Rectangular window ( 13 dB)
: 30 dB side lobe attenuation
: 50 dB side lobe attenuation
: 60 dB side lobe attenuation