Hubbry Logo
Downsampling (signal processing)Downsampling (signal processing)Main
Open search
Downsampling (signal processing)
Community hub
Downsampling (signal processing)
logo
7 pages, 0 posts
0 subscribers
Be the first to start a discussion here.
Be the first to start a discussion here.
Downsampling (signal processing)
Downsampling (signal processing)
from Wikipedia

In digital signal processing, downsampling, subsampling, compression, and decimation are terms associated with the process of resampling in a multi-rate digital signal processing system. Both downsampling and decimation can be synonymous with compression, or they can describe an entire process of bandwidth reduction (filtering) and sample-rate reduction.[1][2] When the process is performed on a sequence of samples of a signal or a continuous function, it produces an approximation of the sequence that would have been obtained by sampling the signal at a lower rate (or density, as in the case of a photograph).

Decimation is a term that historically means the removal of every tenth one.[a] But in signal processing, decimation by a factor of 10 actually means keeping only every tenth sample. This factor multiplies the sampling interval or, equivalently, divides the sampling rate. For example, if compact disc audio at 44,100 samples/second is decimated by a factor of 5/4, the resulting sample rate is 35,280. A system component that performs decimation is called a decimator. Decimation by an integer factor is also called compression.[3][4]

Downsampling by an integer factor

[edit]

Rate reduction by an integer factor M can be explained as a two-step process, with an equivalent implementation that is more efficient:[5]

  1. Reduce high-frequency signal components with a digital lowpass filter.
  2. Decimate the filtered signal by M; that is, keep only every Mth sample.

Step 2 alone creates undesirable aliasing (i.e. high-frequency signal components will copy into the lower frequency band and be mistaken for lower frequencies). Step 1, when necessary, suppresses aliasing to an acceptable level. In this application, the filter is called an anti-aliasing filter, and its design is discussed below. Also see undersampling for information about decimating bandpass functions and signals.

When the anti-aliasing filter is an IIR design, it relies on feedback from output to input, prior to the second step. With FIR filtering, it is an easy matter to compute only every Mth output. The calculation performed by a decimating FIR filter for the nth output sample is a dot product:[b]

where the h[•] sequence is the impulse response, and K is its length.  x[•] represents the input sequence being downsampled. In a general purpose processor, after computing y[n], the easiest way to compute y[n+1] is to advance the starting index in the x[•] array by M, and recompute the dot product. In the case M=2, h[•] can be designed as a half-band filter, where almost half of the coefficients are zero and need not be included in the dot products.

Impulse response coefficients taken at intervals of M form a subsequence, and there are M such subsequences (phases) multiplexed together. The dot product is the sum of the dot products of each subsequence with the corresponding samples of the x[•] sequence. Furthermore, because of downsampling by M, the stream of x[•] samples involved in any one of the M dot products is never involved in the other dot products. Thus M low-order FIR filters are each filtering one of M multiplexed phases of the input stream, and the M outputs are being summed. This viewpoint offers a different implementation that might be advantageous in a multi-processor architecture. In other words, the input stream is demultiplexed and sent through a bank of M filters whose outputs are summed. When implemented that way, it is called a polyphase filter.

For completeness, we now mention that a possible, but unlikely, implementation of each phase is to replace the coefficients of the other phases with zeros in a copy of the h[•] array, process the original x[•] sequence at the input rate (which means multiplying by zeros), and decimate the output by a factor of M. The equivalence of this inefficient method and the implementation described above is known as the first Noble identity.[6][c] It is sometimes used in derivations of the polyphase method.

Fig 1: These graphs depict the spectral distributions of an oversampled function and the same function sampled at 1/3 the original rate. The bandwidth, B, in this example is just small enough that the slower sampling does not cause overlap (aliasing). Sometimes, a sampled function is resampled at a lower rate by keeping only every Mth sample and discarding the others, commonly called "decimation". Potential aliasing is prevented by lowpass-filtering the samples before decimation. The maximum filter bandwidth is tabulated in the bandwidth units used by the common filter design applications.

Anti-aliasing filter

[edit]

Let X(f) be the Fourier transform of any function, x(t), whose samples at some interval, T, equal the x[n] sequence. Then the discrete-time Fourier transform (DTFT) is a Fourier series representation of a periodic summation of X(f):[d]

When T has units of seconds, has units of hertz. Replacing T with MT in the formulas above gives the DTFT of the decimated sequence, x[nM]:

The periodic summation has been reduced in amplitude and periodicity by a factor of M.  An example of both these distributions is depicted in the two traces of Fig 1.[e][f][g] Aliasing occurs when adjacent copies of X(f) overlap. The purpose of the anti-aliasing filter is to ensure that the reduced periodicity does not create overlap. The condition that ensures the copies of X(f) do not overlap each other is: so that is the maximum cutoff frequency of an ideal anti-aliasing filter.[A]

By a rational factor

[edit]

Let M/L denote the decimation factor,[B] where: M, L ∈ ; M > L.

  1. Increase (resample) the sequence by a factor of L. This is called Upsampling, or interpolation.
  2. Decimate by a factor of M

Step 1 requires a lowpass filter after increasing (expanding) the data rate, and step 2 requires a lowpass filter before decimation. Therefore, both operations can be accomplished by a single filter with the lower of the two cutoff frequencies. For the M > L case, the anti-aliasing filter cutoff,  cycles per intermediate sample, is the lower frequency.

See also

[edit]

Notes

[edit]

Page citations

[edit]
  1. ^ Harris 2004. "6.1". p 128.
  2. ^ Crochiere and Rabiner "2". p 32. eq 2.55a.
  3. ^ Harris 2004. "2.2.1". p 25.
  4. ^ Oppenheim and Schafer. "4.2". p 143. eq 4.6, where:      and  
  5. ^ Harris 2004. "2.2". p 22. fig 2.10.
  6. ^ Oppenheim and Schafer. "4.6". p 171. fig 4.22.
  7. ^ Tan 2008. "1.2.1". fig 12.2.

References

[edit]

Further reading

[edit]
Revisions and contributorsEdit on WikipediaRead on Wikipedia
from Grokipedia
Downsampling, also known as decimation, is a fundamental operation in that reduces the sampling rate of a discrete-time signal by an factor M2M \geq 2 by retaining every MM-th sample, thereby decreasing the data rate while aiming to preserve the signal's relevant information content. The mathematical formulation of ideal downsampling without filtering is given by y=x[Mn]y = x[M n], where xx is the input signal and yy is the output; in the , this stretches the spectrum by MM and introduces MM overlapping copies, leading to where high-frequency components fold into the lower . To mitigate , practical decimation involves a preceding lowpass with a cutoff at π/M\pi / M radians per sample (normalized frequency), ensuring that only frequencies below the new π/M\pi / M remain undistorted. In multirate , downsampling enables efficient system designs by reducing computational load, storage requirements, and bandwidth for transmission, with applications spanning audio and video compression, digital communications (e.g., channel rate adaptation), image subsampling, and in wavelet transforms. Implementations often exploit noble identities, which permit commuting downsamplers with filters to cut operations by a factor of MM (e.g., filtering at the lower rate via H(zM)H(z^M)), and polyphase decomposition, which partitions filters into MM subfilters running in parallel at the decimated rate for further optimization.

Fundamentals of Sampling and Downsampling

Nyquist-Shannon Sampling Theorem

The process of converting a continuous-time signal x(t)x(t) to a discrete-time signal xx involves uniform sampling, where the signal is measured at regular intervals TT, yielding samples x=x(nT)x = x(nT) with sampling frequency fs=1/Tf_s = 1/T. This discretization is fundamental in digital signal processing, enabling the representation and manipulation of analog signals in computational systems. For the sampling to preserve all information in the original signal, the signal must be bandlimited, meaning its Fourier transform x^(f)\hat{x}(f) is zero for frequencies f>fmax|f| > f_{\max}, where fmaxf_{\max} denotes the highest frequency component. The Nyquist-Shannon sampling theorem establishes the minimum sampling rate required for perfect reconstruction of such bandlimited signals. Formulated by in 1928 and rigorously proven by in 1949, the theorem states that if a continuous-time signal x(t)x(t) is bandlimited to fmaxf_{\max}, then it can be completely recovered from its samples x(nT)x(nT) provided the sampling frequency satisfies fs2fmaxf_s \geq 2f_{\max}. The value 2fmax2f_{\max} is known as the , representing the critical threshold beyond which the signal's frequency content can be uniquely captured without loss. Baseband signals, which occupy the frequency range from 0 to fmaxf_{\max}, exemplify this, as their bandwidth B=fmaxB = f_{\max} directly determines the Nyquist rate 2B2B. A brief derivation of the theorem follows from Fourier analysis: the spectrum of the sampled signal consists of periodic replicas of the original spectrum x^(f)\hat{x}(f), shifted by multiples of fsf_s. To prevent overlap between these replicas—known as folding—the gap between them must be at least 2fmax2f_{\max}, hence fs2fmaxf_s \geq 2f_{\max}. For signals sampled at or above this rate, perfect reconstruction is possible using the Whittaker-Shannon formula: x(t)=n=x(nT)sinc(tnTT),x(t) = \sum_{n=-\infty}^{\infty} x(nT) \cdot \operatorname{sinc}\left( \frac{t - nT}{T} \right), where sinc(u)=sin(πu)/(πu)\operatorname{sinc}(u) = \sin(\pi u)/(\pi u) is the normalized sinc function, acting as an ideal low-pass filter to recover the baseband content. This formula ensures that the interpolated signal matches the original bandlimited x(t)x(t) exactly. Undersampling below the Nyquist rate results in aliasing, a distortion where higher frequencies masquerade as lower ones in the reconstructed signal.

Consequences of Undersampling and Aliasing

Undersampling a continuous-time signal below the , which is twice the highest frequency component in the signal, leads to where high-frequency components appear as lower frequencies in the reconstructed discrete-time signal. This arises because the sampling process creates periodic replicas of the signal's centered at multiples of the sampling frequency fsf_s, causing overlap between these replicas and the when fsf_s is too low. The phenomenon of frequency folding illustrates how distorts the : a ff in the original signal maps to an aliased fa=fkfsf_a = |f - k f_s|, where kk is the that minimizes fa|f_a| and keeps faf_a within [0,fs/2][0, f_s/2]. For instance, if a signal contains a 700 Hz component sampled at 1000 Hz, the aliased becomes fa=7001000=300f_a = |700 - 1000| = 300 Hz, folding the high into the audible low-frequency range. This replication and folding prevent unique reconstruction of the original , as multiple original frequencies can produce the same sampled output. In imaging, aliasing manifests as moiré patterns, where fine repetitive structures like woven fabrics or grids produce false, wavy interference patterns due to of spatial frequencies. In audio processing, causes tone distortion, such as when high-frequency harmonics in a sawtooth alias into lower frequencies, introducing inharmonic artifacts that degrade perceived . The impact on signal fidelity is severe, as results in irreversible information loss: the overlapped components cannot be disentangled post-sampling without prior low-pass filtering to remove high , leading to permanent in the downsampled signal.

Downsampling by Integer Factors

Decimation Process

Decimation is the process of reducing the sampling rate of a discrete-time signal by an integer factor M2M \geq 2, yielding an output sampling rate of fs/Mf_s / M, where fsf_s is the original sampling rate. The decimation process involves two primary steps applied sequentially to the input signal xx. First, a is applied to bandlimit the signal and suppress frequency components that could cause upon rate reduction. Second, subsampling occurs by selecting every MM-th sample from the filtered output and discarding the intervening M1M-1 samples. Let the filtered version of the input be ww. The decimated output signal is then defined mathematically as y=w[Mm]y = w[Mm] for mm, effectively compressing the time index by the factor MM. By reducing the number of samples per unit time by a factor of MM, decimation lowers the overall rate, which can decrease storage requirements and transmission bandwidth. However, the preceding low-pass filtering introduces additional computational overhead, creating a where the net load depends on the of the filter implementation relative to the rate reduction achieved. Inadequate filtering during this process risks , where high-frequency components fold into the and distort the output .

Anti-Aliasing Filter Design

In the context of integer-factor downsampling by a factor of MM, the anti-aliasing filter is a applied to the input signal prior to subsampling to suppress spectral components that would otherwise fold into the and cause . Specifically, it attenuates frequencies above the new fs/(2M)f_s / (2M), where fsf_s is the original sampling frequency, ensuring that the signal remains bandlimited to the reduced rate without distortion from higher-frequency replicas. The ideal has a at fs/(2M)f_s / (2M), corresponding to a normalized of π/M\pi / M. Its is defined as H(ejω)={1ω<π/M0π/MωπH(e^{j\omega}) = \begin{cases} 1 & |\omega| < \pi / M \\ 0 & \pi / M \leq |\omega| \leq \pi \end{cases} in the digital domain, with a sharp transition from passband to stopband to eliminate aliasing completely. In practice, realizable filters approximate this brick-wall response with a finite transition bandwidth, typically requiring stopband attenuation of 60-80 dB to meet performance criteria in applications like audio processing or data rate reduction. The passband ripple is kept minimal, often below 0.1 dB, to preserve signal fidelity. Finite impulse response (FIR) filters are commonly used for anti-aliasing due to their linear phase response, which avoids phase distortion in the passband, and inherent stability. FIR designs can be implemented efficiently for decimation by running at the lower output rate after initial filtering. A standard method is the windowing technique, where the ideal low-pass impulse response—a sinc function truncated at length LL—is multiplied by a to control sidelobe levels and achieve the desired attenuation. The Kaiser window parameter β\beta is selected based on the required stopband rejection; for example, β5.7\beta \approx 5.7 yields about 60 dB attenuation. Infinite impulse response (IIR) filters offer computational efficiency with fewer coefficients but introduce nonlinear phase and potential instability, making them less suitable unless phase is not critical.

Downsampling by Rational Factors

Resampling Fundamentals

Resampling in signal processing refers to the process of altering the sampling rate of a discrete-time signal by a rational factor L/ML/M, where LL and MM are coprime positive integers, resulting in an effective rate change while preserving the signal's spectral content within the valid bandwidth. This approach is essential for interfacing systems operating at incompatible sampling rates, such as converting between 44.1 kHz and 48 kHz in audio processing, where the ratio might approximate 147/160. Unlike integer downsampling, which reduces the rate by an integer factor M1M \geq 1, rational resampling handles arbitrary fractions less than or equal to 1, enabling precise rate adjustments without unnecessary spectral distortion. The general resampling process for a rational factor L/ML/M involves three main steps: first, upsampling by LL, which expands the signal by inserting L1L-1 zeros between each original sample, increasing the sampling rate to LfsL f_s where fsf_s is the original rate; second, applying a low-pass filter to remove spectral images introduced by the zero insertion and prevent aliasing in the subsequent stage; and third, downsampling by MM, which retains every MM-th sample from the filtered output, yielding the final rate of (L/M)fs(L/M) f_s. The low-pass filter operates at the intermediate rate and must have a cutoff frequency of min(π/L,π/M)\min(\pi / L, \pi / M) in normalized angular frequency terms relative to the original sampling rate, ensuring that the passband accommodates the original signal's bandwidth while attenuating replicas and potential aliases. This filter design balances the requirements of both interpolation (anti-imaging) and decimation (anti-aliasing), with the gain typically normalized to LL to compensate for the upsampling attenuation. For instance, to achieve a 3/4 rate reduction—common in video format conversions—the signal is upsampled by 3, low-pass filtered with a cutoff at min(π/3,π/4)=π/4\min(\pi/3, \pi/4) = \pi/4, and then downsampled by 4, resulting in a final rate of (3/4)fs(3/4) f_s without introducing aliasing in the reduced bandwidth. When L=1L = 1, this framework simplifies to pure integer decimation, aligning with earlier discussions on downsampling by integer factors.

Polyphase Filter Implementation

In the context of rational downsampling by a factor of L/ML/M, where LL and MM are coprime positive integers, the low-pass anti-aliasing filter is decomposed into polyphase subfilters to enable an efficient implementation. This decomposition divides the filter impulse response into MM (or LL, depending on the structure) components, each corresponding to a delayed version of the signal processed at the reduced output sampling rate. The polyphase approach leverages the inherent redundancy in the upsampled signal—where L1L-1 zeros are inserted between each input sample—and the selective nature of downsampling, ensuring that only relevant computations are performed. A key mathematical formulation for the polyphase decomposition of the low-pass filter H(z)H(z) in the decimation stage is given by H(z)=k=0M1zkEk(zM),H(z) = \sum_{k=0}^{M-1} z^{-k} E_k(z^M), where the Ek(z)E_k(z) are the MM polyphase components of H(z)H(z), each obtained by downsampling the filter coefficients by MM and delaying by kk samples. This type-I polyphase representation allows the filter to be realized as a parallel bank of MM subfilters, with the input signal commutated across them before summation and final downsampling. For the interpolation stage, a similar type-II decomposition can be applied, but the combined structure for rational resampling integrates both to operate at the input rate. The efficiency of this implementation relies on the Noble identities, which permit commuting a downsampler (or upsampler) with certain filter sections without altering the overall transfer function. Specifically, for a downsampler by MM followed by a filter Ek(zM)E_k(z^M), the identity equates it to filtering with Ek(z)E_k(z) followed by downsampling, thereby shifting expensive operations to the lower-rate domain. Similarly, for upsampling, the identity moves the upsampler after sparse filters. These identities reduce the number of arithmetic operations by eliminating multiplications involving zero-valued samples from upsampling and avoiding full-rate computation of discarded outputs from downsampling. The primary advantage of polyphase filter implementation is the significant computational savings, which can approach a factor of LML M compared to a direct, non-optimized realization of the upsample-filter-downsample chain. In the naive approach, filtering occurs at the elevated rate of LL times the input rate, incurring roughly LNL N multiplications per input sample for an FIR filter of length NN, followed by downsampling that discards (M1)/M(M-1)/M of the results. The polyphase structure, by contrast, performs filtering at the input rate using the subfilters, yielding an effective complexity of approximately NN operations per input sample, or NM/LN M / L per output sample—translating to savings up to LML M when accounting for the rate change. For instance, in downsampling by L/M=2/3L/M = 2/3, the polyphase method avoids processing the inserted zeros (saving the factor of 2 from upsampling) and computes only every third filtered value (saving the factor of 3 from downsampling), achieving up to 6-fold reduction in operations relative to the full-rate filtering baseline.

Applications and Extensions

Multirate Systems

Multirate signal processing encompasses digital systems that intentionally vary the sampling rate of signals through operations such as upsampling, downsampling, and associated filtering, enabling efficient computation and bandwidth optimization in applications like audio and image processing. These systems typically combine decimators (lowpass filter followed by downsampling) and interpolators (upsampling followed by lowpass filter) to achieve net rate changes while suppressing aliasing or imaging artifacts. The foundational framework for such architectures was established in early works on efficient filter implementations, highlighting the role of noble identities that allow filters to commute with samplers for simplified analysis and design. Cascaded decimation structures extend single-stage downsampling to handle large integer factors by breaking them into successive smaller decimations, each preceded by an anti-aliasing filter tailored to the intermediate sampling rate. For instance, a 12-fold decimation can be realized as a first stage decimating by 4 with a filter attenuating frequencies above π/4\pi/4, followed by a second stage decimating by 3 with a filter targeting frequencies above π/3\pi/3 at the reduced rate; this multistage approach significantly lowers the overall computational complexity compared to a single-stage filter, as later stages operate on fewer samples and require less stringent transition bands. Such designs optimize storage and multiplier usage, with the choice of factorization (e.g., 12 = 4 × 3 versus 12 = 2 × 6) determined by minimizing total arithmetic operations across stages. Filter banks represent a key multirate architecture where downsampling is applied in parallel across subbands after bandpass analysis filtering, facilitating signal decomposition for compression or feature extraction. In an M-channel maximally decimated filter bank, the input is split into M subbands, each downsampled by M, and reconstruction occurs via upsampling and synthesis filtering; perfect reconstruction (PR) is achieved if the overall system introduces only a delay and possible scaling, requiring conditions like the polyphase matrix of the analysis-synthesis filters to be paraunitary (for orthogonal banks) or satisfy the Bezout identity (for biorthogonal cases) to cancel aliasing and ensure distortion-free output. Seminal developments in PR filter banks, including quadrature mirror filters and wavelet-based designs, have enabled near-ideal decomposition with finite impulse response filters. The overall transfer function for a K-stage cascaded decimation system, with decimation factors MkM_k and filters Hk(z)H_k(z) at the k-th stage, is the product of the individual responses adjusted for rate compression: H(z)=H1(z)H2(zM1)H3(zM1M2)HK(zM1M2MK1)H(z) = H_1(z) \cdot H_2(z^{M_1}) \cdot H_3(z^{M_1 M_2}) \cdots H_K(z^{M_1 M_2 \cdots M_{K-1}}) This formulation accounts for the frequency scaling induced by prior downsamplings, ensuring the effective lowpass characteristic meets the final Nyquist requirement while minimizing passband ripple accumulation across stages.

Practical Considerations in DSP

In digital signal processing implementations, hardware constraints significantly influence downsampling performance. Fixed-point arithmetic, common in cost-sensitive DSP chips like those from , relies on integer operations with limited dynamic range (e.g., ±2^15 for 16-bit words), making it suitable for high-volume tasks but prone to overflow and requiring careful scaling to avoid distortion during filtering stages of downsampling. In contrast, floating-point arithmetic, as supported by processors from , offers a significantly wider dynamic range and higher precision for handling small signal variations, though at higher cost and power consumption, which is advantageous for applications needing accurate anti-aliasing in downsampling. Latency poses a critical challenge in real-time downsampling systems, where filter delays from anti-aliasing stages can accumulate, potentially exceeding desirable thresholds of under 2 ms, as seen in low-power speech processing hardware implementations achieving around 3.35 ms. Audio DSP architectures are optimized for minimal latency throughout the signal path, ensuring downsampled outputs remain synchronized in live applications such as acoustic processing. Software libraries facilitate efficient downsampling with built-in parameter controls. MATLAB's resample function downsamples signals by a factor of p/q (where p < q), applying an FIR anti-aliasing filter designed via firls with a Kaiser window; users can adjust filter order n and shape parameter beta (e.g., n=5, beta=20) to balance aliasing reduction against edge effects in finite signals. Similarly, SciPy's decimate function reduces the sample rate by integer factor q after applying an order-8 Chebyshev type I IIR filter by default, or a 30-point FIR with Hamming window; it recommends zero_phase=True to avoid distortion and multiple calls for q > 13 to manage high factors. Downsampling finds practical use in audio rate conversion, such as reducing from 48 kHz to 44.1 kHz for compatibility between video and music standards, where precise resampling minimizes audible artifacts though it cannot be perfectly achieved in real-time without specialized hardware. Recent developments as of 2024 include learned downsampling networks for adaptive video streaming, enabling content-dependent rate adaptation. In image compression, adaptive downsampling with learned kernels enables dual-layer encoding, preserving details while reducing data size for transmission. Telecommunications employs downsampling for bandwidth reduction in software-defined radios, converting signals to match channel constraints via multi-stage filtering. Key trade-offs in downsampling include filter order versus computational cost, where higher-order FIR filters (e.g., length proportional to q) provide sharper cutoffs but increase multiplications per sample, often necessitating polyphase implementations to cut costs by 1/N in multirate systems. Quantization noise in downsampled signals arises from finite-bit representations post-filtering, potentially amplifying errors if not scaled properly; for , downsampling with filtering reduces total power by the decimation factor while preserving power in the reduced bandwidth, requiring dithering to decorrelate it from the signal.

References

  1. https://wiki.seg.org/wiki/Frequency_aliasing
Add your contribution
Related Hubs
User Avatar
No comments yet.