Circular convolution, also known as cyclic convolution, is a special case of periodic convolution, which is the
convolution
In mathematics (in particular, functional analysis), convolution is a mathematical operation on two functions ( and ) that produces a third function (f*g) that expresses how the shape of one is modified by the other. The term ''convolution' ...
of two periodic functions that have the same period. Periodic convolution arises, for example, in the context of the
discrete-time Fourier transform
In mathematics, the discrete-time Fourier transform (DTFT) is a form of Fourier analysis that is applicable to a sequence of values.
The DTFT is often used to analyze samples of a continuous function. The term ''discrete-time'' refers to the ...
(DTFT). In particular, the DTFT of the product of two discrete sequences is the periodic convolution of the DTFTs of the individual sequences. And each DTFT is a
periodic summation
In signal processing, any periodic function s_P(t) with period ''P'' can be represented by a summation of an infinite number of instances of an aperiodic function s(t), that are offset by integer multiples of ''P''. This representation is called p ...
of a continuous Fourier transform function (see ). Although DTFTs are usually continuous functions of frequency, the concepts of periodic and circular convolution are also directly applicable to discrete sequences of data. In that context, circular convolution plays an important role in maximizing the efficiency of a certain kind of common filtering operation.
Definitions
The ''periodic convolution'' of two T-periodic functions,
and
can be defined as:
:
[
where ''t''o is an arbitrary parameter. An alternative definition, in terms of the notation of normal ''linear'' or ''aperiodic'' convolution, follows from expressing and as periodic summations of aperiodic components and , i.e.:
:
Then:
Both forms can be called ''periodic convolution''. The term ''circular convolution''][ arises from the important special case of constraining the non-zero portions of both and to the interval Then the periodic summation becomes a ''periodic extension'', which can also be expressed as a ''circular function'':
: ( any real number)
And the limits of integration reduce to the length of function :
:
]
Discrete sequences
Similarly, for discrete sequences, and a parameter N, we can write a circular convolution of aperiodic functions and as:
:
This function is N-periodic. It has at most N unique values. For the special case that the non-zero extent of both ''x'' and ''h'' are ''≤ N'', it is reducible to matrix multiplication
In mathematics, particularly in linear algebra, matrix multiplication is a binary operation that produces a matrix from two matrices. For matrix multiplication, the number of columns in the first matrix must be equal to the number of rows in the ...
where the kernel of the integral transform is a circulant matrix
In linear algebra, a circulant matrix is a square matrix in which all row vectors are composed of the same elements and each row vector is rotated one element to the right relative to the preceding row vector. It is a particular kind of Toeplit ...
.
Example
A case of great practical interest is illustrated in the figure. The duration of the x sequence is N (or less), and the duration of the h sequence is significantly less. Then many of the values of the circular convolution are identical to values of x∗h, which is actually the desired result when the h sequence is a finite impulse response
In signal processing, a finite impulse response (FIR) filter is a filter whose impulse response (or response to any finite length input) is of ''finite'' duration, because it settles to zero in finite time. This is in contrast to infinite impulse ...
(FIR) filter. Furthermore, the circular convolution is very efficient to compute, using a fast Fourier transform
A fast Fourier transform (FFT) is an algorithm that computes the discrete Fourier transform (DFT) of a sequence, or its inverse (IDFT). Fourier analysis converts a signal from its original domain (often time or space) to a representation in t ...
(FFT) algorithm and the circular convolution theorem.
There are also methods for dealing with an x sequence that is longer than a practical value for N. The sequence is divided into segments (''blocks'') and processed piecewise. Then the filtered segments are carefully pieced back together. Edge effects are eliminated by ''overlapping'' either the input blocks or the output blocks. To help explain and compare the methods, we discuss them both in the context of an h sequence of length 201 and an FFT size of ''N'' = 1024.
Overlapping input blocks
This method uses a block size equal to the FFT size (1024). We describe it first in terms of normal or ''linear'' convolution. When a normal convolution is performed on each block, there are start-up and decay transients at the block edges, due to the filter ''latency'' (200-samples). Only 824 of the convolution outputs are unaffected by edge effects. The others are discarded, or simply not computed. That would cause gaps in the output if the input blocks are contiguous. The gaps are avoided by overlapping the input blocks by 200 samples. In a sense, 200 elements from each input block are "saved" and carried over to the next block. This method is referred to as overlap-save,[ although the method we describe next requires a similar "save" with the output samples.
When an FFT is used to compute the 824 unaffected DFT samples, we don't have the option of not computing the affected samples, but the leading and trailing edge-effects are overlapped and added because of circular convolution. Consequently, the 1024-point inverse FFT (IFFT) output contains only 200 samples of edge effects (which are discarded) and the 824 unaffected samples (which are kept). To illustrate this, the fourth frame of the figure at right depicts a block that has been periodically (or "circularly") extended, and the fifth frame depicts the individual components of a linear convolution performed on the entire sequence. The edge effects are where the contributions from the extended blocks overlap the contributions from the original block. The last frame is the composite output, and the section colored green represents the unaffected portion.
]
Overlapping output blocks
This method is known as '' overlap-add''.[ In our example, it uses contiguous input blocks of size 824 and pads each one with 200 zero-valued samples. Then it overlaps and adds the 1024-element output blocks. Nothing is discarded, but 200 values of each output block must be "saved" for the addition with the next block. Both methods advance only 824 samples per 1024-point IFFT, but overlap-save avoids the initial zero-padding and final addition.
]
See also
* Convolution theorem
*Circulant matrix
In linear algebra, a circulant matrix is a square matrix in which all row vectors are composed of the same elements and each row vector is rotated one element to the right relative to the preceding row vector. It is a particular kind of Toeplit ...
* Discrete Hilbert transform
Page citations
References
# Also available at https://d1.amobbs.com/bbs_upload782111/files_24/ourdev_523225.pdf
#
Further reading
*
{{refend
Functional analysis
Image processing
Binary operations