Generate a Tukey Window
tukey_window.RdComputes a Tukey (tapered cosine) window of length n with taper
parameter alpha. The Tukey window is rectangular when
alpha = 0 and becomes a Hann window when alpha = 1.
Details
The Tukey window is defined piecewise: $$ w[m] = \begin{cases} \tfrac{1}{2}\left[1+\cos\!\left(\pi\left(\tfrac{2m}{\alpha(N-1)}-1\right)\right)\right], & 0 \leq m < \tfrac{\alpha(N-1)}{2}, \\ 1, & \tfrac{\alpha(N-1)}{2} \leq m \leq (N-1)(1-\tfrac{\alpha}{2}), \\ \tfrac{1}{2}\left[1+\cos\!\left(\pi\left(\tfrac{2m}{\alpha(N-1)}-\tfrac{2}{\alpha}+1\right)\right)\right], & (N-1)(1-\tfrac{\alpha}{2}) < m \leq N-1. \end{cases} $$
where \(N\) is the window length. For alpha = 0 the definition
reduces to a rectangular window, and for alpha = 1 to a Hann window.