**Originally written on 2023-12-08**

**TL;DR - while it probably requires some tweaking the absolute integral of a signal and the absolute integral of a signal’s first derivative are an interesting way to determine if a signal is noise**

## The problem

I was looking for a way to detect white noise while working with RTL-SDR devices. To me, in the software defined radio world the notion of squelch feels dated. Of course, a simple threshold over signal strength can be useful in certain situations. But when you’re working with third-party signals (public safety, etc), and hardware that notoriously is challenging to configure (RTL-SDR gain) I wanted to find a more adaptive and intelligent way to deal with it so I don’t need to tweak and tune it constantly.

## A solution (not THE solution)

**Upfront I’ll say that this technique isn’t perfect. It isn’t the end-all be-all. It’s just a starting point.**

That said, the approach is deceptively simple mathematically. We compare the absolute integral of the signal to the absolute integral of the signal’s first derivative. The absolute integral of the first derivative of noise should be larger than the absolute integral of the signal itself if it is noise.

Let’s keep rewriting this in simpler terms:

- We compare
to the absolute integral of the signal’s first derivative**the absolute integral of the signal** - We compare the area under the absolute value of the signal to
**the absolute integral of the signal’s first derivative** - We compare the area under the absolute value of the signal to the area under the absolute value of the rate of change of the signal

## What does this look like visually?

### Noise

Here’s what some random noise along with it’s first derivative looks like:

The absolute integral of this signal is 66,733,413 while the absolute integral of its first derivative is 67,301,103. This fails our simple test since the second value is higher. This, to our simple algorithm, looks like noise.

### A very quiet signal

Here’s what a very quiet signal along with it’s first derivative looks like:

The absolute integral of this signal is 1,555. The absolute integral of it’s first derivative is 1,225. This, to our simple algorithm, this does not look like noise.

### A sine wave

Here’s what a sine wave, captured via RF so it’s not perfect, looks like:

The absolute integral of the signal is 18,060,405. The absolute integral of it’s first derivative is 5,005,653. Again, to our simple algorithm, this does not look like noise.

## Voice

Here’s what a voice, captured via RF so it’s not perfect, looks like:

The absolute integral of the signal is 5,782,929. The absolute integral of it’s first derivative is 1,798,319. Again, to our simple algorithm, this does not look like noise.