ADAU1701 Hard Clipper: Incomplete Peak Clipping
I am experiencing issues with the hard clipper in the ADAU1701, where it fails to clip all peaks above the threshold.
This is my project.
When the signal frequency is low, the clipper functions correctly. However, as the signal frequency increases, it no longer clips all peaks above the threshold.
Audio Signal Processors
software
hard clipper
SigmaDSP Audio Processors
adau1701
Hello sari,
This is because the formula for a square wave is roughly (you can look up the Fourier expansion for the exact formula) it is the fundamental frequency since wave plus 1/3rd of the 3rd harmonic plus 1/5th of the 5th harmonic and 1/7th of the 7th harmonic etc.,... It is an infinite series of odd harmonics. If you truncate the series you do not get a perfect square wave.
Your second picture the rise time is a little slower due to the loss of some of the higher frequency content.
The third picture has a lot of loss so it only slightly resembles a square wave and your last picture is pretty much just two sine waves so it is the first two terms of the equation, sort of. The second term is being aliased down to 3kHz. Note the low frequency component of your screenshot.
This is an example of the danger of non-linear elements in the toolbox. You can create signals that are impossible to reproduce with the digital to analog converter. A 15kHz fundamental has the first harmonic at 45kHz which is WAY over the Nyquist frequency of 24kHz assuming you are running your project at 48kHz fs. So this 45kHz will alias down to 3kHz (48kHz-45kHz=3kHz). So what you see is the 15kHz fundamental and the alias of the second harmonic. The rest of the harmonics are all gone.
You can do this with an analog piece of equipment. If you can find an analog device that only goes out to a little above 20kHz and feed a square wave into it you will see only the fundamental sine wave and no alias because it is analog. This is why back in the old days it was interesting to run a square wave into a piece of analog equipment and that showed you how good the frequency response was and how fast the slew rates were.
To prevent the aliasing you MUST use a high order low pass filter to filter out these harmonics before you send it out to the DAC to have it try to reproduce it.
If you are building a guitar distortion pedal the more the merrier and the aliasing adds to the grunge!
So you just have created a great exercise in digital theory.
Let me know if you have further questions. I think I explained it fully?
Dave T
Please log in to reply.



