PAL Window Functions

Hann, Hamming, Blackman, flat-top, Tukey, Kaiser, rectangular, and zero-padded window functions used in spectral analysis.

PAL Window Functions — 12 functions

KiratPalBlackman

Signature
void KiratPalBlackman(T_FLOAT* pfWindow, T_INT iLength);
Description
Generates a Blackman window.
Mathematical operation
\(w[n]=0.42-0.5\cos\!\left(\dfrac{2\pi n}{N-1}\right)+0.08\cos\!\left(\dfrac{4\pi n}{N-1}\right)\)

KiratPalFlatTopHFT144

Signature
void KiratPalFlatTopHFT144(T_FLOAT* pfWindow, T_INT iLength);
Description
Generates a flat-top window using the cosine coefficients defined in the source code.
Mathematical operation
With \(\theta_n=2\pi n/N\): \(w[n]=1-1.96760033\cos\theta_n+1.57983607\cos2\theta_n-0.81123644\cos3\theta_n+0.22583558\cos4\theta_n-0.02773848\cos5\theta_n+0.00090360\cos6\theta_n\).

KiratPalFlatTopSR785

Signature
void KiratPalFlatTopSR785(T_FLOAT* pfWindow, T_INT iLength);
Description
Generates a flat-top window using the cosine coefficients defined in the source code.
Mathematical operation
With \(\theta_n=2\pi n/N\): \(w[n]=1-1.93\cos\theta_n+1.29\cos2\theta_n-0.388\cos3\theta_n+0.028\cos4\theta_n\).

KiratPalHamming

Signature
void KiratPalHamming(T_FLOAT* pfWindow, T_INT iLength);
Description
Generates a Hamming window.
Mathematical operation
\(w[n]=0.54-0.46\cos\!\left(\dfrac{2\pi(n+1)}{N+1}\right)\)

KiratPalHann

Signature
void KiratPalHann(T_FLOAT* pfWindow, T_INT iLength);
Description
Generates a Hann window in the variant specified by the function name.
Mathematical operation
\(w[n]=\tfrac12\left[1-\cos\!\left(\dfrac{2\pi(n+1)}{N+1}\right)\right],\quad 0\le n<N\)

KiratPalHannPeriodic

Signature
void KiratPalHannPeriodic(T_FLOAT* pfWindow, T_INT iLength);
Description
Generates a Hann window in the variant specified by the function name.
Mathematical operation
\(w[n]=\tfrac12\left[1-\cos\!\left(\dfrac{2\pi n}{N}\right)\right],\quad 0\le n<N\)

KiratPalHannPeriodicHalf

Signature
void KiratPalHannPeriodicHalf(T_FLOAT* pfWindow, T_INT iLength);
Description
Generates a Hann window in the variant specified by the function name.
Mathematical operation
Let \(H=\lfloor N/2\rfloor\). \(w[n]=\tfrac12[1-\cos(2\pi n/H)]\) for \(0\le n<H\), and \(w[n]=0\) for \(H\le n<N\).

KiratPalHannSymmetricHalf

Signature
void KiratPalHannSymmetricHalf(T_FLOAT* pfWindow, T_INT iLength);
Description
Generates a Hann window in the variant specified by the function name.
Mathematical operation
Let \(H=\lfloor N/2\rfloor\). \(w[n]=\tfrac12[1-\cos(2\pi(n+1)/(H+1))]\) for \(0\le n<H\), and \(w[n]=0\) for \(H\le n<N\).

KiratPalKaiser

Signature
void KiratPalKaiser(T_FLOAT* pfWindow, T_INT iLength, T_FLOAT fAlpha);
Description
Generates a Kaiser window. The Intel path uses IPP; the generic default path currently contains no implementation.
Mathematical operation
On the Intel/IPP path the routine applies an IPP Kaiser window to an all-ones vector using parameter `fAlpha` (the source comment states \(\alpha=2\beta_{\mathrm{MATLAB}}/(N-1)\) for matching MATLAB). The generic ANSI-C branch currently performs no window calculation.

KiratPalRect

Signature
void KiratPalRect(T_FLOAT* pfWindow, T_INT iLength);
Description
Generates a rectangular window consisting entirely of ones.
Mathematical operation
\(w[n]=1,\quad 0\le n<N\)

KiratPalRectZeroPad

Signature
void KiratPalRectZeroPad(T_FLOAT* pfWindow, T_INT iLength);
Description
Generates ones in the first half of the window and zeros in the second half.
Mathematical operation
\(w[n]=1\) for \(0\le n<\lfloor N/2\rfloor\) and \(w[n]=0\) otherwise.

KiratPalTukey

Signature
void KiratPalTukey(T_FLOAT* pfWindow, T_INT iLength, T_FLOAT fAlpha);
Description
Generates a Tukey/cosine-taper window; α controls the fraction occupied by the cosine tapers.
Mathematical operation
For \(\alpha\le0\), \(w[n]=1\); for \(\alpha\ge1\), the function calls the KiRAT symmetric Hann window. For \(0<\alpha<1\), with \(a=\alpha/2\), the left taper is \(\tfrac12[1+\cos(\pi a^{-1}(n/(N-1)-a))]\), the right taper is \(\tfrac12[1+\cos(\pi a^{-1}(n/(N-1)-1+a))]\), and the center is 1.