PDA

View Full Version : Burst tone detection of unknown frequency


Jay Fenton
06-19-2007, 01:47 PM
Hi,

I've been trying to find the most optimal algorithm to detect a
sustained burst of
tone at an unknown (but higher than speech) frequency in realtime, for
use in
voicemail detection (think long beep). I don't have much experience in
the signal
processing realms, and would appreciate any appropriate pointers.

Am I right in thinking that Goertzel is only suited to the detection
of a known
frequency, and not a range? What's the most performant way of doing
this?

Thanks in advance.

--
Regards,

Jay Fenton

John Sampson
06-19-2007, 03:29 PM
The best way to handle this is to listen on the line before actually
dialing, and apply the following routine, which I provide free of charge
for unrestricted use:

bVoicemailDetected = TRUE;
if(bVoicemailDetected == FALSE)
Dial();

John

Jay Fenton wrote:
> Hi,
>
> I've been trying to find the most optimal algorithm to detect a
> sustained burst of
> tone at an unknown (but higher than speech) frequency in realtime, for
> use in
> voicemail detection (think long beep). I don't have much experience in
> the signal
> processing realms, and would appreciate any appropriate pointers.
>
> Am I right in thinking that Goertzel is only suited to the detection
> of a known
> frequency, and not a range? What's the most performant way of doing
> this?
>
> Thanks in advance.
>
> --
> Regards,
>
> Jay Fenton
>

fizteh89
06-19-2007, 03:34 PM
On Jun 19, 8:47 am, Jay Fenton <[email protected]> wrote:
> Hi,
>
> I've been trying to find the most optimal algorithm to detect a
> sustained burst of
> tone at an unknown (but higher than speech) frequency in realtime, for
> use in
> voicemail detection (think long beep). I don't have much experience in
> the signal
> processing realms, and would appreciate any appropriate pointers.
>

US Patent 7124075

http://www.google.com/patents?id=dB97AAAAEBAJ

> Thanks in advance.

You are very welcome

Jerry Avins
06-19-2007, 03:38 PM
Jay Fenton wrote:
> Hi,
>
> I've been trying to find the most optimal algorithm to detect a
> sustained burst of
> tone at an unknown (but higher than speech) frequency in realtime, for
> use in
> voicemail detection (think long beep). I don't have much experience in
> the signal
> processing realms, and would appreciate any appropriate pointers.
>
> Am I right in thinking that Goertzel is only suited to the detection
> of a known
> frequency, and not a range? What's the most performant way of doing
> this?
>
> Thanks in advance.

You do know something about the frequency. It is higher than audio and
within the passband of your channel. You seem to say that it is of
constant frequency ans therefore only its presence is informative. Would
a bandpass filter do?

Jerry
--
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

Vladimir Vassilevsky
06-19-2007, 03:44 PM
Jay Fenton wrote:

> Hi,
>
> I've been trying to find the most optimal algorithm to detect a
> sustained burst of
> tone at an unknown (but higher than speech) frequency in realtime, for

There are two kinds of the most optimal algorithms:

1. Do it yourself
2. Hire somebody else

When you will be bored with method#1, give me a call.


Vladimir Vassilevsky

DSP and Mixed Signal Design Consultant

http://www.abvolt.com

06-19-2007, 03:47 PM
On Jun 19, 8:47 am, Jay Fenton <[email protected]> wrote:
> Hi,
>
> I've been trying to find the most optimal algorithm to detect a
> sustained burst of
> tone at an unknown (but higher than speech) frequency in realtime, for
> use in
> voicemail detection (think long beep). I don't have much experience in
> the signal
> processing realms, and would appreciate any appropriate pointers.
>
> Am I right in thinking that Goertzel is only suited to the detection
> of a known
> frequency, and not a range? What's the most performant way of doing
> this?
>
> Thanks in advance.
>
> --
> Regards,
>
> Jay Fenton

What information are you trying to get? Do you want to know the
frequency, or do you want to filter it out? If you want to suppress
it, you could use an adaptive notch filter; the LMS algorithm is
pretty simple. If you want to identify the frequency, it's a little
tougher. The Goertzel algorithm does search for specific frequencies,
which is why it's often used for DTMF detection. You could do an FFT
and search for peaks, but it's more computationally intensive. If the
range you want to search is small enough, you could use a highpass/
bandpass filter to pick out the region you want to search in, decimate
to get the signal back to baseband, then perform the FFT on the
decimated samples. This will take fewer computations, but you would
need to do some math to figure out what frequency the peaks initially
corresponded to.

Jason

Ron N.
06-19-2007, 07:44 PM
On Jun 19, 5:47 am, Jay Fenton <[email protected]> wrote:
> I've been trying to find the most optimal algorithm to detect a
> sustained burst of
> tone at an unknown (but higher than speech) frequency in realtime, for
> use in
> voicemail detection (think long beep). I don't have much experience in
> the signal
> processing realms, and would appreciate any appropriate pointers.

Laughing. I used to answer my phone, saying something like:
"Hi, I'm actually home, you can talk to me instead of leaving a
message, BeeeeeeP! "; and hear the automated calling machines
hang up if I vocalized a clean enough beep tone.


IMHO. YMMV.
--
rhn A.T nicholson d.0.t C-o-M

Jay Fenton
06-19-2007, 09:48 PM
> What information are you trying to get? Do you want to know the
> frequency, or do you want to filter it out?

I want to know the frequency, but only for the purpose of tracking
the tones duration (and even then, it doesn't need to be with a
high degree of accuracy).

> If the range you want to search is small enough, you could use a highpass/
> bandpass filter to pick out the region you want to search in, decimate
> to get the signal back to baseband, then perform the FFT on the
> decimated samples. This will take fewer computations, but you would
> need to do some math to figure out what frequency the peaks initially
> corresponded to.

Interesting, I'll look into that approach. Thanks for the help.

Jay Fenton
06-19-2007, 09:49 PM
On Jun 19, 7:44 pm, "Ron N." <[email protected]> wrote:
> On Jun 19, 5:47 am, Jay Fenton <[email protected]> wrote:
>
> > I've been trying to find the most optimal algorithm to detect a
> > sustained burst of
> > tone at an unknown (but higher than speech) frequency in realtime, for
> > use in
> > voicemail detection (think long beep). I don't have much experience in
> > the signal
> > processing realms, and would appreciate any appropriate pointers.
>
> Laughing. I used to answer my phone, saying something like:
> "Hi, I'm actually home, you can talk to me instead of leaving a
> message, BeeeeeeP! "; and hear the automated calling machines
> hang up if I vocalized a clean enough beep tone.

Ahh, is that why I got a cold response from some.. I swear there's
not an automated calling machine in sight :) We're just not that
obnoxious.

Jay Fenton
06-19-2007, 09:50 PM
> > processing realms, and would appreciate any appropriate pointers.
>
> US Patent 7124075
>
> http://www.google.com/patents?id=dB97AAAAEBAJ

Okay, slightly less optimal than the patented version ;)

Jay Fenton
06-19-2007, 09:54 PM
> You do know something about the frequency. It is higher than audio and
> within the passband of your channel. You seem to say that it is of
> constant frequency ans therefore only its presence is informative. Would
> a bandpass filter do?

I'd need to ensure the tone remained constant.. wouldn't the bandpass
just tell me that "in this sample, a tone was present somewhere
between
x and y".. but not give me a "bucket" that I can track like I would
with
an FFT?

Jerry Avins
06-19-2007, 10:55 PM
Ron N. wrote:

...

> Laughing. I used to answer my phone, saying something like:
> "Hi, I'm actually home, you can talk to me instead of leaving a
> message, BeeeeeeP! "; and hear the automated calling machines
> hang up if I vocalized a clean enough beep tone.

ROFL!

Jerry
--
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

Jerry Avins
06-19-2007, 11:11 PM
Jay Fenton wrote:
>> You do know something about the frequency. It is higher than audio and
>> within the passband of your channel. You seem to say that it is of
>> constant frequency ans therefore only its presence is informative. Would
>> a bandpass filter do?

Fenton didn't write that, I did.

> I'd need to ensure the tone remained constant.. wouldn't the bandpass
> just tell me that "in this sample, a tone was present somewhere
> between
> x and y".. but not give me a "bucket" that I can track like I would
> with
> an FFT?

Do you have enough memory to save the samples that the filter output
tells you are there, and enough time to do the occasional FFT when
enough samples have been accumulated? That might be easier than feting
all the time.

Jerry
--
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

Jerry Avins
06-19-2007, 11:14 PM
Jay Fenton wrote:
>> You do know something about the frequency. It is higher than audio and
>> within the passband of your channel. You seem to say that it is of
>> constant frequency ans therefore only its presence is informative. Would
>> a bandpass filter do?

Fenton didn't write that, I did. :-)

> I'd need to ensure the tone remained constant.. wouldn't the bandpass
> just tell me that "in this sample, a tone was present somewhere
> between
> x and y".. but not give me a "bucket" that I can track like I would
> with
> an FFT?

Do you have enough memory to save the samples that the filter output
tells you are there, and enough time to do the occasional FFT when
enough samples have been accumulated? That might be easier than FFTing
all the time.

Jerry
--
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

Steve Underwood
06-20-2007, 01:29 AM
Ron N. wrote:
> On Jun 19, 5:47 am, Jay Fenton <[email protected]> wrote:
>> I've been trying to find the most optimal algorithm to detect a
>> sustained burst of
>> tone at an unknown (but higher than speech) frequency in realtime, for
>> use in
>> voicemail detection (think long beep). I don't have much experience in
>> the signal
>> processing realms, and would appreciate any appropriate pointers.
>
> Laughing. I used to answer my phone, saying something like:
> "Hi, I'm actually home, you can talk to me instead of leaving a
> message, BeeeeeeP! "; and hear the automated calling machines
> hang up if I vocalized a clean enough beep tone.

Those machines don't generally listen for a tone. They use the heuristic
that a long initial burst of speech is likely to be an automated system,
and that a human answering will just say "hello" or their name. It
breaks down when they call companies. The telephonist will generally
give a longer announcement than a personal user, and the machines hang up.

Steve

John
06-20-2007, 02:57 AM
On Jun 19, 4:49 pm, Jay Fenton <[email protected]> wrote:
> On Jun 19, 7:44 pm, "Ron N." <[email protected]> wrote:
>
> > On Jun 19, 5:47 am, Jay Fenton <[email protected]> wrote:
>
> > > I've been trying to find the most optimal algorithm to detect a
> > > sustained burst of
> > > tone at an unknown (but higher than speech) frequency in realtime, for
> > > use in
> > > voicemail detection (think long beep). I don't have much experience in
> > > the signal
> > > processing realms, and would appreciate any appropriate pointers.
>
> > Laughing. I used to answer my phone, saying something like:
> > "Hi, I'm actually home, you can talk to me instead of leaving a
> > message, BeeeeeeP! "; and hear the automated calling machines
> > hang up if I vocalized a clean enough beep tone.
>
> Ahh, is that why I got a cold response from some.. I swear there's
> not an automated calling machine in sight :) We're just not that
> obnoxious.

A more serious response ... IMO an easy way to detect the presence
of the tone as well as its frequency is to use an FM discriminator
and
squelch circuit. First define a band of possible frequencies, Fc-W/2
to
Fc+W/2. Mix the input with exp(-j*2*pi*Fc*n/Fs) and then apply LPFs
with passband extending from 0 to W/2. You can decimate here too in
order to save cycles later. Compute the instantaneous frequency of
the complex LPF output z[n] as follows:

f[n] = Fs*angle(z[n]*conj(z[n-1]))/(2*pi)

(here Fs is the decimated sample rate).

Apply f[n] to an IIR HPF. Take the absolute value of the HPF output
and smooth the rectified noise with an IIR LPF. When no tone is
present, you get a "large" DC value. When the tone comes on, the
DC value plummets. Determine an empirical threshold to declare that
the tone is present, and choose a larger threshold to subsequently
declare that it went away.

When the tone is present, the Fc + average(f[n]) estimates the input
frequency.

This method is tried and true, but one gotcha is that the detector
requires some noise in the tone band.

John

glen herrmannsfeldt
06-20-2007, 03:56 AM
Ron N. wrote:

(snip)

> Laughing. I used to answer my phone, saying something like:
> "Hi, I'm actually home, you can talk to me instead of leaving a
> message, BeeeeeeP! "; and hear the automated calling machines
> hang up if I vocalized a clean enough beep tone.

I tried it the other way once, but it didn't work so well.
I put a message on the answering machine something like:

"Hello (pause) He isn't here right now, can I take a message?"

With the pause long enough to ask to talk to someone.

Then again, someone I used to know would answer the phone:
"AMTRAK fares and information, ask about our new low fares
to Europe."

-- glen