DSPRelated.com
Forums

Square wave detector

Started by pinku November 3, 2007
Hi,
I need to detect a presence of square wave. If square wave is there I
need to generate a logic 0 and this square wave is not present I need
to generate logic 1 or vise versa. Can you suggest me a circuit for
this functionality.

Thanks in advance

Regards
Pinku

pinku wrote:
> Hi, > I need to detect a presence of square wave. If square wave is there I > need to generate a logic 0 and this square wave is not present I need > to generate logic 1 or vise versa. Can you suggest me a circuit for > this functionality.
First, you have to do a lot better than that at defining "square wave". You might be surprised at the variety of signals that have been called square waves.
"pinku" <praveenkumar.bm@gmail.com> wrote in message
news:1194110521.868836.186370@k35g2000prh.googlegroups.com...
> Hi, > I need to detect a presence of square wave. If square wave is there I > need to generate a logic 0 and this square wave is not present I need > to generate logic 1 or vise versa. Can you suggest me a circuit for > this functionality.
Does your signal line have only a square wave on it, or are there other things present when the square wave isn't? Is the squarewave centered on zero (so it goes positive and negative) or does it have zero as its floor? What is the magnitude (volts) of the signal? What's the period (or frequency) of the square wave?
Greg Neill wrote:
> > "pinku" <praveenkumar.bm@gmail.com> wrote in message > news:1194110521.868836.186370@k35g2000prh.googlegroups.com... > > Hi, > > I need to detect a presence of square wave. If square wave is there I > > need to generate a logic 0 and this square wave is not present I need > > to generate logic 1 or vise versa. Can you suggest me a circuit for > > this functionality. > > Does your signal line have only a square wave on it, > or are there other things present when the square > wave isn't? > > Is the squarewave centered on zero (so it goes positive > and negative) or does it have zero as its floor? What > is the magnitude (volts) of the signal? > > What's the period (or frequency) of the square wave?
And, for what period can the square wave be present (absent) before the output must correctly signal its status? If you've got enough time, you could use a technician, an oscilloscope and a toggle switch. Technician examines the 'scope periodically and, if the wave status changes, flips the switch to the correct position. ;-) -- Paul Hovnanian paul@hovnanian.com ----------------------------------------------------------------------- Procrastinators: The leaders for tomorrow.
On Sat, 03 Nov 2007 10:51:45 -0700, "Paul Hovnanian P.E."
<paulh@seanet.com> wrote:

>Greg Neill wrote: >> >> "pinku" <praveenkumar.bm@gmail.com> wrote in message >> news:1194110521.868836.186370@k35g2000prh.googlegroups.com... >> > Hi, >> > I need to detect a presence of square wave. If square wave is there I >> > need to generate a logic 0 and this square wave is not present I need >> > to generate logic 1 or vise versa. Can you suggest me a circuit for >> > this functionality. >> >> Does your signal line have only a square wave on it, >> or are there other things present when the square >> wave isn't? >> >> Is the squarewave centered on zero (so it goes positive >> and negative) or does it have zero as its floor? What >> is the magnitude (volts) of the signal? >> >> What's the period (or frequency) of the square wave? > >And, for what period can the square wave be present (absent) before the >output must correctly signal its status? > >If you've got enough time, you could use a technician, an oscilloscope >and a toggle switch. Technician examines the 'scope periodically and, if >the wave status changes, flips the switch to the correct position.
I bet a PhD in physical chemistry would work almost as well. John
Greg Neill wrote:
> "pinku" <praveenkumar.bm@gmail.com> wrote in message > news:1194110521.868836.186370@k35g2000prh.googlegroups.com... >> Hi, >> I need to detect a presence of square wave. If square wave is there I >> need to generate a logic 0 and this square wave is not present I need >> to generate logic 1 or vise versa. Can you suggest me a circuit for >> this functionality. > > Does your signal line have only a square wave on it, > or are there other things present when the square > wave isn't? > > Is the squarewave centered on zero (so it goes positive > and negative) or does it have zero as its floor? What > is the magnitude (volts) of the signal? > > What's the period (or frequency) of the square wave?
How square is it really? I.E. what's the bandwidth? Are there other signals at the same time? Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
On Sat, 03 Nov 2007 10:22:01 -0700, pinku <praveenkumar.bm@gmail.com>
wrote:

>Hi, >I need to detect a presence of square wave. If square wave is there I >need to generate a logic 0 and this square wave is not present I need >to generate logic 1 or vise versa. Can you suggest me a circuit for >this functionality. > >Thanks in advance > >Regards >Pinku
I smell a differentiator somewhere in that circuit. D from BC
Jerry Avins wrote:
> Greg Neill wrote: >> "pinku" <praveenkumar.bm@gmail.com> wrote in message >> news:1194110521.868836.186370@k35g2000prh.googlegroups.com... >>> Hi, >>> I need to detect a presence of square wave. If square wave is there I >>> need to generate a logic 0 and this square wave is not present I need >>> to generate logic 1 or vise versa. Can you suggest me a circuit for >>> this functionality. >> >> Does your signal line have only a square wave on it, >> or are there other things present when the square >> wave isn't? >> >> Is the squarewave centered on zero (so it goes positive >> and negative) or does it have zero as its floor? What >> is the magnitude (volts) of the signal? >> >> What's the period (or frequency) of the square wave? > > How square is it really? I.E. what's the bandwidth? > Are there other signals at the same time?
Is the duty cycle 50%? If yes, with what tolerance? Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
On Nov 3, 1:42 pm, "Greg Neill" <gneill...@OVEsympatico.ca> wrote:
> "pinku" <praveenkumar...@gmail.com> wrote in message > > news:1194110521.868836.186370@k35g2000prh.googlegroups.com... > > > Hi, > > I need to detect a presence of square wave. If square wave is there I > > need to generate a logic 0 and this square wave is not present I need > > to generate logic 1 or vise versa. Can you suggest me a circuit for > > this functionality. > > Does your signal line have only a square wave on it, > or are there other things present when the square > wave isn't?
the question i would have is: detect the presence of the square wave against what other alternative? silence or noise?
> Is the squarewave centered on zero (so it goes positive > and negative) or does it have zero as its floor?
we probably won't know that; no common timebase...
> What is the magnitude (volts) of the signal?
that's an issue of setting a threshold.
> What's the period (or frequency) of the square wave?
but we should know that. if we do, i would say to cross-correlate with, say, two different square waves of the known (or trial) frequency that have fundamental 90 degrees apart. if we *did* have a common timebase and could do synchronous detection, it would be just a single square wave to cross-correlate with. hmmm... maybe a matched filter implemented as an FIR with a stretch of square wave as its impulse response. that might work for either synchronous or async. r b-j
robert bristow-johnson wrote:

> On Nov 3, 1:42 pm, "Greg Neill" <gneill...@OVEsympatico.ca> wrote: > >>"pinku" <praveenkumar...@gmail.com> wrote in message >> >>news:1194110521.868836.186370@k35g2000prh.googlegroups.com... >> >> >>>Hi, >>>I need to detect a presence of square wave. If square wave is there I >>>need to generate a logic 0 and this square wave is not present I need >>>to generate logic 1 or vise versa. Can you suggest me a circuit for >>>this functionality. >>
<snip>
> > if we *did* have a common timebase and could do synchronous detection, > it would be just a single square wave to cross-correlate with. > hmmm... maybe a matched filter implemented as an FIR with a stretch > of square wave as its impulse response. that might work for either > synchronous or async. >
FWIW, many, many years ago I built an intrusion alarm with a superregen receiver that listened for a homemade keyfob's signal; the rcvr quieted in the presence of the carrier, noise power dropped and the superregeneration frequency spectrum narrowed; filtering as per your suggestion above worked well and the system was quite robust. Regards, Michael