Today we're going to a Sinc function, both normalized and unnormalized. Apparently it's useful in digital signal processing.
Const M_PI = 3.14159265358979323846
' Unnormalized sinc function.
sinc = sin(x) / x
' Normalized sinc function.
' REQUIRES: constant M_PI
sinc = sin(M_PI * x) / (M_PI * x)
// Unnormalized sinc function.
return sin($x) / $x;
// Normalized sinc function.
return sin(M_PI * $x) / (M_PI * $x);