Forums

Signal Matching

Started by amcneilly August 16, 2009
I am new to DSP and i have the following problem

I need to detect a 20khz pulse for a sonic ranging application using a
PC. I can detect reasonably well the 20khz signal by measuring the RMS
of the signal from the microphone then filtering the input using a
high pass filter or goertzel calculation and take a RMS calculation of
the filtered signal. If the RMS is over a threshold value then the
signal has been detected.

The problem is that i cannot get a decent resolution. If i process the
signal in >= 64 samples chunks my signal detection works but i require
11 samples resolution and this results in poor accuracy.

Does anyone have any advice on a detection algorithm that would work
on ~11 sample chunks?

amcneilly wrote:
> I am new to DSP and i have the following problem
Yea. You have been languishing from this problem for at least two months, making everybody sick of your clueless bleat. You've been already advised no less then a thousand of methods of how to do that.
> I need to detect a 20khz pulse for a sonic ranging application using a > PC. I can detect reasonably well the 20khz signal by measuring the RMS > of the signal from the microphone then filtering the input using a > high pass filter or goertzel calculation and take a RMS calculation of > the filtered signal. If the RMS is over a threshold value then the > signal has been detected. > > The problem is that i cannot get a decent resolution.
Of course you can not. IIRC you are sampling at 44.1kHz, and 20kHz is pretty close to Nyquist. The wave packet will be distorted, and the measurement is going to be inaccurate unless the band edge effect is accounted for.
> If i process the > signal in >= 64 samples chunks my signal detection works but i require > 11 samples resolution and this results in poor accuracy. > > Does anyone have any advice on a detection algorithm that would work > on ~11 sample chunks?
In the addition to 1000 of the good advices that you got already, here is the advice #1001 for you: 1. Record the signal at the known distance for using it as an etalon. 2. Oversample this etalon by the factor ~ 4 or so. 3. Oversample the received signal by the same factor. 4. Correllate the received oversampled signal to the etalon. Find maximum. 5. Enjoy. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
Vladimir Vassilevsky <nospam@nowhere.com> writes:

> 1. Record the signal at the known distance for using it as an etalon.
Hey Vlad, "etalon" is not in my dictionary - what is it? -- Randy Yates % "...the answer lies within your soul Digital Signal Labs % 'cause no one knows which side mailto://yates@ieee.org % the coin will fall." http://www.digitalsignallabs.com % 'Big Wheels', *Out of the Blue*, ELO

Randy Yates wrote:

> Vladimir Vassilevsky <nospam@nowhere.com> writes: > > >>1. Record the signal at the known distance for using it as an etalon. > > > Hey Vlad, "etalon" is not in my dictionary - what is it?
This is not the ethanol :-) Etalon (latin) = standard, norm, gauge, reference. VLV
On 16 Aug, 18:00, Vladimir Vassilevsky <nos...@nowhere.com> wrote:

> > Etalon (latin) = standard, norm, gauge, reference. >
This is what I got when I searched Youtube for "Etalon": http://www.youtube.com/watch?v=XhknNPsVvGg ;-)
Peter K. wrote:
> On 16 Aug, 18:00, Vladimir Vassilevsky <nos...@nowhere.com> wrote: > >> Etalon (latin) = standard, norm, gauge, reference. >> >
More French than Latin, it seems:
> This is what I got when I searched Youtube for "Etalon": > http://www.youtube.com/watch?v=XhknNPsVvGg > > ;-) >
Curiously apposite in the end; We might start here http://encyclopedia.thefreedictionary.com/etalon go on to here, http://encarta.msn.com/dictionary_1861609247/etalon.html And then find a Basque proverb: "L'&#2013265929;talon ne sent pas les coups de pieds de la jument" = "The stallion does not feel the kicks of the mare" Which is quite funny - a word connoting a "standard" (of measurement) that is impressively insensitive! Richard Dobson
Jmcneilly wrote:
> I am new to DSP and i have the following problem > > I need to detect a 20khz pulse for a sonic ranging application using a > PC. I can detect reasonably well the 20khz signal by measuring the RMS > of the signal from the microphone then filtering the input using a > high pass filter or goertzel calculation and take a RMS calculation of > the filtered signal. If the RMS is over a threshold value then the > signal has been detected. > > The problem is that i cannot get a decent resolution. If i process the > signal in >= 64 samples chunks my signal detection works but i require > 11 samples resolution and this results in poor accuracy. > > Does anyone have any advice on a detection algorithm that would work > on ~11 sample chunks?
As far as I know, you still haven't told us the sampling frequency. Since your tone is at 20 KHz and you use a sound card, I assume it to be 44.1 KHz. 11 samples cover about 2.5 ms. or about 5 cycles. Detecting that reliably is a very tall order. Why did you start a new thread? Perhaps you didn't like the answers you were getting in the old one? Jerry -- Engineering is the art of making what you want from things you can get. &#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;
Randy Yates wrote:
> Vladimir Vassilevsky <nospam@nowhere.com> writes: > >> 1. Record the signal at the known distance for using it as an etalon. > > Hey Vlad, "etalon" is not in my dictionary - what is it?
Search for etalon in http://science.jrank.org/pages/3633/Interferometry.html Jerry -- Engineering is the art of making what you want from things you can get. &#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;
On Aug 16, 5:43&#2013266080;pm, Randy Yates <ya...@ieee.org> wrote:
> Vladimir Vassilevsky <nos...@nowhere.com> writes: > > 1. Record the signal at the known distance for using it as an etalon. > > Hey Vlad, "etalon" is not in my dictionary - what is it? > -- > Randy Yates &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080;% "...the answer lies within your soul > Digital Signal Labs &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080;% &#2013266080; &#2013266080; &#2013266080; 'cause no one knows which side > mailto://ya...@ieee.org &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080;% &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080; the coin will fall."http://www.digitalsignallabs.com% &#2013266080;'Big Wheels', *Out of the Blue*, ELO
Hello Randy, Vlad gave a use with which I was not familiar. It is commonly used in reference to lasers. Recall a common design for a laser is a resonant (Fabry-Perot) cavity formed by two reflectors with an amplyfing medium in between the two reflectors. With some types of lasers the lasing medium has enough gain so that the laser will create multiple frequencies at once. So to fix this, an etalon is made out of a chunk of glass with two parallel faces and then is placed into the resonant cavity. Thus you are placing two resonators in series - one has a very narrow response and the other is not so narrow. The etalon may be rotated slightly to fine tune the frequency of operation. The responses of the cavity and of the etalon are essentially comb filter like (albeit with sharper tines) and the lasing material's response is essentially gaussian above a lasing threshold. The need for the etalon stems from a high power laser needing a lot of lasing medium thus the reflectors that encompass the medium end up being so widely spaced as to make the resonant cavity's nodes so closely spaced that the natural line width of the lasing material spans multiple modes. The etalon is used to remove the extra modes of oscillation. Clay
On Aug 16, 1:30 pm, amcneilly <amcnei...@gmail.com> wrote:
> I am new to DSP and i have the following problem > > I need to detect a 20khz pulse for a sonic ranging application using a > PC. I can detect reasonably well the 20khz signal by measuring the RMS > of the signal from the microphone then filtering the input using a > high pass filter or goertzel calculation and take a RMS calculation of > the filtered signal. If the RMS is over a threshold value then the > signal has been detected. > > The problem is that i cannot get a decent resolution. If i process the > signal in >= 64 samples chunks my signal detection works but i require > 11 samples resolution and this results in poor accuracy. > > Does anyone have any advice on a detection algorithm that would work > on ~11 sample chunks?
This problem sounds like a homework problem. If it is not, then you made too many assumptions too soon. Let us start from the very beginning again: what resources do you have and what do you want to do? How did it come to be that you have a 20 kHz pulse? Did you choose this? Julius