I'm interested in creating low frequencies using a high-frequency oscillator. For example - using a 12Mhz oscillator to create 1Khz, 2Khz waves.
I've been said that using a Binary (削除) adder (削除ここまで)(oops) counter it could be accomplished.
Anyone could please help me to understand how this can be done? Also, I should use a low-pass filter for Sine(ish) waves. How does this come into place?
The target is to create about 5 distinct frequencies and "stream" them out of the circuit. The circuit should be very cheap - so no mC could be used.
Many thanks for the help :)
-
\$\begingroup\$ what kind of high-frequency oscillator are you using - or have you not chosen one yet? \$\endgroup\$Jim– Jim2011年07月23日 09:14:36 +00:00Commented Jul 23, 2011 at 9:14
-
\$\begingroup\$ If you're looking at creating a sine wave, this question may be of help -electronics.stackexchange.com/questions/16512/… You might be surprised by how low cost a micro controller may be once you've added everything up. \$\endgroup\$Jim– Jim2011年07月23日 09:19:28 +00:00Commented Jul 23, 2011 at 9:19
-
\$\begingroup\$ It was a Binary Counter I suggested, not a Binary Adder. The two are very different. Read the data sheet for the '4040' CMOS chip. \$\endgroup\$Majenko– Majenko2011年07月23日 09:53:09 +00:00Commented Jul 23, 2011 at 9:53
-
\$\begingroup\$ sorry - really was the Counter :) \$\endgroup\$roman– roman2011年07月23日 10:39:32 +00:00Commented Jul 23, 2011 at 10:39
-
\$\begingroup\$ @roman - I mention a counter in my answer for the non-microcontroller solution, but it does actually what the uC also does, but then in software. \$\endgroup\$stevenvh– stevenvh2011年07月23日 10:45:20 +00:00Commented Jul 23, 2011 at 10:45
1 Answer 1
Yes, that was Matt who told you about the filtering to get a sine from a square wave; unfortunately he forgot to tell you how to do this. :-)
Well, it's not easy. A 1kHz square wave will have a 3kHz harmonic with 1/3 amplitude, a 5kHz with 1/5 amplitude, etc. That's a lot of energy in the harmonics which you want to get rid of. You need a sharp low-pass filter to be sure that the 3kHz is attenuated enough. That's possible, but not so easy to make it variable; for the 2kHz sine you want a higher cut-off frequency.
enter image description here
The plot shows that the signal still looks more like a square wave than a sine even with all except the third of the harmonics removed.
All this suggests that this may be an easy approach to generate different crystal-stable frequencies from a single 12MHz oscillator, but not sines. For sines there are analog solutions like the Wien bridge, but these aren't so frequency stable.
Like I said in my other answer DDS really is the way to go; you get the best result for the money. If you don't want to use a microcontroller you can use a lookup ROM programmed with a sine waveform, let a counter run over all addresses, and feed the output to a DAC. That requires a little bit of logic, but no uC. The clock you use for the counter will be a multiple of the sine, so feeding a different clock frequency will give you a different sine frequency.
All this said, this may cost as much as a microcontroller; there's no reason to dismiss a microcontroller because it would be too expensive. uCs are dirt cheap these days and often a more economical solution that analog alternatives. You won't find anything simpler than Jesper's generator (was linked here http://www.myplace.nu/avr/minidds/index.htm, link now broken)
If you want to generate the 5 signals simultaneously and mix them the DDS solution is even more cost-effective: you'll need only one (1), vs 5 oscillators in an analog solution.
edit
If you only need 5 fixed frequencies you might want to switch them on and off selectively, so that you can mix them. Easy with the DSS uC: instead of keeping one phase accumulator (expensive word for "counter"), you just keep 5 of them, and add the sine values before sending them to the external DAC. You could use 5 switches to turn them on and off. You don't need the MAX232 then. Like I said: cheap.
-
\$\begingroup\$ I'm not sure the OP wants the Oscillators to be adjustable - "The target is to create about 5 distinct frequencies" It may be that they just want fixed frequencies, which would be a lot easier to filter \$\endgroup\$Jim– Jim2011年07月23日 09:23:08 +00:00Commented Jul 23, 2011 at 9:23
-
\$\begingroup\$ @Jim - I really need only 5 FIXED frequencies. No need for dynamic generation or stuff like that. \$\endgroup\$roman– roman2011年07月23日 10:29:24 +00:00Commented Jul 23, 2011 at 10:29
-
\$\begingroup\$ @Stevenvh - thanks for the great answer. I'm going to check the DDS solution (though it seems little expensive). I'm looking for max 3$ solution. better even less. \$\endgroup\$roman– roman2011年07月23日 10:30:16 +00:00Commented Jul 23, 2011 at 10:30
-
3\$\begingroup\$ @roman - the microcontroller used (actually its successor, the ATtiny2313) costs 2 euro, and you hardly need anything else. The MAX232, for instance only if you want to connect to a PC. But you can use pushbuttons to control it if you want. \$\endgroup\$stevenvh– stevenvh2011年07月23日 10:33:43 +00:00Commented Jul 23, 2011 at 10:33
-
3\$\begingroup\$ @roman - if you take a look at Jesper's page you'll see that it can do sines too. It uses a sine lookup table and a DAC (cheap, just resistors). If you tweak the software a bit you can even generate several different sines added together. \$\endgroup\$stevenvh– stevenvh2011年07月23日 10:40:30 +00:00Commented Jul 23, 2011 at 10:40