So say we've got a single sinusoid embedded in noise, but with an S/N ratio clearly greater than unity, and we've already estimated it's frequency using FFT methods (say in windows of 1024 samples). Now if the tone is known to come in bursts of some minimum number of cycles, what are the efficient DSP algorithms to determine when the tone started or stopped? (e.g. say we've found a tone in our FFT window, but now want to determine if it stopped or started mid-window, and if so, where.) Binary search using smaller and smaller FFT windows? Digital PLL? FIR or bi-directional IIR filter with threshold detection? What are the limitations on the accuracy of the measurement of the stop/start location(s) in time? Thanks. -- Ron Nicholson rhn AT nicholson DOT com http://www.nicholson.com/rhn/ #include <canonical.disclaimer> // only my own opinions, etc.
tone start/stop detection algorithms?
Started by ●October 5, 2004
Reply by ●October 5, 20042004-10-05
Ronald H. Nicholson Jr. wrote:> So say we've got a single sinusoid embedded in noise, but with > an S/N ratio clearly greater than unity, and we've already estimated > it's frequency using FFT methods (say in windows of 1024 samples). > > Now if the tone is known to come in bursts of some minimum number of > cycles, what are the efficient DSP algorithms to determine when the tone > started or stopped? (e.g. say we've found a tone in our FFT window, > but now want to determine if it stopped or started mid-window, and if > so, where.) > > Binary search using smaller and smaller FFT windows? Digital PLL? > FIR or bi-directional IIR filter with threshold detection? > > What are the limitations on the accuracy of the measurement of the > stop/start location(s) in time? > > > Thanks.How about tuning a filter -- narrow enough to block some noise, but broad enough to have a short enough response time -- and thresholding its output? Jerry -- You know that the outhouse is in the right place if ��� it seems too close in summer and too far in winter. ��� �������������������������������������������������������������������
Reply by ●October 5, 20042004-10-05
> So say we've got a single sinusoid embedded in noise, but with > an S/N ratio clearly greater than unity, and we've already estimated > it's frequency using FFT methods (say in windows of 1024 samples). > > Now if the tone is known to come in bursts of some minimum number of > cycles, what are the efficient DSP algorithms to determine when the tone > started or stopped? (e.g. say we've found a tone in our FFT window, > but now want to determine if it stopped or started mid-window, and if > so, where.) > > Binary search using smaller and smaller FFT windows? Digital PLL? > FIR or bi-directional IIR filter with threshold detection? > > What are the limitations on the accuracy of the measurement of the > stop/start location(s) in time?You can have a look at wavelettheorie. laki
Reply by ●October 5, 20042004-10-05
In article <cjur34$jkq$2@bob.news.rcn.net>, Jerry Avins <jya@ieee.org> wrote:>Ronald H. Nicholson Jr. wrote: > >> So say we've got a single sinusoid embedded in noise, but with >> an S/N ratio clearly greater than unity, and we've already estimated >> it's frequency using FFT methods (say in windows of 1024 samples). >> >> Now if the tone is known to come in bursts of some minimum number of >> cycles, what are the efficient DSP algorithms to determine when the tone >> started or stopped? (e.g. say we've found a tone in our FFT window, >> but now want to determine if it stopped or started mid-window, and if >> so, where.) >> >> Binary search using smaller and smaller FFT windows? Digital PLL? >> FIR or bi-directional IIR filter with threshold detection? >> >> What are the limitations on the accuracy of the measurement of the >> stop/start location(s) in time? >> >> >> Thanks. > >How about tuning a filter -- narrow enough to block some noise, but >broad enough to have a short enough response time -- and thresholdingWouldn't there also need to be some sort of low pass filter on the magnitude (absolute or squared) before the threshold detection? If both the tuned filter and the low pass filter were implemented as IIR's then there would seem to be a significant lag in the stop/start reporting, and maybe too much sensitivity to the amplitude of the tone. Whereas some sort of digital PLL might notice that it had lost lock in perhaps even less than one full period of the tone. IMHO. YMMV. -- Ron Nicholson rhn AT nicholson DOT com http://www.nicholson.com/rhn/ #include <canonical.disclaimer> // only my own opinions, etc.
Reply by ●October 5, 20042004-10-05
Ronald H. Nicholson Jr. wrote:> In article <cjur34$jkq$2@bob.news.rcn.net>, Jerry Avins <jya@ieee.org> wrote: > >>Ronald H. Nicholson Jr. wrote: >> >> >>>So say we've got a single sinusoid embedded in noise, but with >>>an S/N ratio clearly greater than unity, and we've already estimated >>>it's frequency using FFT methods (say in windows of 1024 samples). >>> >>>Now if the tone is known to come in bursts of some minimum number of >>>cycles, what are the efficient DSP algorithms to determine when the tone >>>started or stopped? (e.g. say we've found a tone in our FFT window, >>>but now want to determine if it stopped or started mid-window, and if >>>so, where.) >>> >>>Binary search using smaller and smaller FFT windows? Digital PLL? >>>FIR or bi-directional IIR filter with threshold detection? >>> >>>What are the limitations on the accuracy of the measurement of the >>>stop/start location(s) in time? >>> >>> >>>Thanks. >> >>How about tuning a filter -- narrow enough to block some noise, but >>broad enough to have a short enough response time -- and thresholding > > > Wouldn't there also need to be some sort of low pass filter on the > magnitude (absolute or squared) before the threshold detection? If both > the tuned filter and the low pass filter were implemented as IIR's then > there would seem to be a significant lag in the stop/start reporting, > and maybe too much sensitivity to the amplitude of the tone. > > Whereas some sort of digital PLL might notice that it had lost lock > in perhaps even less than one full period of the tone. > > > IMHO. YMMV.At it's simplest you could get by without the low-pass filter -- the bandpass filter will tend to have a lowpass effect on the signal envelope. You could use a digital PLL to detect the tone stop, but it'd be hard to see the tone _start_ when the PLL oscillator is in an unknown state. Using a FIR bandpass filter has been suggested; the nice thing about that is that you can set your threshold to be halfway between the noise and the signal -- that will give you a fairly good (if delayed) estimate of when the start/stop happened. No matter what you do you will have delay: the tighter you make the filter the better your noise rejection will be and the longer it will take to get an answer. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
Reply by ●October 5, 20042004-10-05
"Ronald H. Nicholson Jr." <rhn@mauve.rahul.net> wrote in message news:cjups9$ikq$1@blue.rahul.net...> So say we've got a single sinusoid embedded in noise, but with > an S/N ratio clearly greater than unity, and we've already estimated > it's frequency using FFT methods (say in windows of 1024 samples). > > Now if the tone is known to come in bursts of some minimum number of > cycles, what are the efficient DSP algorithms to determine when the tone > started or stopped? (e.g. say we've found a tone in our FFT window, > but now want to determine if it stopped or started mid-window, and if > so, where.) > > Binary search using smaller and smaller FFT windows? Digital PLL? > FIR or bi-directional IIR filter with threshold detection? > > What are the limitations on the accuracy of the measurement of the > stop/start location(s) in time?The temporal resolution is roughtly the reciprocal of the bandwidth of the filter that you pass the signal through. i.e. assuming a tone with abrupt starts and stops, the rise time and fall time will be related to the bandwidth of the filter through which the signal is passed. This is part of the answer. Signal to noise ratio is also part of the answer. Presumably to make the detection you will need a filter of some bandwidth because if the bandwidth is infinite then the SNR won't likely be high enough. So, we limit the bandwidth until the signal to noise ratio is adequate to adequately detect the presence or absence of the tone. This determines the rise time of the filter which is directly related to the temporal precision. If the filter is narrowed further, the noise is improved at the expense of rise time. If the filter is widened, the rise time is decreased at the expense of output SNR. There is probably a gray area between where shorter rise time and more noise gives false positive transition indications and where longer rise times give fewer false positives but with poorer resolution - or at least latency. If the amplitude of the pulse is known, one might be able to determine latency of detections and improve the temporal resolution. If one can backtrack in the processing then one might be able to predict when a clearly present pulse actually started. Example: Detect a tone and determine when it was at 90% of full amplitude. From the apparent 90% of amplitude point, using the rise time of the filter, predict when the pulse actually started. Using shorter FFT windows is equivalent to using wider bandwidth - as described above. So, the SNR will be reduced if you do this. Using overlapped FFTs might be a better way to go. The ultimate is to overlap the FFTs by N-1 samples and to create an output sample at each frequency as often as input temporal samples occur. Then you can look at each frequency with lots of time samples. The output will still have a rise time equivalent to the length of the temporal epoch of the data - length of the FFT. This may not be practical in the end but it could help answer some of your questions. Fred
Reply by ●October 5, 20042004-10-05
In article <10m66t6qr0na7f1@corp.supernews.com>, Tim Wescott <tim@wescottnospamdesign.com> wrote:>You could use a digital PLL to detect the tone stop, but it'd be hard to >see the tone _start_ when the PLL oscillator is in an unknown state.If one is working with windowed data, it might be possible to run a digital PLL backwards (on the data time-reversed) to see if/when the tone starts within a window. IMHO. YMMV. -- Ron Nicholson rhn AT nicholson DOT com http://www.nicholson.com/rhn/ #include <canonical.disclaimer> // only my own opinions, etc.
Reply by ●October 6, 20042004-10-06
"Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote in message news:<Ed6dnWT8paTLvf7cRVn-iw@centurytel.net>...> Using shorter FFT windows is equivalent to using wider bandwidth - as > described above. So, the SNR will be reduced if you do this. > Using overlapped FFTs might be a better way to go.I would test wavelets before using STFTs. I don't have any experience with wavelets, though, but STFTs are not awfully good to do detailed transient analysis.> The ultimate is to overlap the FFTs by N-1 samples and to create an output > sample at each frequency as often as input temporal samples occur. Then you > can look at each frequency with lots of time samples. The output will still > have a rise time equivalent to the length of the temporal epoch of the > data - length of the FFT. This may not be practical in the end but it could > help answer some of your questions.Check out detection theory. The books by van Loan ought to be a good starting point: van Loan: Detection, estimation and modulation theory, vols I-IV, Wiley. Rune
Reply by ●October 6, 20042004-10-06
On Tue, 5 Oct 2004 18:41:13 +0000 (UTC), rhn@mauve.rahul.net (Ronald H. Nicholson Jr.) wrote:>So say we've got a single sinusoid embedded in noise, but with >an S/N ratio clearly greater than unity, and we've already estimated >it's frequency using FFT methods (say in windows of 1024 samples). > >Now if the tone is known to come in bursts of some minimum number of >cycles, what are the efficient DSP algorithms to determine when the tone >started or stopped? (e.g. say we've found a tone in our FFT window, >but now want to determine if it stopped or started mid-window, and if >so, where.) > >Binary search using smaller and smaller FFT windows? Digital PLL? >FIR or bi-directional IIR filter with threshold detection? > >What are the limitations on the accuracy of the measurement of the >stop/start location(s) in time? > > >Thanks. >-- >Ron Nicholson rhn AT nicholson DOT com http://www.nicholson.com/rhn/ >#include <canonical.disclaimer> // only my own opinions, etc.Hi, Maybe the Sliding DFT algorithm would be useful to you. It's worth a try. That algorithm computes a new DFT sample (a single N-point DFT bin output value) upon the arrival of each new input time-sample. Good Luck, [-Rick-]
Reply by ●October 6, 20042004-10-06
I am assuming the problem is as follows: x[n] = s[n] + w[n] s[n] = A*cos(2*pi*f_0/f_s*n + phi) * (u[n - n_0] - u[n - n_1]) where x[n] is the data you have s[n] is the signal you wish to detect w[n] is white Gaussian noise A is the unknown amplitude (a nuisance parameter) f_0 is the unknown frequency f_s is the sampling rate phi is the unknown phase (a nuisance parameter) u[n] is the unit step function n_0 is the start sample n_1 is the end sample n_1 - n_0 is the total number of samples in the burst (known?) I believe S. Kay has derived the optimal detector for a similar problem: a sinusiod of known frequency, unkown start and stop samples, embedded in white Gaussian noise. I will check when I get to work, but I think this is fairly simple, especially if n_1 - n_0 is known. The maximum likelihood estimator (MLE) will probably be the STFT with high overlap between windows. Please look at Kay's text: "Fundamentals of Statistical Signal Processing, Vol II - Detection Theory" - Jesse rhn@mauve.rahul.net (Ronald H. Nicholson Jr.) wrote in message news:<cjups9$ikq$1@blue.rahul.net>...> So say we've got a single sinusoid embedded in noise, but with > an S/N ratio clearly greater than unity, and we've already estimated > it's frequency using FFT methods (say in windows of 1024 samples). > > Now if the tone is known to come in bursts of some minimum number of > cycles, what are the efficient DSP algorithms to determine when the tone > started or stopped? (e.g. say we've found a tone in our FFT window, > but now want to determine if it stopped or started mid-window, and if > so, where.) > > Binary search using smaller and smaller FFT windows? Digital PLL? > FIR or bi-directional IIR filter with threshold detection? > > What are the limitations on the accuracy of the measurement of the > stop/start location(s) in time? > > > Thanks.






