# Square wave detector - DSP

This is a discussion on Square wave detector - DSP ; 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 ...

1. ## Square wave detector

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.

Regards
Pinku

2. ## Re: Square wave detector

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.

3. ## Re: Square wave detector

"pinku" <praveenkumar.bm@gmail.com> wrote in message
> 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?

4. ## Re: Square wave detector

Greg Neill wrote:
>
> "pinku" <praveenkumar.bm@gmail.com> wrote in message
> > 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
-----------------------------------------------------------------------

5. ## Re: Square wave detector

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
>> > 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

6. ## Re: Square wave detector

Greg Neill wrote:
> "pinku" <praveenkumar.bm@gmail.com> wrote in message
>> 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.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

7. ## Re: Square wave detector

Jerry Avins wrote:
> Greg Neill wrote:
>> "pinku" <praveenkumar.bm@gmail.com> wrote in message
>>> 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.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

8. ## Re: Square wave detector

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.
>
>
>Regards
>Pinku

I smell a differentiator somewhere in that circuit.

D from BC

9. ## Re: Square wave detector

On Nov 3, 1:42 pm, "Greg Neill" <gneill...@OVEsympatico.ca> wrote:
> "pinku" <praveenkumar...@gmail.com> wrote in message
>
>
> > 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

10. ## Re: Square wave detector

robert bristow-johnson wrote:

> On Nov 3, 1:42 pm, "Greg Neill" <gneill...@OVEsympatico.ca> wrote:
>
>>"pinku" <praveenkumar...@gmail.com> wrote in message
>>
>>
>>
>>>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