Well, there's always the DIY sine wave DAC using a CD4017. That makes the filtering a lot easier.
Cheers
Phil Hobbs
Well, there's always the DIY sine wave DAC using a CD4017. That makes the filtering a lot easier.
Cheers
Phil Hobbs
Sure, but the wee problem will be a lack of granularity when setting the frequency. Unless I would alter the DFL inside the uC in order to set the whole master clock to odd numbers, IOW the uC master clock becomes my VCO. Then chances are that the USB or something else falls apart.
I need a few ten Hoitz of granularity for the VCO frequency. Being more of an RF guy by trade I am tempted to build a cheapo VCO that oscillates between the uC clock and 15kHz above it, mix that with the uC clock, and ... voila. Of course there comes a point where I might just do it all analog and it won't much extra effort.
I'm not sure I agree with your more than 1MHz assessment. It depends on just how clean you need the sine wave to be, of course, but you'll have a first alias at fs - 10Hz; as soon as you can pound that down sufficiently then you're done.
As much as I'm generally pro-uC, if you have to bring a whole nother person on board, I can see not wanting to.
I've never seen one of those that was really clean at the tips of the sine waves -- I don't see how being able to stand the little tit on the end of your sine wave is consistent with needing to sample your DAC at over 1MHz to attain your desired performance.
If you didn't have the "need a uC guy" constraint, having a microprocessor feeding a DDS may work. That depends on how flexible a clock you could get out of the micro, of course.
Apparently I have not understood the real question. since I do not understand what the real issue is :-(.
If you want two sine waveforms with xyz degree phase shift, any NCO calculation should be able to do it on Left and Right soundcard stereo channel.
If you are phase locking to some existing sine waves, you need the quadrature Q signal by doing 90 degree phase locking. After that, any phase shift from the Q signal can be generated by adding the suitable phase shift to the main phase accumulator.
What I assumed was the time it takes to clock through the R2R. A quarter wave of a 10kHz sine takes 25usec. If you want a reasonable R2R-style amplitude tracking you'd have to have well below 1usec step granularity in the pseudo-DAC.
It can be contracted out. Just like the Windows GUI stuff and other programming will have to be. But if we can avoid uC-programming that would be nice.
Well, I don't see how to get a decent sign with less than 25 steps per quarter-cycle. The tit is very high frequency, I usd to get rid of that with LC.
If the DDS could be cajoled into working with a reference of less than
100kHz that would be very feasible.But I might just do it the usual way. Using a higher frequency VCO plus a crystal oscillator slightly lower in frequency, then mixing that down to 5-15kHz. If I felt really decadent I could even buy the VCO, like thsi one:
then mixed its output with the output of this one:
But that would feel very unsportsmanlike. Like "cooking" a TV dinner.
The essence of the task is this: A generator sends a sine wave of around
10kHz into a reactive network. This network causes a phase shift (current versus voltage, like a power factor) but that is not totally known because the exact RLC values in the reactive network are not known. I want to keep that phase shift constant.
OK. So taking as an engineering specification the level of the RMS error, and assuming no error in the DAC beyond sampling. When you use the for-free sinc filtering that comes from the sample and hold behavior of the DAC but no other filtering, the total RMS voltage of the aliasing components is 1.6% of the signal voltage.
If you sample at 100kHz and run the output of your DAC through a 2nd- order Butterworth filter with a cut-off frequency of 40kHz, then you get more than twice the attenuation of the resulting aliasing, and you get rid of a lot more of the "stair-steppy" than just by sampling fast.
At 15kHz you're only down to 1.9% of the total -- but if you sampled at
1MHz with no filtering and 15kHz out, you'd be worse off, too.And, I pulled these numbers out of my donkey*. Actually putting in some effort to select sampling rates and filter cutoff frequencies may result in a better tradeoff.
If you use a 40kHz-cutoff Butterworth that should take care of it nicely (or an LC. At 10kHz???). Now where did I see that filter mentioned?
09744-1164-NDND/280251
I actually like the "two RF oscillators beating" solution, but only because I'm a geek. It will, of course, need a clean sine wave on one channel, but then the other can be just about anything as long as your mixer is linear. I bet that once you get all the necessary bells and whistles in place you'll have used more real estate than a micro sampling at 100kHz followed by a 2nd-order Butterworth, though.
Yeah, ok, if I need a filter I might as well use a square wave and hang an LC lowpass behind it. Can be Chebyshev or even elliptical because phase won't matter since we can tap off after the filter. I wouldn't spring for any DAC if I have to filter after all.
I think the two-oscillator method plus mix down is less effort :-)
I routinely do LC down there. But then I might as well go in with a square wave.
If it absolutely has to be cheap you can do all that in CMOS to the tune of around 50 cents. There are cheap RF receiver chips that contain a VCO-capable LO, a mixer, and even a preamp. Plus lots of other stuff that would have to lie fallow. So all this needs is another oscillator. That one has to be sine but that's totally easy up there. Doesn't even have to be crystal-controlled.
I'd probably have said "out of my hat". When I was a kid grandma read another story about a donkey. One that pooped money when you lifted its tail. Still trying to find one of those ...
A lot of Analog Devices DDS chips include an on-board reference clock multiplier.
offers a programmable 4x to 20x internal multiplication. At $17.19 in volume, it's way outside your financial comfort zone. The AD5932 is cheaper, and might work.
You'd need more than a 2nd-order filter to smooth out a square wave at any frequency between 5 and 15kHz. At least to the degree that you're calling out with your 1us sampling into an unfiltered DAC.
But your two-oscillator approach with an NE 612 or whatever is just too cool. I think you should do that so that I can say "tsk tsk" if it doesn't work, and gloat vicariously if it does.
Why would you need 1 Ms/s to generate pure sine way at 10 kHz ?
As long as the clock rate is not a simple harmonic of the wanted signal, something like 44.056 kHz (the original digital audio sample rate) might do. Just put an analog reconstruction filter after the DAC.
At a slightly higher sample rate would allow a simple RC filter (-6 dB/octave) to attenuate the sampling rate aliases from distorting the analog waveform significantly. With such a gently filters, there are not going to be a lot of phase error between the channels, due to component tolerances.
In the NCO system, the frequency granulaty is determined by the length of the phase accumulator, the width of the DAC only defines the amount of distortion and spurs.
For audio applications a 24 or even 16 bit phase accumulator would be sufficient. Even a simple 8 bitter should be able to increment a 2 or
3 byte integer at every interrupt. Then take say the 8 highest bits from the phase accumulator, use it to address the 256 position LUT and feed the result to DAC. Take the same top of phase accumulator, add a constant (phase difference) ignoring carry and use it to access the same 256 position LUT and feed it to the other DAC.A simple one chip controller with 16 digital outputs should be able to feed two R2R DACs.
I was figuring of around 25 steps per quarter-cycle, in order to get a decent sine representation without much filtering.
That was the whole purpose of that exercise, to avoid elaborate filtering. If I need to do much filtereing I might as well take a square wave. Since the frequency will be somewhat variable filtering is a bit of a hassle.
Phase error is no problem because this signal feeds the whole chebang, so things are ratiometric.
It can probably be done with a 4-pole Chebyshev.
It'll work. But it has too much sledgehammer appeal :-)
That is pricey. But first I will be looking at simpler and cheaper solutions. And it seems it'll again be all analog. Sometimes a modern digital approach simply doesn't cut it.
But if done with a cheap IC or two those may be the best :-)
Jeorg, How about a varactor tuned Wein bridge oscillator an FTDI chip, a micro (PIC, AVR. etc.,), mostly to handle the FTDI chip, a couple onchip comparators, then using a counter in the uC count clocks after the first comparator detects a "zero crossing" of the reference, to the time the second comparator detect the locked signal zero crossing. With a touch of logic (possibly external to the uC) this will allow producing the opportunity of having correction pulses to integrate every half cycle. It would allow fast phase adjustment and stable lock, the phase resolution would be determined by the counter clock rate.
?-)
The problem with varactor diodes is that pretty much all high capacitance ones have gone lalaland. Probably because there are no radios with discrete oscillators and filters anymore.
Not to mention that they distort like crazy. You'd have to keep the oscillations at very low amplitude, and you'd be challenged by noise issues.
JFETs are hard to come by and distort, too, but I think they may be easier to deal with than varactors.
Hey! How about this:
Make a state-space oscillator with two multiplying DACs in it; one for frequency, and one for damping. Then use a micro to set the DACs. It should be great fun, and the load on the micro will be light.
It might even take up no more space than the NE 612 solution...
Not sure about that. Doing it in time domain would require a LUT being pumped into the DAC at a fairly fast clip. But who knows, maybe there is a DAC chip that has much of this in there already?
The SA612 isn't ideal. Best would be a chip that has the output of the RF preamp piped out to a pin. Then you can make a 2nd oscillator from the preamp and you won't need an extra IC or transistor for it.
I'm not talking about having the audio frequency stuff come out the micro
-- I'm talking about having an all-analog oscillator that happens to be controlled by multiplying DACs in the signal chain:
.---> integrator ---> mpy DAC 1 ---+---> integrator ----o----> | A | | '----- mpy DAC 2 ----o | | '-------------------------------------------------------'
Multiply DAC 1 sets the frequency, multiply DAC 2 sets the damping (which is nominally 0, but which you'll need to nudge around for AGC. Or just use a two-diode amplitude stabilization, why didn't I think that earlier?)
OK, how about this:
.---> integrator ---> mpy DAC ---+---> integrator ----o----> | A | | '------- AGC --------o | | '-----------------------------------------------------'
D'oh. Of course.
Have something to add? Share your thoughts — no account required.
Ask the community — no account required