香农插值公式
x ( t ) = ∑ n = − ∞ ∞ x [ n ] sinc ( t − n T T ) x(t)=\sum_{n=-\infty}^{\infty} x[n] \operatorname{sinc}\left(\frac{t-n T}{T}\right) x(t)=n=−∞∑∞x[n]sinc(Tt−nT)
其中, x[n] 表示离散信号序列,sinc函数为归一化sinc函数(Normalized sinc function),其定义如下
sinc ( x ) = sin ( π x ) π x ; ( x ≠ 0 ) sinc ( 0 ) = 1 \begin{array}{l} \operatorname{sinc}(x)=\frac{\sin (\pi x)}{\pi x} ;(x \neq 0) \\ \operatorname{sinc}(0)=1 \end{array} sinc(x)=πxsin(πx);(x=0)sinc(0)=1
Mathematic验证
fCombined[x_, b_, fs_] :=
Sum[Sin[b n/fs] Sinc[Pi fs (x - n/fs)], {n, 0, 6*fs}]
list = Flatten@
Table[Manipulate[
Show[{Plot[Sin[x], {x, 0, 6}],
ListPlot[Table[{x, Sin[x]}, {x, 0, 6, 1/fs}]],
Plot[fCombined[x, 1, fs], {x, -1, 7}, PlotStyle -> {Orange}]},
PlotRange -> {-1, 1}], {fs, 0.1, 3, 0.1}]]
Export["animation.gif", list]
先定义一个插值公式,然后交互式画图,接着导出为gif。