Hi, I am detecting a 4 KHz acoustic signal in the presence of noise at a sampling rate of 44.1 KHz. Since I'm synchronizing with the start of the signal I have to detect the frequency as soon as I receive it which means I'll have to take a decision about the presence or absence of the signal on the basis of a very few samples. I'm using Goertzel(a kind of DFT) for this purpose and it is pretty accurate. But since I have to take a decision based on a small number of samples my frequency resolution is low - about 1000 Hz which means anything between 3500 and 4500Hz will be a source of error for me. Is there a filtering algorithm that I can use before the DFT filter which removes all frequencies except between say 3.9 KhZ and 4.1 Khz.I am applying the Goertzel on data sent to the sound card by the microphone which are nothing but the samples at discrete points. I want to use the bandpass filter on this data first and then give the resulting data to Goertzel.But the resulting data should also be in the same format - meaning if I was using the bandpass filter on say 2000 sound samples then the output should give me the same 2000 samples but with the noise removed(so that I can apply Goertzel on exactly 2000 samples). What bandpass filtering methods can I use for my purpose ? Thanks and Regards, Atri.
Cancelling noise in acoustic signals
Started by ●March 12, 2004
Reply by ●March 12, 20042004-03-12
Hi Atri, "Atri Mandal" <mandala@ics.uci.edu> wrote in message news:40524AD1.D395A5C8@ics.uci.edu...> [...] I have to detect the frequency as soon as I receive it [...] > Is there a filtering algorithm that I can use before the DFT filter > which removes all frequencies except between say 3.9 KhZ and 4.1 Khz? >[...]You are out of luck, I'm afraid. Any such filter would add a delay to the signal, leaving your Goertzel implementation with even fewer samples to work with. For detecting a single frequency in white additive noise, a Goertzel filter is about the best you can do. On the other hand, if you're worried about the frequency resolution of the detector, then maybe you're worrying about noise that isn't white. If you can characterize the noise more accurately, then you can design better detector.
Reply by ●March 13, 20042004-03-13
Hi Matt, I'm mainly concerned with the possibility of noise due to cell phone rings which have frequencies in this range esp. the ones with polymorphic ringtones. So is there a way I can narrow down the range a bit using additive filters... Even if after using this filter Goertzel has to work with fewer samples it might still give better results because with the filter I have already eliminated all noise from my signal...so whatever Goertzel detects must be our signal. I'm not concerned with failing to detect the frequency but with Goertzel listening to some other sound and thinking it was our frequency.How big is the delay anyway ? Do you have any other suggestions ? Atri. "Matt Timmermans" <mt0000@sympatico.nospam-remove.ca> wrote in message news:jeu4c.31624$hG.422763@news20.bellglobal.com...> Hi Atri, > > "Atri Mandal" <mandala@ics.uci.edu> wrote in message > news:40524AD1.D395A5C8@ics.uci.edu... > > [...] I have to detect the frequency as soon as I receive it [...] > > Is there a filtering algorithm that I can use before the DFT filter > > which removes all frequencies except between say 3.9 KhZ and 4.1 Khz? > >[...] > > You are out of luck, I'm afraid. Any such filter would add a delay to the > signal, leaving your Goertzel implementation with even fewer samples towork> with. > > For detecting a single frequency in white additive noise, a Goertzelfilter> is about the best you can do. > > On the other hand, if you're worried about the frequency resolution of the > detector, then maybe you're worrying about noise that isn't white. If you > can characterize the noise more accurately, then you can design better > detector. > >
Reply by ●March 13, 20042004-03-13
Don't forget about the time vs. frequency resolution trade-off. In general, the narrower the frequency band you want to detect, the wider in time the analysis window has to be, for either the Goertzel or any prefilter. If the signal you want to reject has some known characteristic (a strong subcarrier or 3rd harmonic, or something), you can look for that simultaneously and use that information for your detect decision. ------ In article <c2u1d2$qv8$1@news.service.uci.edu>, Atri Mandal <mandala@ics.uci.edu> wrote:>Hi Matt, >I'm mainly concerned with the possibility of noise due to cell phone rings >which have frequencies in this range esp. the ones with polymorphic >ringtones. >So is there a way I can narrow down the range a bit using additive >filters... >Even if after using this filter Goertzel has to work with fewer samples it >might still give better results because with the filter I have already >eliminated all noise from my signal...so whatever Goertzel detects must be >our signal. I'm not concerned with failing to detect the frequency but with >Goertzel listening to some other sound and thinking it was our frequency.How >big is the delay anyway ? > >Do you have any other suggestions ? > >Atri. >"Matt Timmermans" <mt0000@sympatico.nospam-remove.ca> wrote in message >news:jeu4c.31624$hG.422763@news20.bellglobal.com... >> Hi Atri, >> >> "Atri Mandal" <mandala@ics.uci.edu> wrote in message >> news:40524AD1.D395A5C8@ics.uci.edu... >> > [...] I have to detect the frequency as soon as I receive it [...] >> > Is there a filtering algorithm that I can use before the DFT filter >> > which removes all frequencies except between say 3.9 KhZ and 4.1 Khz? >> >[...] >> >> You are out of luck, I'm afraid. Any such filter would add a delay to the >> signal, leaving your Goertzel implementation with even fewer samples to >work >> with. >> >> For detecting a single frequency in white additive noise, a Goertzel >filter >> is about the best you can do. >> >> On the other hand, if you're worried about the frequency resolution of the >> detector, then maybe you're worrying about noise that isn't white. If you >> can characterize the noise more accurately, then you can design better >> detector.IMHO. YMMV. -- Ron Nicholson rhn AT nicholson DOT com http://www.nicholson.com/rhn/ #include <canonical.disclaimer> // only my own opinions, etc.
Reply by ●March 14, 20042004-03-14
Me wrote:> Depending on the application details: > > Split the signal into 2 paths- > 1 into a delay line, the output of which goes to the "normal" destination. > 2 into your tone detector. > > By making the delay line delay (?) equal to your tone detection delay, you > can then take the desired action on the delay line output (e.g. tone > suppression). We fake immediacy. > > This all rests on the assumption that you can tolerate several (tens?) of > milliseconds extra absolute delay. This should not be a problem as > packetized sysems already exhibit such delays. > > Jim AdamthwaiteYour technique reminds me of the synch circuit in my old Tektronix scopes. The signal runs through a delay line to the vertical deflection amplifier but directly to the threshold detector. That lets me see the rising edge of the pulse I synch on. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Reply by ●March 14, 20042004-03-14
Depending on the application details: Split the signal into 2 paths- 1 into a delay line, the output of which goes to the "normal" destination. 2 into your tone detector. By making the delay line delay (?) equal to your tone detection delay, you can then take the desired action on the delay line output (e.g. tone suppression). We fake immediacy. This all rests on the assumption that you can tolerate several (tens?) of milliseconds extra absolute delay. This should not be a problem as packetized sysems already exhibit such delays. Jim Adamthwaite
Reply by ●March 15, 20042004-03-15
"Atri Mandal" <mandala@ics.uci.edu> wrote in message news:c2u1d2$qv8$1@news.service.uci.edu...> > Do you have any other suggestions ?I think it will be hard to make your detector reliable. Instead of just detecting 4 KHz tones, which aren't that uncommon, I would try detecting the onset of a 4 KHz tone, like this: - Maintain a cicrular buffer of 4000 input samples. - At each time step, measure total energy (Ecur) and the energy at 4KHz (Scur) in the last 2000 samples. You can use a Goertzel filter ot measure Etone. - At each time step, also measure total energy (Eprev) and the energy at 4KHz (Sprev) in the previous 2000 samples. - Calculate the strength of the detected signal onset: S=Scur-Sprev - Calculate the amount of residual noise onset: N = Ecur-(Eprev+S) You would then register a detection whenever S, S/N, and S/Ecur are all above given thesholds. The S/N threshold is critical. Hopefully, subtracting the steady-state noise to detect only fast-attack signals will let you set this threshold high enough to reject everything that has any significant content outside of a narrow band around 4 KHz, and that should include polyphonic ring tones. Unfortunately, you may fail to detect your 4KHz signal if it starts when a polyphonic ring tone is playing.