主要内容

sinc

R2026b

归一化正弦函数

语法

描述

sinc(x) 返回 sin(pi*x)/(pi*x)。符号 sinc 函数不实现浮点结果,只实现符号结果。Signal Processing Toolbox™ 中的 sinc 函数返回浮点结果。

示例

示例

全部折叠

创建符号变量 x 的 sinc 函数。

syms x
sinc(x)
ans = 

sin(π x)x π

证明 sinc 在输入为 0 时返回 1,在输入为其他整数时返回 0,在输入为其他值时返回精确的符号值。

V = sym([-1 0 1 3/2]);
S = sinc(V)
S = 

(010-23 π)

使用 vpa 将精确的符号输出转换为高精度浮点数。

vpa(S)
ans = (01.00-0.21220659078919378102517835116335)

尽管 sinc 可能出现在傅里叶变换表中,但 fourier 不会在输出中返回 sinc。

证明脉冲的 fourier 变换可以用 sin 和 cos 表示。

syms x
fourier(rectangularPulse(x))
ans = 

sin(w2)+cos(w2) iw--sin(w2)+cos(w2) iw

证明 sinc 的 fourier 变换可以用 heaviside 表示。

fourier(sinc(x))
ans = 

π heaviside(π-w)-π heaviside(-w-π)π

使用 fplot 绘制正弦函数。

syms x
fplot(sinc(x))

Figure contains an axes object. The axes object contains an object of type functionline.

使用 rewrite 将 sinc 函数重写为指数函数 exp。

syms x
rewrite(sinc(x),'exp')
ans = 

e-π x i i2-eπ x i i2x π

分别使用函数 diff、int 和 taylor 对 sinc 进行求导、积分和展开。

对 sinc 求导。

syms x
diff(sinc(x))
ans = 

cos(π x)x-sin(π x)x2 π

计算 sinc 从 -Inf 到 Inf 的积分。

int(sinc(x),[-Inf Inf])
ans = 1

计算 sinc 从 -Inf 到 x 的积分。

int(sinc(x),-Inf,x)
ans = 

sinint(π x)π+12

求 sinc 的泰勒展开式。

taylor(sinc(x))
ans = 

π4 x4120-π2 x26+1

将恒等式定义为一个条件,并使用 isAlways 函数来检查该条件,从而证明该恒等式。

证明恒等式 sinc(x)=1Γ(1+x)Γ(1-x)。

syms x
cond = sinc(x) == 1/(gamma(1+x)*gamma(1-x));
isAlways(cond)
ans = logical
   1

输入参数

全部折叠

输入,指定为数字、向量、矩阵、数组、符号数、符号变量、符号数组、符号函数或符号表达式。

版本历史记录

在 R2018b 中推出

另请参阅