Variable Square Wave to Sine Wave

Hiya folks. I've been interested in trying to build myself a radio receiver for various bands, primarily as a learning experience. The thing is, though, I've heard that it's kind of hard to build a stable VFO above 50mhz. One of the bands I'd eventually like to receive is 2 meters (144-148mhz). Might be fun to receive television audio, as well. Not to mention, standard FM.

Since I'm more familiar with digital electronic components rather than analog, I've seen that there are programmable frequency oscillator ICs, which can be set via a microcontroller. This sounds like an easy solution for tuning, and would open the door to setting station presets and the like as well. The problem is, I'm fairly sure that these would output a square wave.

I've read about how you can basically use a low-pass filter to tune out harmonics of a square wave and get a sine wave output. But from the way I understand it, an RC filter would just filter out a specific frequency, defeating the purpose of the variable oscillator.

So that's pretty much my question: How does one turn a variable square wave into a sine wave?

Or, alternatively, what are more reliable ways to produce higher frequency sine waves to begin with? Though I'm still interested in the former question as well, for curiosity's sake.

Thanks!

- Jeff

Reply to
FyberOptic
Loading thread data ...

You could use a DDS chip. These guys make quite a few:

Or, a lower frequency DDS -- something that can be built with a microcontroller. Analog has a note on the fundamentals of DDS

formatting link
(no pun intended) or do a net search on "DDS phase accumulator" or similar. Pair the lower freq DDS to a phase-locked loop (PLL) and you're there (modulo tuning the loop and filtering the assorted artifacts).

Here's

formatting link
an example of using a microcontroller to make a DDS. I've built this one (back when the AT90S2313 was new ;-) and it does work as advertised.

--
Rich Webb     Norfolk, VA
Reply to
Rich Webb

Back up a wee bit: How is the square wave being generated? Perhaps from a triangle-wave oscillator? ...Jim Thompson

--
| James E.Thompson, CTO                            |    mens     |
| Analog Innovations, Inc.                         |     et      |
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
| Phoenix, Arizona  85048    Skype: Contacts Only  |             |
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  |
| E-mail Icon at http://www.analog-innovations.com |    1962     |
             
      The only thing bipartisan in this country is hypocrisy
Reply to
Jim Thompson

Just realized that you are a gmail/google poster (kill-filed). If you've already replied to the above question, please re-post... you're now in my "exception" filter. ...Jim Thompson

--
| James E.Thompson, CTO                            |    mens     |
| Analog Innovations, Inc.                         |     et      |
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
| Phoenix, Arizona  85048    Skype: Contacts Only  |             |
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  |
| E-mail Icon at http://www.analog-innovations.com |    1962     |
             
      The only thing bipartisan in this country is hypocrisy
Reply to
Jim Thompson

A square wave is made up of a sum of sinusoids in a special relation. In fact all periodic functions can be thought of as a simple sum of sinusoids. The only thing different is the relative amplitudes. A square wave has only odd harmonics(integral multiples of the fundamental frequency) while a saw tooth has every harmonic.

The low pass filter reduces the amplitudes of the higher harmonics which essentially emphasizes the lower harmonics. Note that if you have a fundamental frequency of f then the next harmonic is at 2f, the 3rd at 3f, etc... So an ideal low pass filter inbetween f and 2f of *any* periodic signal will return a sinusoid of frequency f. Between 2f and 3f one gets the sum of first two harmonics.

If you place a notch filter on any of the harmonics with a high Q then you can "pick" out that frequency if one exists and it will be sinusoidal(ideally). So say you have a square wave at 10Mhz. This mean's it has sinusoids at 10Mhz, 20Mhz, 30Mhz, 40Mhz, etc... If you want to get some sinusoid at 1000Mhz then you simply create a notch filter at that position. Unfortunately the harmonics amplitude decause as 1/k which means that amplitude of that 1000Mhz sinusoid will be 1/100th of the original.

If we used a 1Mhz square wave then it will be not only harder to pick out the 100th harmonic because the amplitude is 1/1000th of the original but also because now the harmonics are only 1Mhz apart which means our notch filter has to have a much higher Q. (and this analysis is not considering external noise involved)

Your first question is, at least for a rough method, is to simply LP any signal. Eventually you'll arive at the fundamental which, ideally, will be a perfect sinusoid. The second question's answer is to notch filter a "spectrally rich signal. But as I have explained, this gets harder and harder to do. You won't be able to take a 1V 1Hz square wave and recover a

1Ghz sinusoid as the amplitude is 1pV. Not only that you have other harmonics right next to it. Of course depending on your application it may not be all that important. If you used a 100Mhz signal then the amplitude is only 0.1V and the side harmonics are 100Mhz away.
Reply to
Jon Slaughter

Most modern mixers act as switches driven by the local oscillator signal. So even if you made a nice sinusoidal signal out of your local oscillator, it'd be effectively squared up inside the mixer.

So use the chip, and don't worry about the square wave output -- it's not only not a problem, for some mixers it's desirable.

_Do_ concern yourself with phase noise and frequency stability -- local oscillators for weak signal work have a lot of requirements imposed on them that just don't apply to -- or don't matter for -- oscillators for digital circuits.

Were it me I'd just make sure that the LO is on it's own board, with connectors to make it reasonably easy to swap out. Then I'd proceed from there.

Get a copy of the ARRL Handbook -- it addresses a lot of these issues for you.

--
Tim Wescott
Control system and signal processing consulting
www.wescottdesign.com
Reply to
Tim Wescott

One, google "softrock radio"

Two, with all due respect to my learned colleague, instead the of ARRL handbook, try

Experimental Methods in Radio Frequency Design, by Campbell, and Hayward, its more geared to modern, simple, home made gear then the ARRL handbook is , sadly...

then look at

formatting link

then

formatting link

the old kit

Steve

Reply to
osr

Is it? Sad about the Handbook, but at least there's something out there.

When I'm feeling wordy I recommend the latest Handbook, plus one from the 50s, 60s, or 70s. If you don't mind toobs, there's a _lot_ of good stuff in those older book!

I like Hayward's "Radio Frequency Design", but it's a text for a

4th-year college class, and requires that you have strong analog chops to just pick it up and read.
--
Tim Wescott
Control system and signal processing consulting
www.wescottdesign.com
Reply to
Tim Wescott

Hayward's "Introduction to Radio Frequency Design" was the first book on RF design I ever bought a few years back...I bought it because it had "Introduction" in the title... O_O

Reply to
Bitrex

To produce "higher frequency sine waves" (RF) you make use of a VCO. You may design your own (perhaps Colpitts) VCO or you may buy a canned one frome Minicircuits or similar. To reliably adjust the oscillation frequency you phase-lock your VCO to a stable crystal reference. This is achieved by a PLL (Phase-Locked Loop) which is offered by different vendors. A microcontroller is used to program some registers of the PLL to achieve the desired frequency. Commercially available PLLs clearly state the signal level that is required from your (sinusoidal) VCO. So, the whole thing looks like this:

XTAL--------PLL-->Filter-->VCO-->Power splitter---> synthesized sine ^ ^ | | | | | ·-----------------------· uController-·

Once you become familiar with this you may start looking at spurs, jitter, etc.

For "lower" frequencies, direct digital synthesis (DDS) may also work.

Pere

Reply to
oopere

Plain RC filters have a "rolloff" thus work on a range of frequencies. A simple low pass filter would have lower output amplitude as the input frequency goes up. Now why do you think you need a sine wave?

Reply to
Robert Baer

I've just had a look at amazon.co.uk (not available) then amazon.com.

4 Used available from _$498.97_ (up to $937.87).

It would need to be good at that price!

Nial.

Reply to
Nial Stewart

Lets see,mine was 29.99 when they switched from the first edition to the second.

Steve

Reply to
osr

That's crazy! They had them on Amazon in the US for $49.00 to $41.00.

George H.

Reply to
George Herold

It seems to be available at ARRL for $49.99:

formatting link

--
Muzaffer Kal

DSPIA INC.
ASIC/FPGA Design Services

http://www.dspia.com
Reply to
Muzaffer Kal

Try Abe or other used bookstore.

Reply to
Robert Baer

...so...if you want fresh oats, get them at the front of the horse...

Reply to
Robert Baer

There are sine wave DDSs out there that do milliherts to 40 MHz or so.=20 a little heterodyning to get LO up to several hundred MHz and have fun. Too bad they are not all that inexpensive. Plus you still have a lot of=20 work to do afterward.

Start by studying superhetrodyne radios. Most the rest follows from = there. Also take a look at some direct conversion systems.

Reply to
JosephKK

Oh yeah. That got the old Jones going again. And now i have scope = enough.

Reply to
JosephKK

has

Introduction to Radio Frequency Design (ISBN: 0134940210 /

0-13-494021-0) H.H. Hayward
--
Greed is the root of all eBay.
Reply to
Michael A. Terrell

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.