So how many plots should I do to get an satisfactory wave?Vo = Vp sin theta
My maths (discrete maths) -- is %55 pass mark at University level. So if I just pulled out paper, pen and a calculator and did say 128 points I might get away with it?Your satisfaction is entirely subjective.
Other people know how to do the math for % distortion per number of datapoints.
I will have to defer to them.
Thanks buddy...There's a good tutorial that explains all, here:
http://www.analog.com/media/en/training-seminars/tutorials/MT-085.pdf
Could I use some filter, say butterworth to smooth things out a little?Short answer: what you can "get away with" in terms of DAC resolution and number of sine table entries depends entirely on what THD level you need to achieve.
Do you have the MS Excel file by any chance?...As for the sine table, just use a spreadsheet.
As an analog oriented person, I prefer a tuned LC tank.Could I use some filter, say Butterworth to smooth things out a little?
Yeah perhaps I'll do an PIC-based digital function generator too. You wanna do the maths and get some credit in the project? I only have 256 bytes of RAM to play with, so I think say maybe 128 points for an lookup table? Probably get away with it.As an analog oriented person, I prefer a tuned LC tank.
Generally, you'll HAVE to use a filter, or your output will have harmonics out the gazoo. Depending on how pure a sine wave you need to generate, anything from a first-order filter to an 8th-order filter might be necessary.Could I use some filter, say butterworth to smooth things out a little?
I used to have a whole bunch of 'em, for various DDS projects, but not anymore. They're easy to generate, though.Do you have the MS Excel file by any chance?...
Yeah I guess. Many ways to skin an cat.Why do you need to use RAM for a look-up table? You have 2048 words in program memory.
So I just need to plot value for 90 degrees of the wave?As Alec_T noted, your table only has to have the DAC values for the first quadrant of the sine wave. First step forward through the table, then step backward; then reverse the sign of the table values while stepping forward again, then stepping backward. Rinse and repeat for each cycle...
Yup.So I just need to plot value for 90 degrees of the wave?
1) No.Yeah perhaps I'll do an PIC-based digital function generator too. You wanna do the maths and get some credit in the project? I only have 256 bytes of RAM to play with, so I think say maybe 128 points for an lookup table? Probably get away with it.
I recall an project years back where a guy digitally created a rather crude stepped sine wave and feed it through an 3rd order butterworth and it came out nice and clean.
I don't want to use any specialized chips. I want DIY projects for under $100 that use dead easy to get parts anywhere in the world. The generator would of course be an toy and good for audio / hobby work... perhaps not audio if the distortion is >0.1% But still by far the best oscillator for audio work is the wein bridge. Distortion is like 0.001% or thereabouts?There are digital signal processing chips that work wonders at changing filters according to the frequency.
I believe that is achievable. I bought my EICO 390 signal generator in 1977.I want DIY projects for under $100 that use dead easy to get parts anywhere in the world.
Yup.Just wondering about processing resources / speed for a minute though... now I would need logic in my code to manipulate the table to go from 90 to 180, then to 270 and finally 360 degrees and repeat. Right?
Yes, representing the full sine wave cycle in your table would give the least amount of work for the CPU. When speed is paramount, that's what I've done. Do put your table in program memory, though...Could I obtain an higher frequency if I did an 360 degree plot? That way I would just be fetching (n) value from the table in RAM and writing straight to the port. Seems like less computing.
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
Generating a 38kHz Sine Wave | General Electronics Chat | 9 | ||
V | generating sine wave | Microcontrollers | 6 | |
P | Generating High Resolution Sine wave Using PIC's PWM | Microcontrollers | 4 | |
P | Generating 10kHz sine wave signal by PIC and DAC IC | Microcontrollers | 17 | |
E | generating sine wave | Analog & Mixed-Signal Design | 24 |
by Aaron Carman
by Aaron Carman
by Duane Benson