|
|
|
|
|
by duped
1274 days ago
|
|
When you clip in continuous time you're pushing additional energy into the harmonics of the baseband signal being clipped. Since spectra in continuous time is infinite, you don't get any aliasing (a better way to say it is that "aliasing" isn't as meaningful in continuous time) When you clip in discrete time, the spectra is finite (more technically, it's periodic with a period of the sample rate frequency). That means the energy that would go into harmonics past nyquist gets "wrapped" around. This is the big difference between analog and digital distortion. In analog, it's really quite difficult to create energy at non-harmonic frequencies of the signal. In digital clippers like you have here, it's trivial, and the design problem is figuring out how to deal with it. Most products will use some kind of anti-aliasing strategy (usually oversampling before clipping) to handle it. |
|
This circuit is not a diode emulator, it's a comparator. It's the worst-sounding of all distortions. It sounds even worse in digital because of the aliasing.
And it will always alias, no matter how much you oversample it, because a vertical edge - aka "Heaviside Step Function" - has an infinite harmonic series. If you oversample it enough it won't alias much because the series terms become smaller. But they never disappear.
A better way to do this kind of clipping is with a tanh (logistic/s-curve) approximation. That can give you a variety of valve-like [1] smooth clipping curves. Unfortunately tanh is pretty expensive computationally, so a more practical alternative is a piecewise curve, perhaps with some interpolation.
Although if you only have 8-bit or 16-bit resolution you may as well just use a lookup table.
OP might want to consider learning a little more about signal theory and practical DSP before posting more how-tos.
[1] Not really because real valves are more complicated. But it will do for a first approximation.