Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Detecting the presence of a signal?

Not open for further replies.


Member level 4
Mar 16, 2017
Reaction score
Trophy points
Activity points
I have a possibly beginner's question.
ADC I sample the signal, using digital filters I select one frequency from it.
For example, I have 128 signal samples and I need to decide whether there is a signal in this section or not.
Maybe RMS
XRMS=Sqert( (x1^2+x2^2+x3^2+xn^2)/n)

but maybe it's even easier somehow
simpler, I mean with faster math than 128 square rooting and addition

Or can you recommend a book that doesn't deal so much with theory, but with practical examples of digital signal processing?


please define what you mean with "signal".
And please define how you decide whether it´s present or not.

A signal can be anything (usually anything but noise)
But your RMS calculation also includes noise.

Does your "signal" have any dedicated frequency and/or waveform. Or is it something like "dual frequency" (DTMF).
.. or digital data...or a carrier (for AM, FM...)

You tell you use digital filters to select one frequency. Is it a single frequency you are after?
Maybe a DFT or an FFT (frequency analysis) is what you are looking for.

But still they need to take every single sample into calculation.

If you are looking for one single (sine) frequency. Then after your filter you should have sine. Thus there is a fixed relation between RMS and peak or peak_to_peak.
A sine with 1V amplitude
* has a peak of 1V
* has a peak to peak of 2V
* has an RMS of 0.707V
So maybe it´s easier to look for peaks instead of doing ful RMS math.

Please give more detailed informations.


Goertzel method of tone detection :

Regards, Dana.

please define what you mean with "signal".
And please define how you decide whether it´s present or not.
Sorry i forgot about that.
the signal is a sine wave
if the maximum of the signal is -1 +1, then the minimum is -0.2 +0.2 (anything below 0.2 is noise)
at the same time, the signal should be detected as True if it is present in at least half of the processed sample.

Are trying to say : 'A signal detection is true if there is a sinewave with an amplitude greater than 0.2 for half the sample time'?

Can it be any frequency, or a specific frequency?

Maybe you can just do an FFT of the signal.

According to the given information, rms calculation is the simplest way. By the way, you calculate square root once, not 128 times.
--- Updated ---

Less effort, not sure if it fulfills your requirements, calculate average rectified value, (sum abs(x))/n.


squaring is rater simple compared to squareroot.
You may optimize a lot.

Usually you have to
* square 128 values
* add 128 values
* divide by 128
* take the root
Compare with threshold

But you may do instead:
* calculate the new thresbold at compile time to: threshold^2 × 128

The during run time you just need to:
* square 128 values
* add the values up
... no divide by 128
.... no sqare root
* compare with new threshold


Not open for further replies.

Part and Inventory Search

Welcome to