This unit implements eight tapering windows and the discrete prolate spheroidal sequences, the latter via the DSP package.
@enum TaperKind begin
rectangular = 1
triangular = 2
hann = 3
hamming = 4
blackman = 5
harris4 = 6
riesz = 7
parzen = 8
slepian = 9
end
!!! note "Using hamming and blackman tapers"
Those two identifiers conflict with the DSP package. Until a better solution is found, invoke them as FourierAnalysis.hamming
and
FourierAnalysis.blackman
.
The Hann tapering window is also known as 'squared cosine' window and the Riesz window is similar to a window known as the 'cosine' window.
The design of tapering windows implies a trade-off between the equivalent noise bandwidth (enb), the energy of the first sidelobe (fsl) and the rate of sidelobe falloff (slf). The characteristics of the implemented tapering windows are reported in the following table:
window | notable points | enb(bins) | fsl(dB) | slf(dB/octave) |
---|---|---|---|---|
rectangular | 1 everywhere | 1 | -13 | - 6 |
triangular | 0 at boundaries | 1.33 | -26 | -12 |
hann | 0 at boundaries | 1.50 | -32 | -18 |
hamming | >0 at boundaries | 1.36 | -43 | - 6 |
blackman | 0 at boundaries | 1.73 | -58 | -18 |
harris4 | >0 at boundaries | 2 | -92 | - 6 |
riesz | 0 at boundaries | 1.2 | -21 | -12 |
parzen | >0 at boundaries | 1.92 | -53 | -24 |
The harris4 tapering window features excellent first sidelobe (-92dB) and sidelob falloff (-6dB rate), at the expenses of the highest equivalent noise bandwidth among all. Since this latter parameter is not critical in many applications, this window is employed as default by all FourierAnalysis constructors of objects in the frequency domain.
For reducing the variance of the spectral estimations, use the (Slepian) discrete prolate spheroidal sequences (dpss) multi-tapering (see slepians
).
Tapering windows in FourirAnalysis are encapsulated in the following structure:
struct Taper
y :: Union{Vector{T}, Matrix{T}} where T<:Real
kind :: TaperKind
α :: Real
n :: Int
end
The fields of the structure are:
y
, a real vector holding the tapering window, but for Slepian multi-tapers, for which this is a matrix holding in its columns the dpsskind
, the tapering window(s) as a TaperKindα
, a parameter for the tapering window(s). This is needed only for dpssn
, the number of tapering windows. It is >1 only for dpss.
If you need to construct Taper objects for single tapering windows, use the universal taper
constructor.
For constructing dpss use the specialized constructor slepians
.
taper
slepians
taperinfo
References
F.J. Harris (1978) On the Use of Windows for Harmonic Analysis with the Discrete Fourier Transform Proc. IEEE, 66, 51-53, 1978
D. Slepian (1978) Prolate Spheroidal Wave Functions. Fourier Analysis, and Uncertainty—V: The Discrete Case The Bell System Technical Journal,VoL 57, No. 5. May-June 1978
D.J. Thomson (1982) Spectrum estimation and harmonic analysis Proc. IEEE 70: 1055-1096, 1982.