Recent from talks
Nothing was collected or created yet.
Downsampling (signal processing)
View on WikipediaIn 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]
- Reduce high-frequency signal components with a digital lowpass filter.
- 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.

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.
- Increase (resample) the sequence by a factor of L. This is called Upsampling, or interpolation.
- 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]- ^ Realizable low-pass filters have a "skirt", where the response diminishes from near one to near zero. In practice the cutoff frequency is placed far enough below the theoretical cutoff that the filter's skirt is contained below the theoretical cutoff.
- ^ General techniques for sample-rate conversion by factor R ∈ include polynomial interpolation and the Farrow structure.[7]
Page citations
[edit]- ^ Harris 2004. "6.1". p 128.
- ^ Crochiere and Rabiner "2". p 32. eq 2.55a.
- ^ Harris 2004. "2.2.1". p 25.
- ^ Oppenheim and Schafer. "4.2". p 143. eq 4.6, where: and
- ^ Harris 2004. "2.2". p 22. fig 2.10.
- ^ Oppenheim and Schafer. "4.6". p 171. fig 4.22.
- ^ Tan 2008. "1.2.1". fig 12.2.
References
[edit]- ^ Oppenheim, Alan V.; Schafer, Ronald W.; Buck, John R. (1999). "4". Discrete-Time Signal Processing (2nd ed.). Upper Saddle River, N.J.: Prentice Hall. p. 168. ISBN 0-13-754920-2.
- ^
Tan, Li (2008-04-21). "Upsampling and downsampling". eetimes.com. EE Times. Retrieved 2017-04-10.
The process of reducing a sampling rate by an integer factor is referred to as downsampling of a data sequence. We also refer to downsampling as decimation. The term decimation used for the downsampling process has been accepted and used in many textbooks and fields.
- ^ Crochiere, R.E.; Rabiner, L.R. (1983). "2". Multirate Digital Signal Processing. Englewood Cliffs, NJ: Prentice-Hall. p. 32. ISBN 0136051626.
- ^ Poularikas, Alexander D. (September 1998). Handbook of Formulas and Tables for Signal Processing (1 ed.). CRC Press. pp. 42–48. ISBN 0849385792.
- ^
Harris, Frederic J. (2004-05-24). "2.2". Multirate Signal Processing for Communication Systems. Upper Saddle River, NJ: Prentice Hall PTR. pp. 20–21. ISBN 0131465112.
The process of down sampling can be visualized as a two-step progression. The process starts as an input series x(n) that is processed by a filter h(n) to obtain the output sequence y(n) with reduced bandwidth. The sample rate of the output sequence is then reduced Q-to-1 to a rate commensurate with the reduced signal bandwidth. In reality the processes of bandwidth reduction and sample rate reduction are merged in a single process called a multirate filter.
- ^
Strang, Gilbert; Nguyen, Truong (1996-10-01). Wavelets and Filter Banks (2 ed.). Wellesley, MA: Wellesley-Cambridge Press. pp. 100–101. ISBN 0961408871.
No sensible engineer would do that.
- ^
Milić, Ljiljana (2009). Multirate Filtering for Digital Signal Processing. New York: Hershey. p. 192. ISBN 978-1-60566-178-0.
Generally, this approach is applicable when the ratio Fy/Fx is a rational, or an irrational number, and is suitable for the sampling rate increase and for the sampling rate decrease.
Further reading
[edit]- Proakis, John G. (2000). Digital Signal Processing: Principles, Algorithms and Applications (3rd ed.). India: Prentice-Hall. ISBN 8120311299.
- Lyons, Richard (2001). Understanding Digital Signal Processing. Prentice Hall. p. 304. ISBN 0-201-63467-8.
Decreasing the sampling rate is known as decimation.
- Antoniou, Andreas (2006). Digital Signal Processing. McGraw-Hill. p. 830. ISBN 0-07-145424-1.
Decimators can be used to reduce the sampling frequency, whereas interpolators can be used to increase it.
- Milic, Ljiljana (2009). Multirate Filtering for Digital Signal Processing. New York: Hershey. p. 35. ISBN 978-1-60566-178-0.
Sampling rate conversion systems are used to change the sampling rate of a signal. The process of sampling rate decrease is called decimation, and the process of sampling rate increase is called interpolation.
- T. Schilcher. RF applications in digital signal processing//" Digital signal processing". Proceedings, CERN Accelerator School, Sigtuna, Sweden, May 31-June 9, 2007. - Geneva, Switzerland: CERN (2008). - P. 258. - DOI: 10.5170/CERN-2008-003. [1]
- Sliusar I.I., Slyusar V.I., Voloshko S.V., Smolyar V.G. Next Generation Optical Access based on N-OFDM with decimation.// Third International Scientific-Practical Conference "Problems of Infocommunications. Science and Technology (PIC S&T'2016)". – Kharkiv. - October 3 –6, 2016. [2]
- Saska Lindfors, Aarno Pärssinen, Kari A. I. Halonen. A 3-V 230-MHz CMOS Decimation Subsampler.// IEEE transactions on circuits and systems— Vol. 52, No. 2, February 2005. – P. 110.
Downsampling (signal processing)
View on GrokipediaFundamentals of Sampling and Downsampling
Nyquist-Shannon Sampling Theorem
The process of converting a continuous-time signal to a discrete-time signal involves uniform sampling, where the signal is measured at regular intervals , yielding samples with sampling frequency . 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 is zero for frequencies , where denotes the highest frequency component.[7] The Nyquist-Shannon sampling theorem establishes the minimum sampling rate required for perfect reconstruction of such bandlimited signals. Formulated by Harry Nyquist in 1928 and rigorously proven by Claude Shannon in 1949, the theorem states that if a continuous-time signal is bandlimited to , then it can be completely recovered from its samples provided the sampling frequency satisfies . The value is known as the Nyquist rate, 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 , exemplify this, as their bandwidth directly determines the Nyquist rate .[8][7] A brief derivation of the theorem follows from Fourier analysis: the spectrum of the sampled signal consists of periodic replicas of the original spectrum , shifted by multiples of . To prevent overlap between these replicas—known as spectral folding—the gap between them must be at least , hence . For signals sampled at or above this rate, perfect reconstruction is possible using the Whittaker-Shannon interpolation formula: where 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 exactly.[7][9] Undersampling below the Nyquist rate results in aliasing, a distortion where higher frequencies masquerade as lower ones in the reconstructed signal.[7]Consequences of Undersampling and Aliasing
Undersampling a continuous-time signal below the Nyquist rate, which is twice the highest frequency component in the signal, leads to aliasing where high-frequency components appear as lower frequencies in the reconstructed discrete-time signal.[10] This distortion arises because the sampling process creates periodic replicas of the signal's spectrum centered at integer multiples of the sampling frequency , causing overlap between these replicas and the baseband spectrum when is too low.[11] The phenomenon of frequency folding illustrates how aliasing distorts the spectrum: a frequency in the original signal maps to an aliased frequency , where is the integer that minimizes and keeps within .[11] For instance, if a signal contains a 700 Hz component sampled at 1000 Hz, the aliased frequency becomes Hz, folding the high frequency into the audible low-frequency range.[12] This replication and folding prevent unique reconstruction of the original spectrum, 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 undersampling of spatial frequencies.[13] In audio processing, aliasing causes tone distortion, such as when high-frequency harmonics in a sawtooth waveform alias into lower frequencies, introducing inharmonic artifacts that degrade perceived sound quality.[14] The impact on signal fidelity is severe, as aliasing results in irreversible information loss: the overlapped frequency components cannot be disentangled post-sampling without prior low-pass filtering to remove high frequencies, leading to permanent distortion in the downsampled signal.[15]Downsampling by Integer Factors
Decimation Process
Decimation is the process of reducing the sampling rate of a discrete-time signal by an integer factor , yielding an output sampling rate of , where is the original sampling rate.[16] The decimation process involves two primary steps applied sequentially to the input signal . First, a low-pass filter is applied to bandlimit the signal and suppress frequency components that could cause aliasing upon rate reduction. Second, subsampling occurs by selecting every -th sample from the filtered output and discarding the intervening samples.[16] Let the filtered version of the input be . The decimated output signal is then defined mathematically as for integer , effectively compressing the time index by the factor .[16] By reducing the number of samples per unit time by a factor of , decimation lowers the overall data rate, which can decrease storage requirements and transmission bandwidth. However, the preceding low-pass filtering introduces additional computational overhead, creating a trade-off where the net processing load depends on the efficiency of the filter implementation relative to the rate reduction achieved.[16] Inadequate filtering during this process risks aliasing, where high-frequency components fold into the baseband and distort the output spectrum.[16]Anti-Aliasing Filter Design
In the context of integer-factor downsampling by a factor of , the anti-aliasing filter is a low-pass filter applied to the input signal prior to subsampling to suppress spectral components that would otherwise fold into the baseband and cause aliasing. Specifically, it attenuates frequencies above the new Nyquist rate , where is the original sampling frequency, ensuring that the signal remains bandlimited to the reduced rate without distortion from higher-frequency replicas.[1] The ideal anti-aliasing filter has a cutoff frequency at , corresponding to a normalized angular frequency of . Its frequency response is defined as 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.[1][17] 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 —is multiplied by a Kaiser window to control sidelobe levels and achieve the desired attenuation. The Kaiser window parameter is selected based on the required stopband rejection; for example, 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.[1][17]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 , where and are coprime positive integers, resulting in an effective rate change while preserving the signal's spectral content within the valid bandwidth.[18] 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.[19] Unlike integer downsampling, which reduces the rate by an integer factor , rational resampling handles arbitrary fractions less than or equal to 1, enabling precise rate adjustments without unnecessary spectral distortion.[18] The general resampling process for a rational factor involves three main steps: first, upsampling by , which expands the signal by inserting zeros between each original sample, increasing the sampling rate to where 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 , which retains every -th sample from the filtered output, yielding the final rate of .[18] The low-pass filter operates at the intermediate rate and must have a cutoff frequency of 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.[20] This filter design balances the requirements of both interpolation (anti-imaging) and decimation (anti-aliasing), with the gain typically normalized to to compensate for the upsampling attenuation.[21] 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 , and then downsampled by 4, resulting in a final rate of without introducing aliasing in the reduced bandwidth.[18] When , this framework simplifies to pure integer decimation, aligning with earlier discussions on downsampling by integer factors.[19]Polyphase Filter Implementation
In the context of rational downsampling by a factor of , where and 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 (or , 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 zeros are inserted between each input sample—and the selective nature of downsampling, ensuring that only relevant computations are performed.[18] A key mathematical formulation for the polyphase decomposition of the low-pass filter in the decimation stage is given by where the are the polyphase components of , each obtained by downsampling the filter coefficients by and delaying by samples. This type-I polyphase representation allows the filter to be realized as a parallel bank of 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.[22] 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 followed by a filter , the identity equates it to filtering with 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.[22] The primary advantage of polyphase filter implementation is the significant computational savings, which can approach a factor of compared to a direct, non-optimized realization of the upsample-filter-downsample chain. In the naive approach, filtering occurs at the elevated rate of times the input rate, incurring roughly multiplications per input sample for an FIR filter of length , followed by downsampling that discards of the results. The polyphase structure, by contrast, performs filtering at the input rate using the subfilters, yielding an effective complexity of approximately operations per input sample, or per output sample—translating to savings up to when accounting for the rate change. For instance, in downsampling by , 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.[18][22]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 , followed by a second stage decimating by 3 with a filter targeting frequencies above 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.[18] 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 and filters at the k-th stage, is the product of the individual responses adjusted for rate compression: 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 Texas Instruments, 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.[23] In contrast, floating-point arithmetic, as supported by processors from Analog Devices, 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.[24][23] 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.[25] Audio DSP architectures are optimized for minimal latency throughout the signal path, ensuring downsampled outputs remain synchronized in live applications such as acoustic processing.[26] Software libraries facilitate efficient downsampling with built-in parameter controls. MATLAB'sresample 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.[27] 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.[28]
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.[29] Recent developments as of 2024 include learned downsampling networks for adaptive video streaming, enabling content-dependent rate adaptation.[30] In image compression, adaptive downsampling with learned kernels enables dual-layer encoding, preserving details while reducing data size for transmission.[31] Telecommunications employs downsampling for bandwidth reduction in software-defined radios, converting signals to match channel constraints via multi-stage filtering.[32]
Key trade-offs in downsampling include filter order versus computational cost, where higher-order FIR filters (e.g., length proportional to q) provide sharper anti-aliasing cutoffs but increase multiplications per sample, often necessitating polyphase implementations to cut costs by 1/N in multirate systems.[33] Quantization noise in downsampled signals arises from finite-bit representations post-filtering, potentially amplifying errors if not scaled properly; for white noise, downsampling with anti-aliasing filtering reduces total power by the decimation factor while preserving power spectral density in the reduced bandwidth, requiring dithering to decorrelate it from the signal.[34][35]References
- https://wiki.seg.org/wiki/Frequency_aliasing
