DSPRelated.com
Forums

Anti Aliasing of Arbitrary Waveforms

Started by Scott Gravenhorst September 23, 2008
dbd  <dbd@ieee.org> wrote:

>On Sep 23, 12:20 pm, spop...@speedymail.org (Steve Pope) wrote:
>> Okay, then describe for us the sample rates used in the entire >> chain of signals, from waveform generator to DAC.
>The problematic sampling is that which takes place when discrete >samples of conceptual waveforms of arbitrary spectrum are generated by >the digital hardware.
>A discussion of the issues the OP faces is given in:
>http://ccrma-www.stanford.edu/~stilti/papers/blit.pdf
I can see why there's confusion over the term "aliasing". This paper uses "aliasing" as a catch-all for undesired characteristics of a discrete-time waveform such as a sawtooth... even if one never downsampled, other than perhaps conceptually. Steve
On Tue, 23 Sep 2008 20:22:59 +0000 (UTC), spope33@speedymail.org
(Steve Pope) wrote:

>Scott Gravenhorst <no.spam@gte.net> wrote: > >>On Tue, 23 Sep 2008 20:04:39 +0000 (UTC), spope33@speedymail.org > >>(Steve Pope) wrote: > >>>Right. So, can you comment on whether the sitaution I describe >>>above applies (the added/accumulator are a large bit-width >>>than the DAC)? > >>Yes, the DAC is 24 bits, and I have tested the counter at both 24 bits >>and 32 bits with the same siren effect result. > >So in the instance where the counter was 32 bits, you truncated >or rounded the signal to 24 bits without dithering?
The counter's 24 most sig. bits are sent to the DAC unmodified. But the same effect occurs using a 24 bit counter straight into the 24 bit DAC.
>Next question, when you say you hear the same relative level >of siren effect at different gains, where is that gain control? >(i.e. is it after the sawtooth generator, but before the DAC?) > >>>>At very high frequencies, >>>>I can easily stop the sweep and hear an inharmonic partial that >>>>remains constant as long as the fundamental frequency of the sawtooth >>>>waveform is not changed. >>> >>>What's an inharmonic partial? >> >>An aliased harmonic that doesn't fold back to a frequency that is >>already part of the waveform's spectrum. Inharmonic partials are >>sinewave components that aren't part of the original waveform's >>infinite series, so they sound bad. > >Do you believe the siren effect is hearing these inharmonics sweeping >around, or something else?
The inharmonics.
On Tue, 23 Sep 2008 13:31:44 -0700 (PDT), cs_posting@hotmail.com
wrote:

>On Sep 23, 4:18 pm, no.s...@gte.net (Scott Gravenhorst) wrote: > >> The DAC is 24 bits wide. > >Oh, that's almost certainly sigma delta then. > >Are you sure you are driving it right? Are you sure it likes 200 >khz, >and not say 192?
It's spec'd go to 200KHz. I've tried it at 200KHz and 192KHz with the same results.
> >I don't know that there is an issue here, but sigma delta dacs are >quite complicated internally with various filters and such built in, >and misusing them slightly could have all sorts of unusual aliasing >effects. > >I wonder what happens when your sawtooth's single-sample step >transient hits the DAC's internal filters?
On Tue, 23 Sep 2008 13:30:46 -0700 (PDT), dbd <dbd@ieee.org> wrote:

>On Sep 23, 12:20 pm, spop...@speedymail.org (Steve Pope) wrote: >... >> >> Okay, then describe for us the sample rates used in the entire >> chain of signals, from waveform generator to DAC. >> >> Steve > >The problematic sampling is that which takes place when discrete >samples of conceptual waveforms of arbitrary spectrum are generated by >the digital hardware. > >A discussion of the issues the OP faces is given in: > >http://ccrma-www.stanford.edu/~stilti/papers/blit.pdf > > and > > Antialiasing Oscillators in Subtractive Synthesis >Signal Processing Magazine, IEEE >March 2007, page(s): 116-125
Yes, thanks, but I've got this and would use BLIT if it weren't for the fact that I need to generate completely arbitrary waveforms.
>Dale B. Dalrymple >http://dbdimages.com
Scott Gravenhorst <no.spam@gte.net> wrote:

>On Tue, 23 Sep 2008 20:22:59 +0000 (UTC), spope33@speedymail.org
>>Do you believe the siren effect is hearing these inharmonics sweeping >>around, or something else?
>The inharmonics.
Thanks. Have you tried generating the sawtooth at a high sample rate (say, 1.6 MHz), lowpass filtering, and decimating to 200 KHz? Steve
cs_posting@hotmail.com wrote:
> On Sep 23, 3:35 pm, no.s...@gte.net (Scott Gravenhorst) wrote:
>>The sawtooth (a test waveform that contains a transient) is generated >>using a phase accumulator "oscillator". This is a digital adder and >>register (I'm using an FPGA) where the adder's output is registered >>and coupled back to one of it's inputs. The adder's other input has a >>value called the phase increment.
> Do you "use" all the bits in the phase accumulator > in determining the output amplitude?
> Or do you only use some number of MSB's, and ignore the LSB's in the > amplitude, though of course they are retained in the phase > accumulation?
Would dithering fix that? -- glen
On Tue, 23 Sep 2008 20:45:55 +0000 (UTC), spope33@speedymail.org
(Steve Pope) wrote:

>Scott Gravenhorst <no.spam@gte.net> wrote: > >>On Tue, 23 Sep 2008 20:22:59 +0000 (UTC), spope33@speedymail.org > >>>Do you believe the siren effect is hearing these inharmonics sweeping >>>around, or something else? > >>The inharmonics. > >Thanks. > >Have you tried generating the sawtooth at a high sample rate >(say, 1.6 MHz), lowpass filtering, and decimating to 200 KHz? >
Ah! That might work. I will try that. However, I would think that if I upsample 8:1, interpolate and decimate back to 200 KHz, I should get the same effect. One thing I just realized, when I decimate, I'm merely decimating, i.e., sending every other sample to the DAC. I should be averaging two samples to generate the decimated output. I need to try that too. It may not reduce aliasing as much as I want it to, but it will show that I'm on the right track if I can audibly reduce it.
On Tue, 23 Sep 2008 21:47:11 GMT, no.spam@gte.net (Scott Gravenhorst)
wrote:

>On Tue, 23 Sep 2008 20:45:55 +0000 (UTC), spope33@speedymail.org >(Steve Pope) wrote: > >>Scott Gravenhorst <no.spam@gte.net> wrote: >> >>>On Tue, 23 Sep 2008 20:22:59 +0000 (UTC), spope33@speedymail.org >> >>>>Do you believe the siren effect is hearing these inharmonics sweeping >>>>around, or something else? >> >>>The inharmonics. >> >>Thanks. >> >>Have you tried generating the sawtooth at a high sample rate >>(say, 1.6 MHz), lowpass filtering, and decimating to 200 KHz? >> > >Ah! That might work. I will try that. However, I would think that >if I upsample 8:1, interpolate and decimate back to 200 KHz, I should >get the same effect.
Sorry, that should be: if I upsample 8:1, interpolate, lowpass filter and decimate back to 200 KHz, I should get the same effect.
> >One thing I just realized, when I decimate, I'm merely decimating, >i.e., sending every other sample to the DAC. I should be averaging >two samples to generate the decimated output. I need to try that too. >It may not reduce aliasing as much as I want it to, but it will show >that I'm on the right track if I can audibly reduce it. >
Scott Gravenhorst <no.spam@gte.net> wrote:

>On Tue, 23 Sep 2008 20:45:55 +0000 (UTC), spope33@speedymail.org >(Steve Pope) wrote:
>>Have you tried generating the sawtooth at a high sample rate >>(say, 1.6 MHz), lowpass filtering, and decimating to 200 KHz?
>Ah! That might work. I will try that. However, I would think that >if I upsample 8:1, interpolate and decimate back to 200 KHz, I should >get the same effect.
No, not the same; this could be the critical difference in your case.
>One thing I just realized, when I decimate, I'm merely decimating, >i.e., sending every other sample to the DAC. I should be averaging >two samples to generate the decimated output.
Actually, just decimating is usually more correct. Steve
no.spam@gte.net (Scott Gravenhorst) wrote in news:48e96146.104440734
@news.verizon.net:

> One thing I just realized, when I decimate, I'm merely decimating, > i.e., sending every other sample to the DAC. I should be averaging > two samples to generate the decimated output. I need to try that too. > It may not reduce aliasing as much as I want it to, but it will show > that I'm on the right track if I can audibly reduce it. >
No-- you should be applying a digital filter at about 40% of the target sample rate, then decimating. -- Scott Reverse name to reply