The output
y(t)y(t) size 12{y \( t \) } {} of a continuous-time linear time-invariant (LTI) system is related to its input
x(t)x(t) size 12{x \( t \) } {} and the system impulse response
h(t)h(t) size 12{h \( t \) } {} through the convolution integral expressed as (for details on the theory of convolution and LTI systems, refer to signals and systems textbooks, for example, references (Reference) - (Reference) ):
y(t)=∫−∞∞h(t−τ)x(τ)dτy(t)=∫−∞∞h(t−τ)x(τ)dτ size 12{y \( t \) = Int cSub { size 8{ - infinity } } cSup { size 8{ infinity } } {h \( t - τ \) x \( τ \) dτ} } {} (1)
For a computer program to perform the above continuous-time convolution integral, a numerical approximation of the integral is needed noting that computer programs operate in a discrete – not continuous – fashion. One way to approximate the continuous functions in the Equation (1) integral is to use piecewise constant functions. Define
δΔ(t)δΔ(t) size 12{δ rSub { size 8{Δ} } \( t \) } {} to be a rectangular pulse of width
ΔΔ size 12{Δ} {} and height 1, centered at
t=0t=0 size 12{t=0} {}:
δΔ(t)={1−Δ/2≤t≤Δ/20otherwiseδΔ(t)={1−Δ/2≤t≤Δ/20otherwise size 12{δ rSub { size 8{Δ} } \( t \) = left lbrace matrix {
1 {} # - Δ/2 <= t <= Δ/2 {} ##
0 {} # ital "otherwise"{}
} right none } {}(2)
Approximate a continuous function
x(t)x(t) size 12{x \( t \) } {} with a piecewise constant function
xΔ(t)xΔ(t) size 12{x rSub { size 8{Δ} } \( t \) } {} as a sequence of pulses spaced every
ΔΔ size 12{Δ} {} seconds in time with heights
x(kΔ)x(kΔ) size 12{x \( kΔ \) } {}:
xΔ(t)=∑k=−∞∞x(kΔ)δΔ(t−kΔ)xΔ(t)=∑k=−∞∞x(kΔ)δΔ(t−kΔ) size 12{x rSub { size 8{Δ} } \( t \) = Sum cSub { size 8{k= - infinity } } cSup { size 8{ infinity } } {x \( kΔ \) δ rSub { size 8{Δ} } \( t - kΔ \) } } {} (3)
It can be shown in the limit as
Δ→0,xΔ(t)→x(t)Δ→0,xΔ(t)→x(t) size 12{Δ rightarrow 0,x rSub { size 8{Δ} } \( t \) rightarrow x \( t \) } {}. As an example, Figure 1 shows the approximation of a decaying exponential
x(t)=exp(−t2)x(t)=exp(−t2) size 12{x \( t \) ="exp" \( - { {t} over {2} } \) } {} starting from 0 using
Δ=1Δ=1 size 12{Δ=1} {}. Similarly,
h(t)h(t) size 12{h \( t \) } {} can be approximated by
hΔ(t)=∑k=−∞∞h(kΔ)δΔ(t−kΔ)hΔ(t)=∑k=−∞∞h(kΔ)δΔ(t−kΔ) size 12{h rSub { size 8{Δ} } \( t \) = Sum cSub { size 8{k= - infinity } } cSup { size 8{ infinity } } {h \( kΔ \) δ rSub { size 8{Δ} } \( t - kΔ \) } } {}(4)
One can thus approximate the convolution integral by convolving the two piecewise constant signals as follows:
yΔ(t)=∫−∞∞hΔ(t−τ)xΔ(τ)dτyΔ(t)=∫−∞∞hΔ(t−τ)xΔ(τ)dτ size 12{y rSub { size 8{Δ} } \( t \) = Int cSub { size 8{ - infinity } } cSup { size 8{ infinity } } {h rSub { size 8{Δ} } \( t - τ \) x rSub { size 8{Δ} } \( τ \) dτ} } {} (5)
Notice that
yΔ(t)yΔ(t) size 12{y rSub { size 8{Δ} } \( t \) } {} is not necessarily a piecewise constant. For computer representation purposes, discrete output values are needed, which can be obtained by further approximating the convolution integral as indicated below:
yΔ(nΔ)=Δ∑k=−∞∞x(kΔ)h((n−k)Δ)yΔ(nΔ)=Δ∑k=−∞∞x(kΔ)h((n−k)Δ) size 12{y rSub { size 8{Δ} } \( nΔ \) =Δ Sum cSub { size 8{k= - infinity } } cSup { size 8{ infinity } } {x \( kΔ \) h \( \( n - k \) Δ \) } } {} (6)
If one represents the signals
hΔ(t)hΔ(t) size 12{h rSub { size 8{Δ} } \( t \) } {} and
xΔ(t)xΔ(t) size 12{x rSub { size 8{Δ} } \( t \) } {} in a .m file by vectors containing the values of the signals at
t=nΔt=nΔ size 12{t=nΔ} {}, then Equation (5) can be used to compute an approximation to the convolution of
x(t)x(t) size 12{x \( t \) } {} and
h(t)h(t) size 12{h \( t \) } {}. Compute the discrete convolution sum
∑k=−∞∞x(kΔ)h((n−k)Δ)∑k=−∞∞x(kΔ)h((n−k)Δ) size 12{ Sum cSub { size 8{k= - infinity } } cSup { size 8{ infinity } } {x \( kΔ \) h \( \( n - k \) Δ \) } } {}with the built-in LabVIEW MathScript command conv. Then, multiply this sum by
ΔΔ size 12{Δ} {} to get an estimate of
y(t)y(t) size 12{y \( t \) } {} at
t=nΔt=nΔ size 12{t=nΔ} {} Note that as
ΔΔ size 12{Δ} {} is made smaller, one gets a closer approximation to
y(t)y(t) size 12{y \( t \) } {}.
Convolution satisfies the following three properties (see Figure 2):
x(t)∗h(t)=h(t)∗x(t)x(t)∗h(t)=h(t)∗x(t) size 12{x \( t \) * h \( t \) =h \( t \) * x \( t \) } {}(7)
x(t)∗h1(t)∗h2(t)=x(t)∗{h1(t)∗h2(t)}x(t)∗h1(t)∗h2(t)=x(t)∗{h1(t)∗h2(t)} size 12{x \( t \) * h rSub { size 8{1} } \( t \) * h rSub { size 8{2} } \( t \) =x \( t \) * lbrace h rSub { size 8{1} } \( t \) * h rSub { size 8{2} } \( t \) rbrace } {} (8)
x(t)∗{h1(t)+h2(t)}=x(t)∗h1(t)+x(t)∗h2(t)x(t)∗{h1(t)+h2(t)}=x(t)∗h1(t)+x(t)∗h2(t) size 12{x \( t \) * lbrace h rSub { size 8{1} } \( t \) +h rSub { size 8{2} } \( t \) rbrace =x \( t \) * h rSub { size 8{1} } \( t \) +x \( t \) * h rSub { size 8{2} } \( t \) } {} (9)