SINC Sin(pi*x)/(pi*x) function. CALL: y = sinc(x); y = sin(pi*x)/(pi*x) if x ~= 0 = 1 if x == 0 Example: x =linspace(-5,5)'; plot(x,sinc(x)) See also sin
Directional spreading functions |
01 function y = sinc(x) 02 %SINC Sin(pi*x)/(pi*x) function. 03 % 04 % CALL: y = sinc(x); 05 % 06 % y = sin(pi*x)/(pi*x) if x ~= 0 07 % = 1 if x == 0 08 % 09 % Example: 10 % x =linspace(-5,5)'; 11 % plot(x,sinc(x)) 12 % 13 % See also sin 14 15 %Tested on: Matlab 5.3 16 %History: 17 % by pab 05.04.2001 18 19 y = ones(size(x)); 20 k = find(x~=0); 21 if any(k); 22 xk = pi*x(k); 23 y(k) = sin(xk)./(xk); 24 end 25 26 27
Comments or corrections to the WAFO group