Sunday 10 May 2015

sampling - Is there such a thing as band-limited non-linear distortion?


So if you generate a square wave by just switching a signal between two values, at sample boundaries, it produces an infinite series of harmonics, which alias and produce tones below your fundamental, which is very audible. The solution is Band-Limited Synthesis, either using additive synthesis or band-limited steps to produce waveforms that are the same as if you had band-limited the ideal mathematical square wave before sampling it:


http://flic.kr/p/83JMjT


enter image description here


But I just realized that if you apply large amplification to a digital sine wave and then clip it digitally, it will produce the same square wave shape, without the Gibbs phenomenon ripples. So it's then also producing aliased distortion products, right? So any non-linear distortion in the digital domain that produces harmonics outside of the Nyquist limits will produce aliased distortion products? (Edit: I've done some tests and confirmed that this part is true.)



Is there such a thing as band-limited distortion, to simulate (in the digital domain) the effects of distorting (in the analog domain) before band-limiting and sampling? If so, how do you do it? If I search for "bandlimited distortion" I find some references to Chebyshev polynomials, but I don't know how to use them or if they only work for sine waves or what:



This instrument does not attempt to generate band-limited distortion. Those interested in band-limited distortion should investigate the use of Chebyshev polynomials to generate the effect. Hyperbolic Tangent Distortion





"Chebyshev polynomial" -- shaping functions with the important property that they are intrinsically band-limited i.e. they do not introduce spurious spectral harmonics due to overlapping etc. Wave Shaper




Answer



@robert-bristow-johnson explains this very clearly on comp.dsp:




you have to oversample to a finite extent. if you represent the (memoryless, i assume) non-linearity as a finite order polynomial (that approximates whatever curve you are trying to implement), then whatever is the order of polynomial is the same factor of oversampling needed and no aliases will occur. then low-pass filter (at that oversampled rate) to get rid of all frequency components higher than your original Nyquist, then downsample and you will not have aliasing.



In other words, if your nonlinearity is a polynomial, the highest frequency that can be produced by the distortion will be the highest frequency in your signal times the order N of the polynomial. (The polynomial nonlinearity is multiplying the signal by itself N times, so its spectrum gets convolved with itself and spreads out by the same ratio.)


So then you know the maximum frequency (whether Nyquist or some lower limit for your application), and you know the order of the polynomial, so you can oversample enough to prevent aliasing, do the distortion, and then low-pass filter and downsample.


In fact, you can reduce the oversampling rate by letting some aliasing happen, as long as it's contained in the band that will be removed before downsampling:



another little trick is that you need not care about aliasing that folds down to the area that you'll LPF out. so a 5th order polynomial needs only to have an oversampling ratio of 3. those top 2 harmonics might alias, but won't get back into the baseband. when downsampling, you filter those aliased harmonics out. so i think the hard and fast rule is


oversampling ratio = (polynomial order + 1)/2




No comments:

Post a Comment

readings - Appending 内 to a company name is read ない or うち?

For example, if I say マイクロソフト内のパートナーシップは強いです, is the 内 here read as うち or ない? Answer 「内」 in the form: 「Proper Noun + 内」 is always read 「ない...