Content deleted Content added
WP:FIX + general fixes, typo(s) fixed: modern day → modern-day, be be → be (4) using AWB |
|||
Line 1:
In signal processing, '''multidimensional discrete convolution''' refers to the mathematical operation between two functions ''f'' and ''g'' on an ''n''-dimensional lattice that produces a third function, also of ''n''-dimensions. Multidimensional discrete convolution is the discrete analog of the [[convolution#Domain of definition|multidimensional convolution]] of functions on Euclidean space.
==Definition==
Line 15:
The resulting output region of support of a discrete multidimensional convolution will be determined based on the size and regions of support of the two input signals.[[File:Picture1_wiki.png|thumb|475px|Visualization of Convolution between two Simple Two-Dimensional Signals|none]]
Listed are several properties of the two-dimensional convolution operator.
'''''Commutative Property:'''''
Line 29:
<math>x**(h+g) = (x**h) = (x**g)</math>
These properties are seen in use in the figure below.
<math>w = x ** h</math>
Line 44:
<math>h_{eq} = h**g</math>
[[File:Cascaded.png|none|thumb|272x272px|Both figures represent cascaded systems.
A similar analysis can be done on a set of parallel systems illustrated below.
In this case, it is clear that:
Line 66:
===Motivation & Applications===
Convolution in one dimension was a powerful discovery that allowed the input and output of a linear shift-invariant (LSI) system (see [[LTI system theory]]). to be easily compared so long as the impulse response of the filter system was known.
For example, consider an image that is sent over some wireless network subject to electrooptical noise. Possible noise sources include errors in channel transmission, the analog to digital converter, and the image sensor.
[[File:Screen Shot 2015-11-11 at 11.18.23 PM.png|none|thumb|311x311px|Impulse Responses of Typical Multidimensional Low Pass Filters]]
In addition to filtering out spectral content, the multidimensional convolution can implement edge detection and smoothing. This once again is wholly dependent on the values of the impulse response that is used to convolve with the input image.
[[File:Screen Shot 2015-11-11 at 11.21.00 PM.png|none|thumb|Typical Impulse Responses for Edge Detection]]
Line 134:
===Computational Speedup from Row-Column Decomposition===
Examine the case where an image of size <math>X\times Y</math> is being passed through a separable filter of size <math>J\times K</math>. The image itself is not separable. If the result is calculated using the direct convolution approach without exploiting the separability of the filter, this will require approximately <math>XYJK</math> multiplications and additions. If
[[File:Picture2 wiki.png|thumb|400px|Number of computations passing a ''10 x 10'' Image through a filter of size ''J x K'' where ''J = K'' varies in size from ''1'' to ''10''|none]]
Line 142:
===Convolution Theorem in Multiple Dimensions===
For one-dimensional signals, the [[Convolution theorem|Convolution Theorem]] states that the [[Fourier transform]] of the convolution between two signals is equal to the product of the Fourier Transforms of those two signals. Thus, convolution in the time ___domain is equal to multiplication in the frequency ___domain. Mathematically, this principle is expressed via the following:<math display="block">y(n)=h(n)*x(n)\longleftrightarrow Y(\omega)=H(\omega)X(\omega)</math>This principle is directly extendable to dealing with signals of multiple dimensions.<math display="block">y(n_1,n_2,...,n_M)=h(n_1,n_2,...,n_M)*\overset{M}{\cdots}*x(n_1,n_2,...,n_M) \longleftrightarrow Y(\omega_1,\omega_2,...,\omega_M)=H(\omega_1,\omega_2,...,\omega_M)X(\omega_1,\omega_2,...,\omega_M)</math>This property is readily extended to the usage with the [[Discrete Fourier transform]] (DFT) as follows (note that linear convolution is replaced with circular convolution where <math>\otimes</math> is used to denote the circular convolution operation of size <math>N</math>):
Line 173:
The result will be that <math>y_{circular}(n_1,n_2)</math> will be a spatially aliased version of the linear convolution result <math>y_{linear}(n_1,n_2)</math>. This can be expressed as the following:
<math>y_{circular}(n_1,n_2)=\sum_{r_1} \sum_{r_2} y_{linear}(n_1-r_1N_1, n_2-r_2N_2){\mathrm{\,\,\,for\,\,\,}}(n_1,n_2) \in R_{N_1N_2}</math>
Then, in order to avoid aliasing between the spatially aliased replicas, <math>N_1</math> and <math>N_2</math> must be chosen to satisfy the following conditions:
Line 183:
If these conditions are satisfied, then the results of the circular convolution will equal that of the linear convolution (taking the main period of the circular convolution as the region of support). That is:
<math>y_{circular}(n_1,n_2)=y_{linear}(n_1,n_2)</math> for <math>(n_1,n_2) \in R_{N_1N_2}</math>
===Summary of Procedure Using DFTs===
Line 191:
# Compute the DFTs of both <math>h(n_1,n_2)</math> and <math>x(n_1,n_2)</math>
# Multiple the results of the DFTs to obtain <math>Y(k_1,k_2)=H(k_1,k_2)X(k_1,k_2)</math>
# The result of
==Overlap and Add==
Another method to perform multidimensional convolution is the '''overlap and add''' approach.
Consider a two-dimensional convolution using a direct computation:
Line 201:
<math>y(n_1, n_2) = \sum_{k_1=-\infty}^{\infty} \sum_{k_2=-\infty}^{\infty} x(n_1 - k_1, n_2 - k_2)h(k_1, k_2)</math>
Assuming that the output signal <math>y(n_1, n_2)</math> has N nonzero coefficients, and the impulse response has M nonzero samples, this direct computation would need MN multiplies and MN - 1 adds in order to compute.
===Decomposition into Smaller Convolution Blocks===
Instead of performing convolution on the blocks of information in their entirety, the information can be broken up into smaller blocks of dimensions <math>L_1</math>x<math>L_2
</math> resulting in smaller FFTs, less computational complexity, and less storage needed.
<math>x(n_1, n_2) = \sum_{i=1}^{P_1} \sum_{j=1}^{P_2}x_{ij}(n_1, n_2)</math>
Line 237:
===Pictorial Method of Operation===
In order to visualize the overlap-add method more clearly, the following illustrations examine the method graphically. Assume that the input <math>x(n_1, n_2)</math> has a square region support of length N in both vertical and horizontal directions as shown in the figure below.
In the figure below, the first graph on the left represents the convolution corresponding to the component of the input <math>x_{0,0}</math> with the corresponding impulse response <math>h(n_1,n_2)</math>. To the right of that, the input <math>x_{1,0}</math> is then convolved with the impulse response <math>h(n_1,n_2)</math>.
[[File:Conjoined blocks.jpeg|thumb|387x387px|Individual Component Convolution with Impulse Response|none]][[File:Combined convo.png|left|thumb|255x255px|Convolution of each Component with the Overlap Portions Highlighted]]The same process is done for the other two inputs respectively, and they are accumulated together in order to form the convolution.
Assume that the filter impulse response <math>h(n_1,n_2)</math> has a region of support of <math>(N/8)</math> in both dimensions.
</math> and <math>n_2
</math> directions, which leads to overlap (highlighted in blue) since the length of each individual convolution is equivalent to:
Line 249:
<math>(N/2)</math> <math>+</math><math>(N/8)</math> <math>-</math><math>1</math> = <math>(5/8)N-1</math>
in both directions.
==Overlap and Save==
The overlap and save method, just like the overlap and add method, is also used to reduce the computational complexity associated with discrete-time convolutions.
===Comparison to Overlap and Add===
The overlap and save method is very similar to the overlap and add methods with a few notable exceptions. The overlap-add method involves a linear convolution of discrete-time signals, whereas the overlap-save method involves the principle of circular convolution.
In one dimension, the performance and storage metric differences between the two methods is minimal.
===Breakdown of Procedure===
Let <math>h(n_1, n_2)</math> be of size <math>M_1 \times M_2 </math>:
# Insert <math>(M_1 - 1)</math> columns and <math>(M_2 - 1)</math> rows of zeroes at the beginning of the input signal <math>x(n_1,n_2)</math> in both dimensions.
# Split the corresponding signal into overlapping segments of dimensions (<math>L_1 + M_1 - 1</math>)<math>\times</math>(<math>L_2 + M_2 - 1</math>) in which each two-dimensional block will overlap by <math>(M_1 - 1)</math> <math>\times</math> <math>(M_2 - 1)</math>.
# Zero pad <math>h(n_1, n_2)</math> such that it has dimensions (<math>L_1 + M_1 - 1</math>)<math>\times</math>(<math>L_2 + M_2 - 1</math>).
Line 269:
## Multiply to get <math>Y_{ij}(k_1, k_2) = X_{ij}(k_1, k_2)H(k_1,k_2)</math>.
## Take inverse discrete Fourier transform of <math>Y_{ij}(k_1, k_2)</math> to get <math>y_{ij}(n_1, n_2)</math>.
## Get rid
# Find <math>y(n_1, n_2)</math> by attaching the last <math>(L_1\times L_2)</math> samples for each output block <math>y_{ij}(n_1, n_2)</math>.<ref name=":3" />
==The Helix Transform==
Similar to row-column decomposition, the helix transform computes the multidimensional convolution by incorporating one-dimensional convolutional properties and operators.
===Multidimensional Convolution with One-Dimensional Convolution Methods===
To understand the helix transform, it is useful to first understand how a multidimensional convolution can be broken down into a one-dimensional convolution.
<math>Z(i,j) = \sum_{m=0}^{M-1}\sum_{n=0}^{N-1}X(m,n)Y(i-m, j-n)</math>
Line 292:
\end{bmatrix}</math>
where each of the input matrices are now of dimensions <math>(M+K-1)</math><math>\times</math><math>(N+L-1)</math>.
<math>l_{X''} =</math> <math>(M+K-1)</math><math>\times</math><math>(N-1)</math> + <math>M</math>
Line 302:
<math>l_{Z''} =</math> <math>l_{Y''} +</math><math>l_{X''}</math> <math>= (M+K-1)</math><math>\times</math><math>(N+L-1)</math>
Interestingly, this vector length is equivalent to the dimensions of the original matrix output <math>Z</math>, making converting back to a matrix a direct transformation.
===Filtering on a Helix===
When working on a two-dimensional Cartesian mesh, a Fourier transform along either axes will result in the two-dimensional plane becoming a cylinder as the end of each column or row attaches to its respective top forming a cylinder.
[[File:Cartesian combined.jpeg|none|thumb|480x480px|Transformation from a 2D Cartesian Filtering Plane to a Helix Filter.]]If this helical structure is then sliced and unwound into a one-dimensional strip, the same filter coefficients on the 2-d Cartesian plane will match up with the same input data, resulting in an equivalent filtering scheme.
[[File:1d strip.png|none|thumb|189x189px|One-Dimensional Filtering Strip after being Unwound.]]
Assuming that some-low pass two-dimensional filter was used, such as:
Line 313:
{| class="wikitable"
|0
| -1
|0
|-
Line 329:
<math> h(n) = -1, 0, ... , 0, -1, 4, 1, 0, ..., 0, -1, 0, ...</math>
Notice in the one-dimensional filter that there are no leading zeroes as illustrated in the one-dimensional filtering strip after being unwound.
===Applications===
Helix transformations to implement recursive filters via convolution are used in various areas of signal processing.
==Gaussian Convolution==
Line 347:
===Approximation by FIR Filter===
Gaussian convolution can be effectively approximated via implementation of a [[Finite impulse response]] (FIR) filter.
<math>H(z_1,z_2)=\frac{1}{s(r_1,r_2)} \sum_{n_1=-r_1}^{r_1}\sum_{n_2=-r_2}^{r_2}G(n_1,n_2){z_1}^{-n_1}{z_2}^{-n_2}</math>
|