📄 si2.m
字号:
function Y = si2(x,a)
% SI2 Integral of [sin(at)/(at)]^2 .
%
% Y = SI2(X,A) Computes integral of [sin(At)/(At)]^2 over [0, X]
%
% SI2 (with no input arguments) invokes the following example:
%
% % How much energy is contained in the central lobe [-1,1] of sinc(t)?
% % Since E=sinc^2(t) is even, we find the energy in half the mainlobe
% % and double result. NOTE that sinc(t) = sin(pi*t)/(pi*t)
% >>e = 2*si2(1,pi)
% % Plot the area under sinc(t) and sinc^2(t) over [0 5]
% >>t = 0:0.05:5;
% >>x1 = si(t,pi);
% >>x2 = si2(t,pi);
% >>plot(t,x1,t,x2),grid
% ADSP Toolbox: Version 2.0
% For use with "Analog and Digital Signal Processing", 2nd Ed.
% Published by PWS Publishing Co.
%
% Ashok Ambardar, EE Dept. MTU, Houghton, MI 49931, USA
% http://www.ee.mtu/faculty/akambard.html
% e-mail: akambard@mtu.edu
% Copyright (c) 1998
if nargin==0,help si2,disp('Strike a key to see results of the examples')
pause,e=2*si2(1,pi),t=0:.05:5;x1=si(t,pi);x2=si2(t,pi);
vx=matverch;
if vx < 4, eval('clg');else,eval('clf');end
plot(t,x1,t,x2),grid,return,end
if nargin<2,a=1;end
z=x+(x==0);y=abs(2*a*z);
Y1=si(y);
y1=rem(y,2*pi);
Y=(x~=0).*sign(x).*(Y1+(cos(y1)-1)./y)/a;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -