dirichlet
The Dirichlet (or aliased sinc) function. Defined to be,
{ 1 if x % n === 0
dirichlet(n, x) = {
{ sin(pi * x) / (n * sin(pi * x / n)) otherwise
Alternatively, it is the inverse Fourier transform of the discrete rectangle function.
Example
var dirichlet = var x = 200var y = x console
Install
npm install dirichlet
API
require("dirichlet")(n, x)
Returns the value of the dirichlet function
n
is the number of samplesx
is the point at which the dirichlet function is evaluated
Returns The value of the dirichlet function at x
Credits
(c) 2014 Mikola Lysenko. MIT License