[sdiy] PIC-based Digital Oscillator question
Ian Smith
taciturn_unquiet at hotmail.com
Sun Apr 24 00:46:31 CEST 2011
> > Let me see if I am understanding this correctly: For the phase accumulator and the frequency increment, every time you overflow the phase accumulator, the frequency increment is incremented by one and the top how-many-ever bits of the frequency increment are used to look up a value from the waveform table. So the faster you increment through the phase accumulator, the higher the frequency of the output.
> > -Ian
>
> Nearly. There's no need to alter the frequency increment.
>
> Every sample you add the frequency increment to the phase accumulator, and then you use the top how-ever-many bits for the lookup, like you said. The larger the frequency increment, the faster the phase accumulator will overflow and the higher the frequency of the output.
>
> There's a page on my site explaining the principles if you're interested:
>
> http://www.electricdruid.net/index.php?page=info.dds
>
> Tom.
Yeah, that's where I was looking. I guess I just understood it backwards. I'm going to try to wrap my brain around it again...
So let's say that I'm going to output to a port on the PIC and then feed the port though an R2R ladder for the DAC (so 6-bit resolution based on the PIC that I'm using, the 16F676). My table would have 64 values in it(?) and the phase accumulator would then also have to be 6 bits wide(?) and the frequency increment would be a much smaller number(?)
Or would I use a phase accumulator that was larger than the table that I'm using and just use the top 6 bits of the accumulator to look up the value on the table?
I fear that I'm not quite understanding this and may need in explained to me in Captain Dummy Talk...
-Ian
More information about the Synth-diy
mailing list