Searching \ for '[PIC]: DSP (was: Square wave to sine wave - how?)' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: piclist.com/techref/microchip/math/index.htm?key=sine
Search entire site for: 'DSP (was: Square wave to sine wave - how?)'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: DSP (was: Square wave to sine wave - how?)'
2003\06\20@180905 by John Nall

flavicon
face
At 10:24 AM 6/20/2003 -0600, Tim Webb wrote:

>Check out these URLs they might help provide a lot of information that
>would allow you to  understand how to convert a square wave into a sine
>wave.  Typically a filter can be designed to remove all of the harmonics
>after the fundamental frequency and that ideally would produce a perfect
>sine wave.
>
>A Sine wave has only the fundamental frequency with no other harmonics

Roger that.  I had no idea that it was such a complicated thing to
do!!   And this response is meant to express thanks to the others that
responded (including Grumpy Olin :-)

So it looks to me from going through the responses, that filtering is the
way to go.  OK.  I can deal with that.  One further question to throw
out:   As a Ham of about 36+ years (which probably entitles me to some sort
of pin) I feel pretty sure I can construct a filtering circuit.  But it
ALSO looks like some digital signal processing (DSP) might come in handy
here.  Anyone have any thoughts on that???

John

--
http://www.piclist.com hint: To leave the PICList
spam_OUTpiclist-unsubscribe-requestTakeThisOuTspammitvma.mit.edu>

2003\06\21@012822 by Randy Ott

flavicon
face
The DSP solution will allow you to generate very clean sine waves all by
itself.  Sounds like to me that what you really want is a DDS.  Then you can
generate sine waves from milli-Hertz to 10's of Mega-Hertz or more with
milli-Hertz resolution.

( I spelled out milli and Mega to avoid flames about wrong units )

Randy Ott

{Original Message removed}

2003\06\21@120210 by Dave Dilatush

picon face
John wrote...

>So it looks to me from going through the responses, that filtering is the
>way to go.  OK.  I can deal with that.  One further question to throw
>out:   As a Ham of about 36+ years (which probably entitles me to some sort
>of pin) I feel pretty sure I can construct a filtering circuit.  But it
>ALSO looks like some digital signal processing (DSP) might come in handy
>here.  Anyone have any thoughts on that???

What are you aiming to do with this sine wave, John?  Knowing
that might be the key to getting you a good answer.

Does it really have to be derived from a PIC-generated square
wave?  Or could it be generated by a standalone oscillator
circuit?  Doing the latter might actually be easier and cheaper,
if you need very low distortion.

You said in an earlier post that the frequency was around 40 kHz
and you needed to be able to adjust it for "tweaking" purposes;
how much adjustment?  How finely do you need to adjust it?

What's the most important figure of merit here: low distortion?
Frequency accuracy?  Frequency stability?  Tuning repeatability?

The problem is, there are 25 cent solutions for generating sine
waves, and there are 25 dollar solutions, and everything in
between.  And which solution is appropriate, depends on what you
want to do.  The trick is to avoid using a sledgehammer to swat a
fly, so to speak, and also avoid trying to bring down a grizzly
bear with only a BB gun.

Speaking of 25 dollar solutions, I haven't done anything with DSP
chips; but I have worked with Analog Devices' AD9850 DDS (Direct
Digital Synthesis) chip, which can produce high-quality,
digitally-tuned sine waves over a very large frequency range.

Here's an appnote describing how to use an AD9850, along with a
PIC, to make a digitally-tunable LO for a ham transceiver:

http://www.analog.com/UploadedFiles/Application_Notes/70863939AN557.pdf

Hope all this helps a bit...

Dave D.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\06\21@122821 by John Nall

flavicon
face
At 02:42 PM 6/21/2003 +0000, Dave Dilatush wrote:

> >What are you aiming to do with this sine wave, John?  Knowing
>that might be the key to getting you a good answer.

Yes, I gathered from Olin's note that providing a lot more detail, and less
"weasel words" would be helpful.  The problem is that I am still sketching
out the details, and so do not have them all pinned down.  I have a hunch
that there are two classes of questions on this list:  (a) People who have
a specific project, with all the i's dotted and all the t's crossed except
for just one little obstacle which they need help with, and (b) people like
me who are trying to figure out the best approach to take in the first
place but do not have the experience to jump right in, without some
preliminary investigation.

That said:   The overall project has to do with underwater communications,
using transducers.  I have been told that the purer the tone driving the
transducer, the more efficient it would be, and so figured that a sine wave
would be better to drive it with than a square wave would be.  So the
original query was basically:  "How hard it is to convert a square wave to
a sine wave?"

So I think that probably answers the rest of the questions you posed.  And
thanks for the info.

John
(a/k/a "The Weasel")

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\06\21@132056 by Dave Dilatush

picon face
John wrote...

>The overall project has to do with underwater communications,
>using transducers.  I have been told that the purer the tone driving the
>transducer, the more efficient it would be, and so figured that a sine wave
>would be better to drive it with than a square wave would be.

Aha.  This has all the earmarks of a 25 cent problem, if all you
need is to avoid wasting power with useless harmonics.

I think if you were to generate your square wave using one of the
PIC's PWM channels (set to a 50% duty cycle) and then filter the
square wave with a 2-stage RC filter using 10K resistors and
1000pF capacitors, you'll get a reasonable enough approximation
to a sine wave for this purpose.  And you can tweak the frequency
(though not with very high resolution) by changing the Timer2
period register PR2.  You'll have to amplify the filter output,
of course.

Hope this helps...

Dave D.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\06\21@145910 by gtyler

flavicon
face
I did something like this using fish finder transducers. You might increase
the efficiency of the transducer, but you will loose more than you gain in
the driver cct. Best is to drive with a square wave through an inductor that
tunes the capacitance of the transducer to the fundermental. You will get a
big increase in voltave across the transducer and even more power. If the Q
is too high, causing low data rates, damp it with a resistor across the
inductor.

George Tyler

{Original Message removed}

2003\06\21@222446 by Richard Graziano

picon face
I have not been following this thread, so I may be off base.  But if you
need one particular frequency, and do not require variable control, it would
be easy to design a sinusoidal oscillator with a low impedance output
buffer/driver.  This would have better quality (i.e., less distortion) than
a converted square wave.  It may be easier also, to simply design a high
purity oscillator.

I apologize if this has already been discussed.

Rich
{Original Message removed}

2003\06\23@055748 by Nigel Orr

flavicon
face
pic microcontroller discussion list <> wrote on Saturday, June 21, 2003
5:28 PM:

> That said:   The overall project has to do with underwater
> communications, using transducers.  I have been told that the purer
> the tone driving the transducer, the more efficient it would be, and
> so figured that a sine wave would be better to drive it with than a
> square wave would be.  So the original query was basically:  "How
> hard it is to convert a square wave to a sine wave?"

How limited is the transmitter?  If there is no shortage of power, and the
amplifier and transducers can cope with the heat generated, I would
probably go for a lowpass filter and a simple differential pseudo-sine
wave, use two outputs so you can generate +5/0/-5.  It depends on even more
specs (!!!), like how much power is available, what the comms channel
(vertical or horizontal, type of water) is like etc.  I, and others on the
list, have some experience in underwater comms (several km in a 30m
channel, a couple of 100km in deep water with some fairly heavy duty DSP),
so if you are able to reveal more about your application, someone here
_might_ be able to save you quite a lot of duplicated effort and some
not-so-obvious 'gotchas'.

Nigel
--
Nigel Orr, Design Engineer                 .....nigelKILLspamspam@spam@axoninstruments.co.uk
Axon Instruments Ltd., Wardes Road,Inverurie,Aberdeenshire,UK,AB51 3TT
              Tel:+44 1467 622332 Fax:+44 1467 625235
                  http://www.axoninstruments.co.uk

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\06\23@150550 by Tim Webb

flavicon
face
Maybe a simple low pass filter from mini-circuits will work.

-----Original Message-----
From: John Nall [jnall01spamKILLspamALLTEL.NET]
Sent: Friday, June 20, 2003 3:08 PM
To: .....PICLISTKILLspamspam.....MITVMA.MIT.EDU
Subject: Re: [PIC]: DSP (was: Square wave to sine wave - how?)


At 10:24 AM 6/20/2003 -0600, Tim Webb wrote:

>Check out these URLs they might help provide a lot of information that
>would allow you to  understand how to convert a square wave into a sine
>wave.  Typically a filter can be designed to remove all of the harmonics
>after the fundamental frequency and that ideally would produce a perfect
>sine wave.
>
>A Sine wave has only the fundamental frequency with no other harmonics

Roger that.  I had no idea that it was such a complicated thing to
do!!   And this response is meant to express thanks to the others that
responded (including Grumpy Olin :-)

So it looks to me from going through the responses, that filtering is the
way to go.  OK.  I can deal with that.  One further question to throw
out:   As a Ham of about 36+ years (which probably entitles me to some sort
of pin) I feel pretty sure I can construct a filtering circuit.  But it
ALSO looks like some digital signal processing (DSP) might come in handy
here.  Anyone have any thoughts on that???

John

--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspam_OUTspamTakeThisOuTmitvma.mit.edu

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

More... (looser matching)
- Last day of these posts
- In 2003 , 2004 only
- Today
- New search...