信号处理 - 微分到差分的转换

文章目录

  • 向前差分
  • 向后差分
  • 例子

信号处理 - 微分到差分的转换_第1张图片

对于连续函数 f ( t ) f(t) f(t),采样后为 f ( k T ) f(kT) f(kT),将其简写为 f ( k ) f(k) f(k)

向前差分

  • 一阶向前差分: Δ f ( k ) = f ( k + 1 ) − f ( k ) \Delta f(k)=f(k+1)-f(k) Δf(k)=f(k+1)f(k)
  • 二阶向前差分: Δ 2 f ( k ) = Δ f ( k + 1 ) − Δ f ( k ) = f ( k + 2 ) − 2 f ( k + 1 ) + f ( k ) \begin{aligned} \Delta^{2} f(k) &=\Delta f(k+1)-\Delta f(k) =f(k+2)-2 f(k+1)+f(k) \end{aligned} Δ2f(k)=Δf(k+1)Δf(k)=f(k+2)2f(k+1)+f(k)
  • n阶向前差分: Δ n f ( k ) = Δ n − 1 f ( k + 1 ) − Δ n − 1 f ( k ) \Delta^{n} f(k)=\Delta^{n-1} f(k+1)-\Delta^{n-1} f(k) Δnf(k)=Δn1f(k+1)Δn1f(k)

向后差分

  • 一阶向后差分: ∇ f ( k ) = f ( k ) − f ( k − 1 ) \nabla f(k)=f(k)-f(k-1) f(k)=f(k)f(k1)
  • 二阶向后差分: ∇ 2 f ( k ) = ∇ [ Δ f ( k ) ] = f ( k ) − 2 f ( k − 1 ) + f ( k − 2 ) \nabla^{2} f(k)=\nabla[\Delta f(k)]=f(k)-2 f(k-1)+f(k-2) 2f(k)=[Δf(k)]=f(k)2f(k1)+f(k2)
  • n阶向后差分: ∇ n f ( k ) = ∇ n − 1 f ( k ) − ∇ n − 1 f ( k − 1 ) \nabla^{n} f(k)=\nabla^{n-1} f(k)-\nabla^{n-1} f(k-1) nf(k)=n1f(k)n1f(k1)

例子

假设连续系统微分方程为:
a n d n y d t n + a n − 1 d n − 1 y d t n − 1 + ⋯ + a 1 d y d t + a 0 y = b m d m x d t m + b m − 1 d m − 1 x d t m − 1 + ⋯ + b 1 d x d t + b 0 x a_{n} \frac{d^{n} y}{d t^{n}}+a_{n-1} \frac{d^{n-1} y}{d t^{n-1}}+\cdots+a_{1} \frac{d y}{d t}+a_{0} y=b_{m} \frac{d^{m} x}{d t^{m}}+b_{m-1} \frac{d^{m-1} x}{d t^{m-1}}+\cdots+b_{1} \frac{d x}{d t}+b_{0} x andtndny+an1dtn1dn1y++a1dtdy+a0y=bmdtmdmx+bm1dtm1dm1x++b1dtdx+b0x
则两边同时除以 a 0 a_{0} a0得:
a n a 0 d n y d t n + a n − 1 a 0 d n − 1 y d t n − 1 + ⋯ + a 1 a 0 d y d t + y = b m a 0 d m x d t m + b m − 1 a 0 d m − 1 x d t m − 1 + ⋯ + b 1 a 0 d x d t + b 0 a 0 x \frac{a_{n}}{a_{0}} \frac{d^{n} y}{d t^{n}}+\frac{a_{n-1}}{a_{0}} \frac{d^{n-1} y}{d t^{n-1}}+\cdots+\frac{a_{1}}{a_{0}} \frac{d y}{d t}+y=\frac{b_{m}}{a_{0}} \frac{d^{m} x}{d t^{m}}+\frac{b_{m-1}}{a_{0}} \frac{d^{m-1} x}{d t^{m-1}}+\cdots+\frac{b_{1}}{a_{0}} \frac{d x}{d t}+\frac{b_{0}}{a_{0}} x a0andtndny+a0an1dtn1dn1y++a0a1dtdy+y=a0bmdtmdmx+a0bm1dtm1dm1x++a0b1dtdx+a0b0x
a n ′ d n y d t n + a n − 1 ′ d n − 1 y d t n − 1 + ⋯ + a 1 ′ d y d t + y = b m ′ d m x d t m + b m − 1 ′ d m − 1 x d t m − 1 + ⋯ + b 1 ′ d x d t + b 0 ′ x a_{n}^{\prime} \frac{d^{n} y}{d t^{n}}+a_{n-1}^{\prime} \frac{d^{n-1} y}{d t^{n-1}}+\cdots+a_{1}^{\prime} \frac{d y}{d t}+y=b_{m}^{\prime} \frac{d^{m} x}{d t^{m}}+b_{m-1}^{\prime} \frac{d^{m-1} x}{d t^{m-1}}+\cdots+b_{1}^{\prime} \frac{d x}{d t}+b_{0}^{\prime} x andtndny+an1dtn1dn1y++a1dtdy+y=bmdtmdmx+bm1dtm1dm1x++b1dtdx+b0x
w h e r e where where, a k ′ = a k a 0 ( k = 1 … n ) , b k ′ = b k a 0 ( k = 0 … n ) a_{k}^{\prime}=\frac{a_{k}}{a_{0}}(k=1 \ldots n), \quad b_{\mathrm{k}}^{\prime}=\frac{b_{k}}{a_{0}}(k=0 \ldots n) ak=a0ak(k=1n),bk=a0bk(k=0n)
使用向后差分的形式,则等式左边的微分项转为差分项为:
y = y ( n ) = y ( k ) d y d t = y ( n ) − y ( n − 1 ) T = y ( k − 1 ) d 2 y d t 2 = y ( n ) − y ( n − 1 ) T − y ( n − 1 ) − y ( n − 2 ) T = y ( n ) − 2 y ( n − 1 ) + y ( n − 2 ) T 2 = y ( k − 2 ) ⋯ d n y d t n = y ( k − n ) \begin{array}{l}{y=y(n)=y(k)} \\\\ {\frac{d y}{d t}=\frac{y(n)-y(n-1)}{T}=y(k-1)} \\\\ {\frac{d^{2} y}{d t^{2}}=\frac{y(n)-y(n-1)}{T}-\frac{y(n-1)-y(n-2)}{T}=\frac{y(n)-2 y(n-1)+y(n-2)}{T^{2}}=y(k-2)} \\\\ {\cdots} \\\\ {\frac{d^{n} y}{d t^{n}}=y(k-n)}\end{array} y=y(n)=y(k)dtdy=Ty(n)y(n1)=y(k1)dt2d2y=Ty(n)y(n1)Ty(n1)y(n2)=T2y(n)2y(n1)+y(n2)=y(k2)dtndny=y(kn)
同理,等式右边的微分项转为差分项为:
x = x ( n ) = u ( k ) d x d t = x ( n ) − x ( n − 1 ) T = u ( k − 1 ) d 2 x d t 2 = x ( n ) − 2 x ( n − 1 ) + x ( n − 2 ) T 2 = u ( k − 2 ) ⋯ d m x d t m = u ( k − m ) \begin{array}{l}{x=x(n)=u(k)} \\\\ {\frac{d x}{d t}=\frac{x(n)-x(n-1)}{T}=u(k-1)} \\\\ {\frac{d^{2} x}{d t^{2}}=\frac{x(n)-2 x(n-1)+x(n-2)}{T^{2}}=u(k-2)} \\\\ {\cdots} \\\\ {\frac{d^{m} x}{d t^{m}}=u(k-m)}\end{array} x=x(n)=u(k)dtdx=Tx(n)x(n1)=u(k1)dt2d2x=T2x(n)2x(n1)+x(n2)=u(k2)dtmdmx=u(km)
将上述所得差分项替换原式中的微分项得:
a n ′ y ( k − n ) + ⋯ + a 1 ′ y ( k − 1 ) + y ( k ) = b m ′ x ( k − m ) + ⋯ + b 1 ′ x ( k − 1 ) + b 0 ′ x ( k ) + ξ ( k ) a_{n}^{\prime} y(k-n)+\cdots+a_{1}^{\prime} y(k-1)+y(k)=b_{m}^{\prime} x(k-m)+\cdots+b_{1}^{\prime} x(k-1)+b_{0}^{\prime} x(k)+\xi(k) any(kn)++a1y(k1)+y(k)=bmx(km)++b1x(k1)+b0x(k)+ξ(k)
w h e r e where where a k ′ = a k a 0 ( k = 1 … n ) , b k ′ = b k a 0 ( k = 0 … n ) , ξ ( k ) 为 由 于 差 分 运 算 导 致 的 误 差 项 a_{k}^{\prime}=\frac{a_{k}}{a_{0}}(k=1 \ldots n), \quad b_{\mathrm{k}}^{\prime}=\frac{b_{k}}{a_{0}}(k=0 \ldots n) ,\xi(k)为由于差分运算导致的误差项 ak=a0ak(k=1n),bk=a0bk(k=0n)ξ(k)


关于微分方程与差分方程的联系与区别可参考博文《微分方程和差分方程的区别与联系》

你可能感兴趣的:(▶,机器人学)