Gaussian window for FFT https://en.wikipedia.org/wiki/Window_function

window_gaussian(n, sigma)

Arguments

n

length of signal (integer)

sigma

the standard deviation in periods (numeric)

Value

window

Examples

window_gaussian(100, 0.3)
#> [1] 0.003865920 0.004827841 0.006001828 0.007427537 0.009150329 0.011221714 #> [7] 0.013699739 0.016649300 0.020142358 0.024258013 0.029082436 0.034708586 #> [13] 0.041235730 0.048768687 0.057416809 0.067292653 0.078510341 0.091183589 #> [19] 0.105423424 0.121335577 0.139017610 0.158555782 0.180021743 0.203469095 #> [25] 0.228929919 0.256411363 0.285892388 0.317320791 0.350610628 0.385640143 #> [31] 0.422250338 0.460244268 0.499387171 0.539407507 0.579998944 0.620823333 #> [37] 0.661514656 0.701683915 0.740924889 0.778820649 0.814950710 0.848898643 #> [43] 0.880259960 0.908650076 0.933712125 0.955124403 0.972607234 0.985929045 #> [49] 0.994911470 0.999433325 0.999433325 0.994911470 0.985929045 0.972607234 #> [55] 0.955124403 0.933712125 0.908650076 0.880259960 0.848898643 0.814950710 #> [61] 0.778820649 0.740924889 0.701683915 0.661514656 0.620823333 0.579998944 #> [67] 0.539407507 0.499387171 0.460244268 0.422250338 0.385640143 0.350610628 #> [73] 0.317320791 0.285892388 0.256411363 0.228929919 0.203469095 0.180021743 #> [79] 0.158555782 0.139017610 0.121335577 0.105423424 0.091183589 0.078510341 #> [85] 0.067292653 0.057416809 0.048768687 0.041235730 0.034708586 0.029082436 #> [91] 0.024258013 0.020142358 0.016649300 0.013699739 0.011221714 0.009150329 #> [97] 0.007427537 0.006001828 0.004827841 0.003865920