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