CMASK Instruction |
CMASK cseries start end seasonalwidth bandwidth bandcenter
Sets a complex series as a seasonal mask, setting to zero a band of entries around each harmonic.
Parameters
cseries |
series to create |
start, end |
range to set (by default, 1 to the FREQUENCY length) |
seasonalwidth |
number of entries between seasonals. By default, this is the number of frequencies divided by the CALENDAR seasonal. |
bandwidth |
width of seasonal band (by default, seasonalwidth/6). Even values are rounded up to the next odd value. |
bandcenter |
The center (entry number) of the first seasonal band. By default, entry 1 (zero frequency). If this is seasonalwidth+1, CMASK will leave the low frequencies unaffected. |
Description
CMASK creates a mask for seasonal frequencies. It sets entries start to end of cseries to the value 1.0. Then it sets to zero a band of width bandwidth about every seasonalwidth entry, beginning with bandcenter. A band will wrap around to the other end of the series if necessary. For instance:
cmask 3 1 128 32 5 33
results in zeros in entries 31 to 35, 63 to 67 and 95 to 99. These are the bands around \(\pi /2\), \(\pi\), and \(3 \pi /2\).
Notes
You need to take some special steps when smoothing a spectrum which you intend to mask: use the option MASK=masking series on WINDOW, then multiply the smoothed series by the mask.
fft 2
cmult(scale=1./(2*%pi*%scaletap)) 2 2
cmask 3 1 128 32 5 1
window(mask=3,width=9) 2 1 128 4
cset 4 = %z(t,4)*%z(t,3)
Copyright © 2025 Thomas A. Doan