HTBasic Help
×
Menu
Index
W_cosine
Cosine window.
 
Loading        LOADSUB ALL FROM "W_COSINE.HTS"
or LOADSUB FROM "MATHLIB.HTS"
or LOADSUB W_cosine FROM "MATHLIB.HTS"
 
Usage                REAL A(*),B(*)
REAL R
CALL W_cosine(A(*),R,B(*))
 
Description                
W_cosine multiplies the sequence in array A by a cosine window function of parameter r and returns the product in array B. Array A is unmodified. R is the peak-to-peak amplitude of the cosine portion of the window; it must be between 0 and 1, inclusive. If N is the number of elements in the array A and k is the position in the array B, the formula for the window function, wk, is
In the above formula, k ranges in value from 0 to N - 1.
 
If the array B contains more elements than A, the extra elements in B are unmodified.
 
Cosine windows for N=128
Special cases of the cosine window are the Hamming and Hanning windows; these are available as separate subroutines.
 
Errors                
W_cosine causes an HTBasic error if its arguments are not of the types listed in the USAGE section, above, if r is not between 0 and 1, inclusive, or if B contains fewer elements than A.
 
See Also
Waveform, W_bartlett, W_blackman, W_hamming, W_hanning