DIRIC

This function computes the Dirichlet kernel.

Function Return Value

DIRIC — Function value. (Output)

Required Arguments

M — Spectral window parameter. (Input)

RANGLE — Angle in radians. (Input)

EPS — Positive bound on RANGLE that determines when an approximation to the Dirichlet kernel is appropriate. (Input)
EPS must be between 0 and π inclusive. The approximation is used when RANGLE is less than EPS.

FORTRAN 90 Interface

Generic: DIRIC (M, RANGLE, EPS)

Specific: The specific interface names are S_DIRIC and D_DIRIC.

FORTRAN 77 Interface

Single: DIRIC (M, RANGLE, EPS)

Double: The double precision name is DDIRIC.

Description

Routine DIRIC evaluates the Dirichlet kernel, DM(θ), for a given parameter M, angle θ = RANGLE, and tolerance ɛ = EPS. The computational form of the function is given by

 

The first case is an approximation to DM(θ) for small θ, and the second case is the usual theoretical definition.

In spectral analysis, the Dirichlet kernel corresponds to the truncated periodogram spectral window, and M is called the spectral window parameter. Since the Dirichlet kernel may be negative for certain values of θ, the truncated periodogram estimate of the spectral density may also be negative. This is an undesirable property since the true spectral density is a nonnegative function. See Priestley (1981, pages 437–438) and Anderson (1971, pages 508–511) for further discussion.

Comments

1. The Dirichlet kernel is equivalent to the truncated periodogram spectral window. The spectral window parameter denotes the truncation point in the weighted sum of sample autocovariances used to estimate the spectral density.

2. The Dirichlet kernel produces negative values for certain values of RANGLE. Thus, spectral windows that use the Dirichlet kernel may also take on negative values.

3. The Dirichlet kernel is defined between π and π, inclusive, and is zero otherwise.

Example

In this example, DIRIC is used to compute the Dirichlet kernel at θ = ± kπ/(2M + 1) for k = 0, 1, , (2M + 1) where M = 5 and ɛ = 0.01.

 

USE UMACH_INT

USE DIRIC_INT

 

IMPLICIT NONE

 

INTEGER K, M, NOUT

REAL EPS, PI, REAL, THETA, WT

INTRINSIC REAL

!

M = 5

EPS = .01

PI = 3.14159

!

CALL UMACH (2, NOUT)

!

WRITE (NOUT,99998)

99998 FORMAT (' K THETA WEIGHT ')

DO 10 K=0, 2*M + 1

THETA = (PI*REAL(K))/REAL(2*M+1)

WT = DIRIC(M,THETA,EPS)

WRITE (NOUT,99999) K, THETA, WT

99999 FORMAT (1X, I2, 2(3X,F8.5))

10 CONTINUE

!

END

Output

 

K THETA WEIGHT

0 0.00000 1.75070

1 0.28560 1.11833

2 0.57120 0.00000

3 0.85680 -0.38312

4 1.14240 0.00000

5 1.42800 0.24304

6 1.71359 0.00000

7 1.99919 -0.18919

8 2.28479 0.00000

9 2.57039 0.16587

10 2.85599 0.00000

11 3.14159 -0.15915