White noise detection?
2012-06-24 by enkitec@gmail.com
Yahoo Groups archive
Index last updated: 2026-04-28 22:41 UTC
Thread
2012-06-24 by enkitec@gmail.com
Hi,
I want to build a FM radio squelch using an ATMEGA8.
The ADC will be sampling the FM radio audio output and turn on a
LED when there is only noise present. The LED will be off when someone
is using the channel (no noise, just voice).
What is the best way of doing this in software?
Thanks for any idea.
Mark Jordan2012-06-24 by bobgardner@aol.com
White noise has all frequencies and a freq resp that rises at 3db per octave. So I'd try a one octave filter at 80Hz and a one octave filter at 10KHz which is 7 octaves higher and check and see if the hi freq is 21db above the lo freq. Music usually rolls off at the higher frequencies.
-----Original Message-----
From: enkitec <enkitec@gmail.com>
To: AVR-Chat <AVR-Chat@yahoogroups.com>
Sent: Sun, Jun 24, 2012 1:19 pm
Subject: [AVR-Chat] White noise detection?
Hi,
I want to build a FM radio squelch using an ATMEGA8.
The ADC will be sampling the FM radio audio output and turn on a
ED when there is only noise present. The LED will be off when someone
s using the channel (no noise, just voice).
What is the best way of doing this in software?
Thanks for any idea.
Mark Jordan
-----------------------------------
Yahoo! Groups Links
Individual Email | Traditional
http://docs.yahoo.com/info/terms/
[Non-text portions of this message have been removed]2012-06-24 by Jim Wagner
Motorola 2Way radios used this for years. It was called "noise squelch" or something like that. You have a high pass filter that cuts off above the top of the voice spectrum. Amplify and rectify the filter output. You will have a rectified output only when there is nothing to hear on the channel. Jim On Jun 24, 2012, at 10:19 AM, enkitec@gmail.com wrote: > Hi, > > I want to build a FM radio squelch using an ATMEGA8. > The ADC will be sampling the FM radio audio output and turn on a > LED when there is only noise present. The LED will be off when someone > is using the channel (no noise, just voice). > > What is the best way of doing this in software? > > Thanks for any idea. > Mark Jordan > > [Non-text portions of this message have been removed]
2012-06-24 by enkitec@gmail.com
This is exactly what I need, but how to do it in software?
A high pass FIR or IIR filter?
MarkOn 24-Jun-12 17:42, Jim Wagner wrote: > Motorola 2Way radios used this for years. It was called "noise squelch" or something like that. You have a high pass filter that cuts off above the top of the voice spectrum. Amplify and rectify the filter output. You will have a rectified output only when there is nothing to hear on the channel. > > Jim > On Jun 24, 2012, at 10:19 AM, enkitec@gmail.com wrote: > >> Hi, >> >> I want to build a FM radio squelch using an ATMEGA8. >> The ADC will be sampling the FM radio audio output and turn on a >> LED when there is only noise present. The LED will be off when someone >> is using the channel (no noise, just voice). >> >> What is the best way of doing this in software? >> >> Thanks for any idea. >> Mark Jordan >> >> > > > [Non-text portions of this message have been removed] > > > > ------------------------------------ > > Yahoo! Groups Links > > > >
2012-06-24 by Jim Wagner
Traditionally, it is done with an RC filter and a diode detector. If the amplitude is high enough (say, a couple of volts peak-peak), no amplification may be needed. Commonly, an analog comparator is used to look at the rectifier output. The comparator reference is adjustable to provide a "squelch adjustment". In software, you would need to sample pretty fast (maybe 20KHz, maybe higher). Some kind of filter would be needed. Choose what ever is easy to implement. The rectifier can be implemented with a peak detector having decay. Personally, I would choose the analog route, just because I know how to design, analyze, and diagnose things there. Jim On Jun 24, 2012, at 3:27 PM, enkitec@gmail.com wrote: > > This is exactly what I need, but how to do it in software? > A high pass FIR or IIR filter? > > Mark > > On 24-Jun-12 17:42, Jim Wagner wrote: > > Motorola 2Way radios used this for years. It was called "noise squelch" or something like that. You have a high pass filter that cuts off above the top of the voice spectrum. Amplify and rectify the filter output. You will have a rectified output only when there is nothing to hear on the channel. > > > > Jim > > On Jun 24, 2012, at 10:19 AM, enkitec@gmail.com wrote: > > > >> Hi, > >> > >> I want to build a FM radio squelch using an ATMEGA8. > >> The ADC will be sampling the FM radio audio output and turn on a > >> LED when there is only noise present. The LED will be off when someone > >> is using the channel (no noise, just voice). > >> > >> What is the best way of doing this in software? > >> > >> Thanks for any idea. > >> Mark Jordan > >> > >> > > > > > > [Non-text portions of this message have been removed] > > > > > > > > ------------------------------------ > > > > Yahoo! Groups Links > > > > > > > > > > [Non-text portions of this message have been removed]
2012-06-25 by Jim Wagner
An additional note - You are going to have to add a bias network and coupling cap at the ADC input, since the ADC can only handle positive voltages. Jim
On Jun 24, 2012, at 4:50 PM, Jim Wagner wrote: > Traditionally, it is done with an RC filter and a diode detector. If the amplitude is high enough (say, a couple of volts peak-peak), no amplification may be needed. Commonly, an analog comparator is used to look at the rectifier output. The comparator reference is adjustable to provide a "squelch adjustment". > > In software, you would need to sample pretty fast (maybe 20KHz, maybe higher). Some kind of filter would be needed. Choose what ever is easy to implement. The rectifier can be implemented with a peak detector having decay. Personally, I would choose the analog route, just because I know how to design, analyze, and diagnose things there. > > Jim > > On Jun 24, 2012, at 3:27 PM, enkitec@gmail.com wrote: > >> >> This is exactly what I need, but how to do it in software? >> A high pass FIR or IIR filter? >> >> Mark >> >> On 24-Jun-12 17:42, Jim Wagner wrote: >>> Motorola 2Way radios used this for years. It was called "noise squelch" or something like that. You have a high pass filter that cuts off above the top of the voice spectrum. Amplify and rectify the filter output. You will have a rectified output only when there is nothing to hear on the channel. >>> >>> Jim >>> On Jun 24, 2012, at 10:19 AM, enkitec@gmail.com wrote: >>> >>>> Hi, >>>> >>>> I want to build a FM radio squelch using an ATMEGA8. >>>> The ADC will be sampling the FM radio audio output and turn on a >>>> LED when there is only noise present. The LED will be off when someone >>>> is using the channel (no noise, just voice). >>>> >>>> What is the best way of doing this in software? >>>> >>>> Thanks for any idea. >>>> Mark Jordan >>>> >>>> >>> >>> >>> [Non-text portions of this message have been removed] >>> >>> >>> >>> ------------------------------------ >>> >>> Yahoo! Groups Links >>> >>> >>> >>> >> >> > > > > [Non-text portions of this message have been removed] > > > > ------------------------------------ > > Yahoo! Groups Links > > >
2012-06-25 by enkitec@gmail.com
Yo are right. The analog way it will be.
MarkOn 24-Jun-12 20:50, Jim Wagner wrote: > Traditionally, it is done with an RC filter and a diode detector. If the amplitude is high enough (say, a couple of volts peak-peak), no amplification may be needed. Commonly, an analog comparator is used to look at the rectifier output. The comparator reference is adjustable to provide a "squelch adjustment". > > In software, you would need to sample pretty fast (maybe 20KHz, maybe higher). Some kind of filter would be needed. Choose what ever is easy to implement. The rectifier can be implemented with a peak detector having decay. Personally, I would choose the analog route, just because I know how to design, analyze, and diagnose things there. > > Jim > > On Jun 24, 2012, at 3:27 PM, enkitec@gmail.com wrote: > >> This is exactly what I need, but how to do it in software? >> A high pass FIR or IIR filter? >> >> Mark >> >> On 24-Jun-12 17:42, Jim Wagner wrote: >>> Motorola 2Way radios used this for years. It was called "noise squelch" or something like that. You have a high pass filter that cuts off above the top of the voice spectrum. Amplify and rectify the filter output. You will have a rectified output only when there is nothing to hear on the channel. >>> >>> Jim >>> On Jun 24, 2012, at 10:19 AM, enkitec@gmail.com wrote: >>> >>>> Hi, >>>> >>>> I want to build a FM radio squelch using an ATMEGA8. >>>> The ADC will be sampling the FM radio audio output and turn on a >>>> LED when there is only noise present. The LED will be off when someone >>>> is using the channel (no noise, just voice). >>>> >>>> What is the best way of doing this in software? >>>> >>>> Thanks for any idea. >>>> Mark Jordan >>>> >>>> >>> >>> [Non-text portions of this message have been removed] >>> >>> >>> >>> ------------------------------------ >>> >>> Yahoo! Groups Links >>> >>> >>> >>> >> > > > [Non-text portions of this message have been removed] > > > > ------------------------------------ > > Yahoo! Groups Links > > > >
2012-06-25 by bayramdavies
enkitec@... wrote: > I want to build a FM radio squelch using an ATMEGA8. > The ADC will be sampling the FM radio audio output > ... What is the best way of doing this in software? Mark, you don't need to do this with analog hardware unless the microcontroller has other time-critical stuff to do. Sample the audio with the A-to-D as you already said, pass the samples through filters to separate high and low bands, compute the filter output magnitudes, smooth them and watch their levels over time. Others have advised you on the filters. Personally, I would put the corner frequencies at about 250 Hz and 1000 Hz to start with and just see what I get. A big advantage of using digital filters is that they are so easy to change! I would use second-order IIR filters. FIR filters take more computation for any given cut-off rate and you don't need their linear phase response. There are plenty of filter design tools on the Web. Does this answer your question? Graham.
2012-06-29 by enkitec@gmail.com
On 25-Jun-12 16:36, bayramdavies wrote:
> enkitec@... wrote:
>
>> I want to build a FM radio squelch using an ATMEGA8.
>> The ADC will be sampling the FM radio audio output
>> ... What is the best way of doing this in software?
> Mark, you don't need to do this with analog hardware unless the microcontroller has other time-critical stuff to do. Sample the audio with the A-to-D as you already said, pass the samples through filters to separate high and low bands, compute the filter output magnitudes, smooth them and watch their levels over time.
>
> Others have advised you on the filters. Personally, I would put the corner frequencies at about 250 Hz and 1000 Hz to start with and just see what I get. A big advantage of using digital filters is that they are so easy to change! I would use second-order IIR filters. FIR filters take more computation for any given cut-off rate and you don't need their linear phase response. There are plenty of filter design tools on the Web.
>
> Does this answer your question?
>
> Graham.
>
I have used the low-pass filter described below, but I'm not sure
on how to make it a high-pass:
----------------------------
A single pole (first order) high pass is pretty easy.
The basic building block for a lot of simple filters is a single pole
low pass:
FILT <--- FILT + FF(NEW - FILT)
This algorithm is performed once for each new input sample.
NEW is the new input value for that iteration and FILT is the filtered
output value.
FF is something I call the filter fraction. It adjusts how "heavy" the
filter is.
FF = 0 is infinitely heavy since the filter output never changes.
FF = 1 just passes the input directly to the output without any
filtering applied.
Obviously useful values are in between.
On some hardware it can be useful to make FF = 2**-N so that the
multiply by FF becomes just a right shift by N bits.
You can make a high pass filter by subtracting the low pass filtered
signal from the original.
----------------------------
Does it mean that (NEW - FILT) is the high-pass filter output?
Thanks.
Mark Jordan2012-06-30 by bayramdavies
enkitec@... wrote: > I have used the low-pass filter described > below, but I'm not sure on how to make it > a high-pass: ... > FILT <--- FILT + FF(NEW - FILT) > ... Does it mean that (NEW - FILT) is the > high-pass filter output? Mark, So, your question actually appears to be "how do I design digital filters?". You'll generally get your answer quicker if you ask your question clearly, rather than "I'm trying ..., how do I do that?" I recommend these on-line filter design tools: http://www-users.cs.york.ac.uk/~fisher/mkfilter/ For your application, first select Butterworth / Bessel / Chebyshev. In section 1, leave the selection at Butterworth if you don't know what the options mean. Select Lowpass or Highpass as appropriate. Ignore section 2. In section 3, enter the filter order. You are presently messing about with first order, so enter 1, but you should also find second order approachable and I would suggest you use that so enter 2. In section 4, enter the A-to-D sampling rate. In section 5, enter the desired cut-off frequency as Corner frequency 1. Ignore Corner frequency 2. Ignore sections 6, 7 and 8. Click the Submit Query button. You get a filter design complete with frequency plot and C code. But, the code uses floating point, so just scale everything for integer arithmetic. Use 16 bit unless you have a high sample rate as when scaling for just 8 bits it can be tricky to balance numerical accuracy with freedom from overflow. I find that the easiest way to test a filter and also to make sure that I understand the algorithm, is with a spreadsheet. Graham.