Interpolation needed?
John A. Zoidberg
Posts: 514
Hey ladies and gentlemen,
I've constructed a DDS generator for my music-box, however, there is one issue which comes to me when it hits higher frequencies - aliasing.
My DDS has an 8-bit R2R DAC, and with 22.1kHz sampling rate. When the thing hits 1760Hz, I noticed the sine waves in my oscilloscope has become like a staircase up, and a staircase down. In fact, it has unbecoming of the sine waves already on much higher frequencies. The 'jumps' caused by the phase adders probably caused that.
Are interpolation much needed there? For those who developed Prop-based music boxes, have you actually tested them in higher frequencies? I tried to make a chord with that, but the aliased higher frequency components destroys the sound immediately.
I could have increased the DAC bits, but doing so, I must extend the sine-waves lookup table to another 512 bytes which could be tedious later.
Opinions?
Thanks.
I've constructed a DDS generator for my music-box, however, there is one issue which comes to me when it hits higher frequencies - aliasing.
My DDS has an 8-bit R2R DAC, and with 22.1kHz sampling rate. When the thing hits 1760Hz, I noticed the sine waves in my oscilloscope has become like a staircase up, and a staircase down. In fact, it has unbecoming of the sine waves already on much higher frequencies. The 'jumps' caused by the phase adders probably caused that.
Are interpolation much needed there? For those who developed Prop-based music boxes, have you actually tested them in higher frequencies? I tried to make a chord with that, but the aliased higher frequency components destroys the sound immediately.
I could have increased the DAC bits, but doing so, I must extend the sine-waves lookup table to another 512 bytes which could be tedious later.
Opinions?
Thanks.
Comments
8 bit resolution will be a bit noisy when there are no high frequencies in the digital signal masking the quantization noise.
But your problem is, with out a doubt, because of the low sample rate.
Why settle with such poor sample rate?
Why not use the counter modules in "duty mode" for much better than 8 bit resolution using only a single pin?
So even if the fundamental frequency prouced by the phase accumulator is way below 11 kHz, the waveform (even if "sinus") will have frequency components higher than the fundamental frequency; That's the nature of sampled audio. This will produce aliasing distortion/jitter when the phase accumulators fundamental frequency is not even divisible by the sample rate.
Anyway, all these kinds of "harmonic distortions" will be less audible with a higher sample rate and a bigger LUT.
The 8 bit resolution you are using will just add more audible quantization noise compared to >8 bit and is obviously not your main concern.
If its not the human ear you are driving (say the signal is being used to modulate an RF carrier) then you need to add your own brick-wall low pass filter to remove the aliases. A higher sampling frequency pushes the aliases to a higher frequency and makes the LPF easier to build.
Anyone that knows anything about DDS knows that without a very high sample frequency(>80 kHz) you will get audible aliasing distortion/jitter if you don't have some kind of interpolation/antialaising.
Just try to resample a digital image from 320x200 to 300x180 without interpolation and you will get the same effect. It all comes down to the fact that the conversion is digital to digital and not analog to digital.
I have been doing DDS and synthesis for >15 years, so I know this as a fact.
Knowing nyquists theorem is just the top of the iceberg so to speak.
I'm running this using a dsPIC, and it has an option for increasing the clock frequency up to 16x by PLL. I may try 4-5 mHz and see whether the higher frequencies will alias or not.