Posted By

Scooter on 11/08/08


Tagged

math


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

asifrizvigmailcom


Sinc function


 / Published in: ASP
 

URL: http://reusablecode.blogspot.com/2008/11/sinc-function.html

Both normalized and unnormalized sinc functions. Apparently useful for digital signal processing.

  1. <%
  2. ' Copyright (c) 2008, reusablecode.blogspot.com; some rights reserved.
  3. '
  4. ' This work is licensed under the Creative Commons Attribution License. To view
  5. ' a copy of this license, visit http://creativecommons.org/licenses/by/3.0/ or
  6. ' send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California
  7. ' 94305, USA.
  8.  
  9. Const M_PI = 3.14159265358979323846
  10.  
  11. ' Unnormalized sinc function.
  12. function sinc(x)
  13. sinc = sin(x) / x
  14. end function
  15.  
  16. ' Normalized sinc function.
  17. ' REQUIRES: constant M_PI
  18. function nsinc(x)
  19. sinc = sin(M_PI * x) / (M_PI * x)
  20. end function
  21. %>

Report this snippet  

You need to login to post a comment.