Nyquist–Shannon sampling theorem: Difference between revisions

Content deleted Content added
Shannon's original proof: {{quote}}, display="block", rm double spacing nbsps
Tags: Mobile edit Mobile web edit Advanced mobile edit
Application to multivariable signals and images: don't use explicit image sizes; "to the right" is incorrect on mobile
Tags: Mobile edit Mobile web edit Advanced mobile edit
Line 124:
==Application to multivariable signals and images==
{{Main|Multidimensional sampling}}
[[File:Moire pattern of bricks small.jpg|thumb|right|205px|Subsampled image showing a [[Moiré pattern]] |upright=0.9]]
[[File:Moire pattern of bricks.jpg|thumb|right|205px|Properly sampled image|upright=0.9]]
 
[[File:Moire pattern of bricks.jpg|thumb|right|205px|Properly sampled image]]
 
The sampling theorem is usually formulated for functions of a single variable. Consequently, the theorem is directly applicable to time-dependent signals and is normally formulated in that context. However, the sampling theorem can be extended in a straightforward way to functions of arbitrarily many variables. Grayscale images, for example, are often represented as two-dimensional arrays (or matrices) of real numbers representing the relative intensities of [[pixel]]s (picture elements) located at the intersections of row and column sample locations. As a result, images require two independent variables, or indices, to specify each pixel uniquely—one for the row, and one for the column.
Line 134 ⟶ 133:
Similar to one-dimensional discrete-time signals, images can also suffer from aliasing if the sampling resolution, or pixel density, is inadequate. For example, a digital photograph of a striped shirt with high frequencies (in other words, the distance between the stripes is small), can cause aliasing of the shirt when it is sampled by the camera's [[image sensor]]. The aliasing appears as a [[moiré pattern]]. The "solution" to higher sampling in the spatial ___domain for this case would be to move closer to the shirt, use a higher resolution sensor, or to optically blur the image before acquiring it with the sensor using an [[optical low-pass filter]].
 
Another example is shown to the righthere in the brick patterns. The top image shows the effects when the sampling theorem's condition is not satisfied. When software rescales an image (the same process that creates the thumbnail shown in the lower image) it, in effect, runs the image through a [[low-pass filter]] first and then [[downsampling|downsamples]] the image to result in a smaller image that does not exhibit the [[moiré pattern]]. The top image is what happens when the image is downsampled without low-pass filtering: aliasing results.
 
The sampling theorem applies to camera systems, where the scene and lens constitute an analog spatial signal source, and the image sensor is a spatial sampling device. Each of these components is characterized by a [[optical transfer function|modulation transfer function]] (MTF), representing the precise resolution (spatial bandwidth) available in that component. Effects of aliasing or blurring can occur when the lens MTF and sensor MTF are mismatched. When the optical image which is sampled by the sensor device contains higher spatial frequencies than the sensor, the under sampling acts as a low-pass filter to reduce or eliminate aliasing. When the area of the sampling spot (the size of the pixel sensor) is not large enough to provide sufficient [[spatial anti-aliasing]], a separate anti-aliasing filter (optical low-pass filter) may be included in a camera system to reduce the MTF of the optical image. Instead of requiring an optical filter, the [[graphics processing unit]] of [[smartphone]] cameras performs [[digital signal processing]] to remove aliasing with a digital filter. Digital filters also apply sharpening to amplify the contrast from the lens at high spatial frequencies, which otherwise falls off rapidly at diffraction limits.
 
The sampling theorem also applies to post-processing digital images, such as to up or down sampling. Effects of aliasing, blurring, and sharpening may be adjusted with digital filtering implemented in software, which necessarily follows the theoretical principles.
 
==Critical frequency==