Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: White noise detection?

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 Jordan

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.