If we want to perform a filter operation in practice then we need a linear and not a circular convolution. In this section we will show how a circular convolution can be used to realize a linear convolution between two signals x[n] and h[n].
Circular convolution.
Convolution of two finite duration signals
In the FTD module we have seen that the linear convolution y[n]=x[n]⋆h[n] of a finite duration signal x[n] of N1 samples with a finite duration impulse response h[n] of N2 samples results in a finite duration signal y[n] of length N=N1+N2−1 samples.
Linear convolution.
Fig. 2 shows an example of the linear convolution of x[n] and h[n], which are defined as follows:
x[n]=δ[n]+δ[n−1]+δ[n−2]+12δ[n−3]h[n]=δ[n]+34δ[n−1]+12δ[n−2]+14δ[n−3]
The result y[n]=x[n]⋆h[n] has finite duration of N=N1+N2−1=7 samples:
y[n]=δ[n]+74δ[n−1]+94δ[n−2]+2δ[n−3]+98δ[n−4]+12δ[n−5]+18δ[n−6]
Despite the fact that within the FP both xp[n] and hp[n] of Fig. 1 are the same as the signals x[n] and h[n] of Fig. 2, it is clear that the FP of the circular convolution result yp[n] does not result in the desired linear convolution result y[n].
However when first pad both xp[n] and hp[n] with zeros up to a length of N=7, as depicted in Fig. 3 by xp,b[n] and hp,b[n], then applying a circular convolution the result of yp,b[n]=xp,b[n]⊛hp,b[n] within the FP is exactly the same as the linear convolution result.
Linear by circular convolution of zero padded signals.
In general we can conclude with the following procedure:
If signal x[n] consists of N1 samples and impulse response h[n] of N2 samples the result of the linear convolution y[n]=x[n]⋆h[n] can be obtained from a circular convolution yp[n]=xp[n]⊛hp[n] in which both periodic extended xp[n] and hp[n] are padded with zeros up to a length of N≥N1+N2−1 samples.
Combining the previous procedure with the fact that a circular convolution is equivalent to a multiplication in the DFT frequency domain we will present a procedure to calculate a linear convolution by a circular one which is implemented in the DFT frequency domain. Referring to Fig. 4 the derivation of this procedure goes as follows:
Linear by circular convolution in DFT domain.
The left hand side of the figure represents a linear convolution result of a finite length signal x[n] of N1 samples with a finite length impulse response h[n] of N2 samples, resulting in a finite length signal y[n]=x[n]⋆h[n] of N=N1+N2−1 samples. The middle figure represents the linear- by circular procedure as explained above: When padding both x[n] and h[n] up to a length of at least N samples and then Periodic Extend both xp[n] and hp[n], the result of the samples in the FP of the circular convolution yp[n]=xp[n]⊛hp[n] is the same as the linear convolution y[n]=x[n]⋆h[n].
Finally, the right hand figure represents the the equivalence of a circular convolution to a multiplication in the DFT frequency domain: The circular convolution operation, as denoted in the red box of the middle figure, can be implemented by by the length N Inverse DFT of an element-wise multiplication of the length N DFT results of xp[n] and hp[n].
In one of the following sections we will show that the DFT can be implemented very efficiently by a so called Fast Fourier Transform (abbreviated by FFT). When applying FFT's it follows that the above described procedure is an extremely efficient way to implement a filter (or convolution) operation. This complexity reduction is one of the main reasons for existence of the DFT and FFT.
Example
Given two finite duration signals:
x[n]=δ[n]+δ[n−1]andh[n]=δ[n−1]+δ[n−2]
Calculate the linear convolution result y[n]=x[n]⋆h[n] and show how you can obtain this result by using a circular convolution of the periodic extended signals.
Finally show that this result can be achieved via the DFT domain.
The linear convolution result is y[n]=δ[n−1]+2δ[n−2]+δ[n−3].
The 3-point circular convolution result of the periodic extended signals
xp[n]=δ[nmod(3)]+δ[(n−1)mod(3)]hp[n]=δ[(n−1)mod(3)]+δ[(n−2)mod(3)]
results in yp[n]=δ[nmod(3)]+δ[(n−1)mod(3)]+2δ[(n−2)mod(3)], which is not the same as the linear convolution result.
Because of the fact that the length of the linear convolution result y[n] is 4 samples long, we need to pad the periodic extended signals up to length 4, thus:
xp[n]=δ[nmod(4)]+δ[(n−1)mod(4)]hp[n]=δ[(n−1)mod(4)]+δ[(n−2)mod(4)]
The resulting circular convolution
yp[n]=δ[(n−1)mod(4)]+2δ[(n−2)mod(4)]+δ[(n−3)mod(4)]
which is, within the FP, the same result as the linear convolution y[n].
Via the 4-point DFT we can obtain the same result. For simplicity reasons we calculate the 4-point DFT and IDFT results for indices within the FI and FP respectively, so we can skip the modulo notation:
Xp[k]=1+e−j2π4kHp[k]=e−j2π4k+e−j2π42kYp[k]=Xp[k]⋅Hp[k]=e−j2π4k+2e−j2π42k+e−j2π43kyp[k]=IDFT{Yp[k]}=δ[n−1]+2δ[n−2]+δ[n−3]