dpss: Compute Discrete Prolate Spheroidal Sequences

Description Usage Arguments Value References Examples

View source: R/dpss.R

Description

Compute Discrete Prolate Spheroidal (Slepian) Sequences for use as tapers or other applications. This function uses the tridiagonal method and exploits symmetry. Note the odd order tapers are normalized so that the slope at the centre is positive in accordance with Slepian (1978) and Thomson (1982). This differs from Percival and Walden (1993). This code follows section (8.3) of Percival and Walden (1993) using LAPACK function calls Anderson (1999).

Usage

1
dpss(n,k,nw, returnEigenvalues=TRUE)

Arguments

n

A positive integer, typically the non-zero-padded length of the time series.

k

A positive integer, the number of tapers, often 2*nw for spectrum estimation purposes.

nw

A positive double-precision number, the time-bandwidth parameter.

returnEigenvalues

If true the appropriate eigenvalues are calculated and returned using the function dpssToEigenvalues. If FALSE, the eigenvalues returned are from the LAPACK function DSTEBZ using the tridiagonal. See section 8.3 of Percival and Walden (1993), or equation (13) in Slepian (1978).

Value

v

A n by k matrix of Slepian Sequences. Each column represents the Slepian sequence of order k-1.

eigen

A length k vector of eigenvalues corresponding to equation (13) in Slepian (1978), or the eigenvalues of the input tridiagonal matrix returned from the internal call to the LAPACK function DSTEBZ.

References

Anderson, E. (1999). LAPACK Users' guide (Vol. 9). Siam.

Percival, D.B. and Walden, A.T. (1993) Spectral analysis for physical applications. Cambridge University Press.

Slepian, D. (1978) Prolate spheroidal wave functions, Fourier analysis, and uncertainty. V–The discrete case. Bell System Technical Journal Volume 57, pp. 1371–1430

Thomson, D.J (1982) Spectrum estimation and harmonic analysis. Proceedings of the IEEE Volume 70, number 9, pp. 1055–1096.

Examples

1
2
dpss(10,4,4.0)
dpss(100,8,5.0)

Example output

$v
             [,1]        [,2]        [,3]       [,4]
 [1,] 0.005660419 -0.02331981 -0.06563472  0.1451560
 [2,] 0.046372862 -0.14670743 -0.30203471  0.4535909
 [3,] 0.172998229 -0.38735446 -0.50054178  0.3486770
 [4,] 0.385464551 -0.51476867 -0.21710750 -0.2547512
 [5,] 0.565071862 -0.25080442  0.32678644 -0.2944677
 [6,] 0.565071862  0.25080442  0.32678644  0.2944677
 [7,] 0.385464551  0.51476867 -0.21710750  0.2547512
 [8,] 0.172998229  0.38735446 -0.50054178 -0.3486770
 [9,] 0.046372862  0.14670743 -0.30203471 -0.4535909
[10,] 0.005660419  0.02331981 -0.06563472 -0.1451560

$eigen
[1] 1.0000000 1.0000000 1.0000000 0.9999998

attr(,"class")
[1] "dpss"
$v
               [,1]          [,2]          [,3]          [,4]         [,5]
  [1,] 1.316370e-06 -1.224017e-05 -7.852767e-05  0.0004001286  0.001710360
  [2,] 4.307761e-06 -3.632033e-05 -2.099339e-04  0.0009568523  0.003629664
  [3,] 1.055242e-05 -8.279678e-05 -4.434738e-04  0.0018636792  0.006478779
  [4,] 2.222792e-05 -1.641124e-04 -8.242982e-04  0.0032350154  0.010448362
  [5,] 4.246648e-05 -2.969232e-04 -1.407992e-03  0.0051971657  0.015712285
  [6,] 7.561552e-05 -5.027850e-04 -2.260663e-03  0.0078835429  0.022412156
  [7,] 1.275276e-04 -8.087724e-04 -3.458400e-03  0.0114283110  0.030641209
  [8,] 2.058731e-04 -1.247974e-03 -5.085980e-03  0.0159585951  0.040428604
  [9,] 3.204666e-04 -1.859806e-03 -7.234761e-03  0.0215855131  0.051725328
 [10,] 4.835924e-04 -2.690083e-03 -9.999696e-03  0.0283944065  0.064392894
 [11,] 7.103168e-04 -3.790788e-03 -1.347549e-02  0.0364347597  0.078196004
 [12,] 1.018766e-03 -5.219480e-03 -1.775193e-02  0.0457103909  0.092800224
 [13,] 1.430351e-03 -7.038308e-03 -2.290858e-02  0.0561705648  0.107775458
 [14,] 1.969918e-03 -9.312590e-03 -2.900887e-02  0.0677027079  0.122605758
 [15,] 2.665802e-03 -1.210895e-02 -3.609399e-02  0.0801273985  0.136705567
 [16,] 3.549764e-03 -1.549301e-02 -4.417677e-02  0.0931962474  0.149442153
 [17,] 4.656782e-03 -1.952670e-02 -5.323584e-02  0.1065931846  0.160163482
 [18,] 6.024698e-03 -2.426519e-02 -6.321056e-02  0.1199395205  0.168230400
 [19,] 7.693686e-03 -2.975359e-02 -7.399693e-02  0.1328029682  0.173051575
 [20,] 9.705550e-03 -3.602349e-02 -8.544496e-02  0.1447105945  0.174119343
 [21,] 1.210285e-02 -4.308947e-02 -9.735777e-02  0.1551654350  0.171044365
 [22,] 1.492783e-02 -5.094573e-02 -1.094926e-01  0.1636662641  0.163586925
 [23,] 1.822124e-02 -5.956304e-02 -1.215641e-01  0.1697297811  0.151682682
 [24,] 2.202096e-02 -6.888615e-02 -1.332500e-01  0.1729142604  0.135460932
 [25,] 2.636061e-02 -7.883180e-02 -1.441988e-01  0.1728435461  0.115253676
 [26,] 3.126796e-02 -8.928753e-02 -1.540397e-01  0.1692301519  0.091594305
 [27,] 3.676348e-02 -1.001115e-01 -1.623949e-01  0.1618961730  0.065205208
 [28,] 4.285881e-02 -1.111331e-01 -1.688927e-01  0.1507907346  0.036974287
 [29,] 4.955538e-02 -1.221552e-01 -1.731822e-01  0.1360027950  0.007920995
 [30,] 5.684311e-02 -1.329569e-01 -1.749484e-01  0.1177682866 -0.020846796
 [31,] 6.469943e-02 -1.432977e-01 -1.739271e-01  0.0964708193 -0.048183158
 [32,] 7.308845e-02 -1.529232e-01 -1.699188e-01  0.0726354646 -0.072959253
 [33,] 8.196048e-02 -1.615711e-01 -1.628021e-01  0.0469154820 -0.094120367
 [34,] 9.125193e-02 -1.689782e-01 -1.525429e-01  0.0200722194 -0.110741715
 [35,] 1.008856e-01 -1.748882e-01 -1.392035e-01 -0.0070512042 -0.122079802
 [36,] 1.107712e-01 -1.790597e-01 -1.229455e-01 -0.0335614641 -0.127616274
 [37,] 1.208068e-01 -1.812744e-01 -1.040319e-01 -0.0585505456 -0.127091484
 [38,] 1.308797e-01 -1.813447e-01 -8.282281e-02 -0.0811336473 -0.120525516
 [39,] 1.408692e-01 -1.791213e-01 -5.976856e-02 -0.1004877093 -0.108225041
 [40,] 1.506478e-01 -1.744996e-01 -3.539869e-02 -0.1158887057 -0.090775177
 [41,] 1.600846e-01 -1.674251e-01 -1.030708e-02 -0.1267458282 -0.069016349
 [42,] 1.690475e-01 -1.578971e-01  1.486591e-02 -0.1326307852 -0.044007022
 [43,] 1.774065e-01 -1.459718e-01  3.945366e-02 -0.1333006359 -0.016974024
 [44,] 1.850362e-01 -1.317623e-01  6.278545e-02 -0.1287128640  0.010747063
 [45,] 1.918191e-01 -1.154381e-01  8.420924e-02 -0.1190317596  0.037778358
 [46,] 1.976486e-01 -9.722177e-02  1.031145e-01 -0.1046256001  0.062769423
 [47,] 2.024312e-01 -7.738443e-02  1.189542e-01 -0.0860545804  0.084466497
 [48,] 2.060889e-01 -5.623952e-02  1.312640e-01 -0.0640499115  0.101777404
 [49,] 2.085617e-01 -3.413492e-02  1.396801e-01 -0.0394849616  0.113828508
 [50,] 2.098085e-01 -1.144404e-02  1.439519e-01 -0.0133397273  0.120010509
 [51,] 2.098085e-01  1.144404e-02  1.439519e-01  0.0133397273  0.120010509
 [52,] 2.085617e-01  3.413492e-02  1.396801e-01  0.0394849616  0.113828508
 [53,] 2.060889e-01  5.623952e-02  1.312640e-01  0.0640499115  0.101777404
 [54,] 2.024312e-01  7.738443e-02  1.189542e-01  0.0860545804  0.084466497
 [55,] 1.976486e-01  9.722177e-02  1.031145e-01  0.1046256001  0.062769423
 [56,] 1.918191e-01  1.154381e-01  8.420924e-02  0.1190317596  0.037778358
 [57,] 1.850362e-01  1.317623e-01  6.278545e-02  0.1287128640  0.010747063
 [58,] 1.774065e-01  1.459718e-01  3.945366e-02  0.1333006359 -0.016974024
 [59,] 1.690475e-01  1.578971e-01  1.486591e-02  0.1326307852 -0.044007022
 [60,] 1.600846e-01  1.674251e-01 -1.030708e-02  0.1267458282 -0.069016349
 [61,] 1.506478e-01  1.744996e-01 -3.539869e-02  0.1158887057 -0.090775177
 [62,] 1.408692e-01  1.791213e-01 -5.976856e-02  0.1004877093 -0.108225041
 [63,] 1.308797e-01  1.813447e-01 -8.282281e-02  0.0811336473 -0.120525516
 [64,] 1.208068e-01  1.812744e-01 -1.040319e-01  0.0585505456 -0.127091484
 [65,] 1.107712e-01  1.790597e-01 -1.229455e-01  0.0335614641 -0.127616274
 [66,] 1.008856e-01  1.748882e-01 -1.392035e-01  0.0070512042 -0.122079802
 [67,] 9.125193e-02  1.689782e-01 -1.525429e-01 -0.0200722194 -0.110741715
 [68,] 8.196048e-02  1.615711e-01 -1.628021e-01 -0.0469154820 -0.094120367
 [69,] 7.308845e-02  1.529232e-01 -1.699188e-01 -0.0726354646 -0.072959253
 [70,] 6.469943e-02  1.432977e-01 -1.739271e-01 -0.0964708193 -0.048183158
 [71,] 5.684311e-02  1.329569e-01 -1.749484e-01 -0.1177682866 -0.020846796
 [72,] 4.955538e-02  1.221552e-01 -1.731822e-01 -0.1360027950  0.007920995
 [73,] 4.285881e-02  1.111331e-01 -1.688927e-01 -0.1507907346  0.036974287
 [74,] 3.676348e-02  1.001115e-01 -1.623949e-01 -0.1618961730  0.065205208
 [75,] 3.126796e-02  8.928753e-02 -1.540397e-01 -0.1692301519  0.091594305
 [76,] 2.636061e-02  7.883180e-02 -1.441988e-01 -0.1728435461  0.115253676
 [77,] 2.202096e-02  6.888615e-02 -1.332500e-01 -0.1729142604  0.135460932
 [78,] 1.822124e-02  5.956304e-02 -1.215641e-01 -0.1697297811  0.151682682
 [79,] 1.492783e-02  5.094573e-02 -1.094926e-01 -0.1636662641  0.163586925
 [80,] 1.210285e-02  4.308947e-02 -9.735777e-02 -0.1551654350  0.171044365
 [81,] 9.705550e-03  3.602349e-02 -8.544496e-02 -0.1447105945  0.174119343
 [82,] 7.693686e-03  2.975359e-02 -7.399693e-02 -0.1328029682  0.173051575
 [83,] 6.024698e-03  2.426519e-02 -6.321056e-02 -0.1199395205  0.168230400
 [84,] 4.656782e-03  1.952670e-02 -5.323584e-02 -0.1065931846  0.160163482
 [85,] 3.549764e-03  1.549301e-02 -4.417677e-02 -0.0931962474  0.149442153
 [86,] 2.665802e-03  1.210895e-02 -3.609399e-02 -0.0801273985  0.136705567
 [87,] 1.969918e-03  9.312590e-03 -2.900887e-02 -0.0677027079  0.122605758
 [88,] 1.430351e-03  7.038308e-03 -2.290858e-02 -0.0561705648  0.107775458
 [89,] 1.018766e-03  5.219480e-03 -1.775193e-02 -0.0457103909  0.092800224
 [90,] 7.103168e-04  3.790788e-03 -1.347549e-02 -0.0364347597  0.078196004
 [91,] 4.835924e-04  2.690083e-03 -9.999696e-03 -0.0283944065  0.064392894
 [92,] 3.204666e-04  1.859806e-03 -7.234761e-03 -0.0215855131  0.051725328
 [93,] 2.058731e-04  1.247974e-03 -5.085980e-03 -0.0159585951  0.040428604
 [94,] 1.275276e-04  8.087724e-04 -3.458400e-03 -0.0114283110  0.030641209
 [95,] 7.561552e-05  5.027850e-04 -2.260663e-03 -0.0078835429  0.022412156
 [96,] 4.246648e-05  2.969232e-04 -1.407992e-03 -0.0051971657  0.015712285
 [97,] 2.222792e-05  1.641124e-04 -8.242982e-04 -0.0032350154  0.010448362
 [98,] 1.055242e-05  8.279678e-05 -4.434738e-04 -0.0018636792  0.006478779
 [99,] 4.307761e-06  3.632033e-05 -2.099339e-04 -0.0009568523  0.003629664
[100,] 1.316370e-06  1.224017e-05 -7.852767e-05 -0.0004001286  0.001710360
               [,6]         [,7]         [,8]
  [1,] -0.006296551 -0.020174206  0.055885857
  [2,] -0.011755550 -0.032835344  0.078626030
  [3,] -0.019085472 -0.048032147  0.102423756
  [4,] -0.028406299 -0.065388664  0.125947143
  [5,] -0.039733629 -0.084321054  0.147739496
  [6,] -0.052959122 -0.104052702  0.166316869
  [7,] -0.067837090 -0.123645502  0.180274948
  [8,] -0.083979016 -0.142046394  0.188397336
  [9,] -0.100857343 -0.158146989  0.189756789
 [10,] -0.117819365 -0.170852867  0.183801025
 [11,] -0.134111329 -0.179158192  0.170415555
 [12,] -0.148912163 -0.182220498  0.149957444
 [13,] -0.161375445 -0.179430150  0.123255894
 [14,] -0.170677554 -0.170469023  0.091578022
 [15,] -0.176069256 -0.155353347  0.056560853
 [16,] -0.176927566 -0.134456598  0.020113227
 [17,] -0.172804386 -0.108509483 -0.015706125
 [18,] -0.163468419 -0.078575648 -0.048826043
 [19,] -0.148937026 -0.046003413 -0.077306097
 [20,] -0.129495145 -0.012355636 -0.099474813
 [21,] -0.105699102  0.020678507 -0.114052418
 [22,] -0.078363988  0.051384503 -0.120248373
 [23,] -0.048534347  0.078129788 -0.117825662
 [24,] -0.017438983  0.099470106 -0.107126138
 [25,]  0.013568145  0.114247492 -0.089054092
 [26,]  0.043077965  0.121672719 -0.065018344
 [27,]  0.069703393  0.121385912 -0.036836384
 [28,]  0.092158947  0.113490347 -0.006607057
 [29,]  0.109337956  0.098556234  0.023439134
 [30,]  0.120382351  0.077593288  0.051101151
 [31,]  0.124740322  0.051993133  0.074367955
 [32,]  0.122207701  0.023444709  0.091566274
 [33,]  0.112949856 -0.006172083  0.101484245
 [34,]  0.097502009 -0.034907627  0.103461259
 [35,]  0.076747249 -0.060870604  0.097436859
 [36,]  0.051872912 -0.082354010  0.083954576
 [37,]  0.024307459 -0.097950373  0.064120088
 [38,] -0.004358739 -0.106647966  0.039516557
 [39,] -0.032464111 -0.107901020  0.012083401
 [40,] -0.058372695 -0.101668688 -0.016032405
 [41,] -0.080571085 -0.088419661 -0.042641169
 [42,] -0.097759455 -0.069101705 -0.065678826
 [43,] -0.108930846 -0.045077932 -0.083365797
 [44,] -0.113433570 -0.018033958 -0.094344039
 [45,] -0.111012584  0.010137763 -0.097781608
 [46,] -0.101826993  0.037468468 -0.093436564
 [47,] -0.086442328  0.062049393 -0.081675150
 [48,] -0.065797857  0.082164304 -0.063442778
 [49,] -0.041150796  0.096408933 -0.040190005
 [50,] -0.014000779  0.103788848 -0.013759212
 [51,]  0.014000779  0.103788848  0.013759212
 [52,]  0.041150796  0.096408933  0.040190005
 [53,]  0.065797857  0.082164304  0.063442778
 [54,]  0.086442328  0.062049393  0.081675150
 [55,]  0.101826993  0.037468468  0.093436564
 [56,]  0.111012584  0.010137763  0.097781608
 [57,]  0.113433570 -0.018033958  0.094344039
 [58,]  0.108930846 -0.045077932  0.083365797
 [59,]  0.097759455 -0.069101705  0.065678826
 [60,]  0.080571085 -0.088419661  0.042641169
 [61,]  0.058372695 -0.101668688  0.016032405
 [62,]  0.032464111 -0.107901020 -0.012083401
 [63,]  0.004358739 -0.106647966 -0.039516557
 [64,] -0.024307459 -0.097950373 -0.064120088
 [65,] -0.051872912 -0.082354010 -0.083954576
 [66,] -0.076747249 -0.060870604 -0.097436859
 [67,] -0.097502009 -0.034907627 -0.103461259
 [68,] -0.112949856 -0.006172083 -0.101484245
 [69,] -0.122207701  0.023444709 -0.091566274
 [70,] -0.124740322  0.051993133 -0.074367955
 [71,] -0.120382351  0.077593288 -0.051101151
 [72,] -0.109337956  0.098556234 -0.023439134
 [73,] -0.092158947  0.113490347  0.006607057
 [74,] -0.069703393  0.121385912  0.036836384
 [75,] -0.043077965  0.121672719  0.065018344
 [76,] -0.013568145  0.114247492  0.089054092
 [77,]  0.017438983  0.099470106  0.107126138
 [78,]  0.048534347  0.078129788  0.117825662
 [79,]  0.078363988  0.051384503  0.120248373
 [80,]  0.105699102  0.020678507  0.114052418
 [81,]  0.129495145 -0.012355636  0.099474813
 [82,]  0.148937026 -0.046003413  0.077306097
 [83,]  0.163468419 -0.078575648  0.048826043
 [84,]  0.172804386 -0.108509483  0.015706125
 [85,]  0.176927566 -0.134456598 -0.020113227
 [86,]  0.176069256 -0.155353347 -0.056560853
 [87,]  0.170677554 -0.170469023 -0.091578022
 [88,]  0.161375445 -0.179430150 -0.123255894
 [89,]  0.148912163 -0.182220498 -0.149957444
 [90,]  0.134111329 -0.179158192 -0.170415555
 [91,]  0.117819365 -0.170852867 -0.183801025
 [92,]  0.100857343 -0.158146989 -0.189756789
 [93,]  0.083979016 -0.142046394 -0.188397336
 [94,]  0.067837090 -0.123645502 -0.180274948
 [95,]  0.052959122 -0.104052702 -0.166316869
 [96,]  0.039733629 -0.084321054 -0.147739496
 [97,]  0.028406299 -0.065388664 -0.125947143
 [98,]  0.019085472 -0.048032147 -0.102423756
 [99,]  0.011755550 -0.032835344 -0.078626030
[100,]  0.006296551 -0.020174206 -0.055885857

$eigen
[1] 1.0000000 1.0000000 1.0000000 0.9999999 0.9999965 0.9999356 0.9990973
[8] 0.9904996

attr(,"class")
[1] "dpss"

multitaper documentation built on Nov. 17, 2017, 4:02 a.m.

Related to dpss in multitaper...