I'm about to implement a piece of software, which detects the period of a (periodic) signal and stores the period of the signal in a table. The signal changes continously and will only stay periodic for a short while, say 1000 periods, before it changes into a new shape and period. Which solution would you choose to detect the shape and frequency of the waveform? A neural network? FFT, overlapped windows Counting zero crossings I've heard about something called Phase Locked Loop (PLL), perhaps suitable? In particular I'm interested in exploring the first one, neural networks. Do you think it'd be possible? Has it been done? Any papers on it? Thanks M
Detecting the period of a signal
Started by ●January 7, 2004
Reply by ●January 7, 20042004-01-07
Mike H wrote:> I'm about to implement a piece of software, which detects the > period of a (periodic) signal and stores the period of the signal > in a table. The signal changes continously and will only stay > periodic for a short while, say 1000 periods, before it changes > into a new shape and period. > > Which solution would you choose to detect the shape and frequency > of the waveform?Hi Mike, if I had to solve such a task, I'd at first examine the signal with respect to the following items: - is the next period predictable? - how many different periods can be expected? - necessary resolution of the result? - how big will the table be/become? - how many samples can be measured per period? If you think about these questions, you'll certainly find out that some approaches won't perform good enough while others do. Counting zero crossings might be a pretty simple approach if your signal is a sine or rectangular wave with zero overall energy content and if you get lots of samples per period. However, it'll be difficult to measure periods by counting zero crossings if the signal has a varying DC component or bears information like speech signals do. If you can predict signal period/frequency and if there is only a small number of different possibilities, DFT/FFT or FIR filters will do a good job. Google on "DTMF+filter" PLLs are useful if you want to detect special frequencies. However, it depends if they are easily implemented. If you search for a hardware solution, they might be primary choice, if you want to select known frequencies. In software, you'd certainly prefer other solutions. Neural networks? I can hardly imagine a solution which would be easily implemented with minimal effort. Maybe, if your signal develops with some dynamic rules, and you try to predict the next period before it happens to occur, it might be worth thinking about it. But even then, adaptive filtering might reveal quicker results.> In particular I'm interested in exploring the first one, neural > networks. Do you think it'd be possible? Has it been done? Any > papers on it?Sorry, no practical experience in this region. Bernhard -- OT: Happy new year to all. God bless you.
Reply by ●January 7, 20042004-01-07
Hi Mike - I did a quick search on yahoo using "frequency estimation" and "neural network" and got over 200 references , about 20% of which look as though they might be of interest. Personally I would use zero crossing and maybe try to find points of inflection or local minima if I needed more. Best of Luck in any event - Mike "Mike H" <mikael.nospam@mhc.nospam.se> wrote in message news:qzOKb.45262$dP1.184615@newsc.telia.net...> I'm about to implement a piece of software, which detects the period of a(periodic) signal> and stores the period of the signal in a table. The signal changescontinously and will only> stay periodic for a short while, say 1000 periods, before it changes intoa new shape and> period. > > Which solution would you choose to detect the shape and frequency of thewaveform?> > A neural network? > FFT, overlapped windows > Counting zero crossings > I've heard about something called Phase Locked Loop (PLL), perhapssuitable?> > In particular I'm interested in exploring the first one, neural networks.Do you think> it'd be possible? Has it been done? Any papers on it? > > Thanks > M > >
Reply by ●January 7, 20042004-01-07
"Bernhard Holzmayer" wrote:> > Hi Mike, > if I had to solve such a task, I'd at first examine the signal with > respect to the following items: > - is the next period predictable?This is further complicated, because it's an audio signal, basically any type of sound. It may contain sections of noise. Thus an FFT could probably do the job of detecting whether the current period is pure noise or not etc. But the problem with the FFT approach is that it's not specific for sound waveforms. Perhaps a neural network approach would be less sensitive for small variations, which often occur in sounds. For example, a continous waveform usually contains small variations in each period. An FFT approach would require detecting these small changes and draw the conclusion that it's still the "same" basic waveform.> - how many different periods can be expected?That should be possible to change.> - necessary resolution of the result?Should also be possible to change.> - how big will the table be/become?That doesn't matter.> Counting zero crossings might be a pretty simple approach if your > signal is a sine or rectangular wave with zero overall energy > content and if you get lots of samples per period.One could clip the signal before feeding it into the zero crossing counter...> However, it'll be difficult to measure periods by counting zero > crossings if the signal has a varying DC component or bears > information like speech signals do.Yup, but one could apply a DC (adjusting) filter before feeding the signal into the zero crossing counter.> If you can predict signal period/frequency and if there is only a > small number of different possibilities, DFT/FFT or FIR filters > will do a good job. Google on "DTMF+filter"I've done some trials using FFT with different types of windowing types. The result is not that impressing, because the result of the FFT has to be analyzed in detail in order to get decent results. Frequencies fall between the frequency bins and the signal is never exactly the same in each period. That's why I thought that a method which takes small changes into account would be more suitable.> Neural networks? > I can hardly imagine a solution which would be easily implemented > with minimal effort.Well, it doesn't matter if it's complicated :-) Minimal effort is not required. Wouldn't it be possible to train a network to detect repeating waveforms? Quick transients could be hard for it to deal with, but what about detecting a waveform, which has small variations in each cycle? Or do you think the amount of training such a network would require would be too big? I mean let's say that a sound is very complicated in the sense that each periodic waveform in the sound only lasts for say 250 cycles before it changes shape completely. Would it be feasible to train an NN to detect the average waveform shape during these 250 cycles?> Maybe, if your signal develops with some dynamic rules,Yes, perhaps.> and you try to predict the next period before it happens to occur, it might be > worth thinking about it.Yes.> But even then, adaptive filtering might reveal quicker results.Ok. Mike
Reply by ●January 7, 20042004-01-07
"Mike H" <mikael.nospam@mhc.nospam.se> wrote in message news:<qzOKb.45262$dP1.184615@newsc.telia.net>...> I'm about to implement a piece of software, which detects the period of a (periodic) signal > and stores the period of the signal in a table. The signal changes continously and will only > stay periodic for a short while, say 1000 periods, before it changes into a new shape and > period. > > Which solution would you choose to detect the shape and frequency of the waveform? > > A neural network? > FFT, overlapped windows > Counting zero crossings > I've heard about something called Phase Locked Loop (PLL), perhaps suitable? > > In particular I'm interested in exploring the first one, neural networks. Do you think > it'd be possible? Has it been done? Any papers on it? > > Thanks > MPlease define "shape". Are you looking for formants in frequency domain or transients in time domain? The following is based on an assumption of piecewise stationary signals comprising only one sinusoidal component. If your (single sinusoid) signal is stationary over 1000 periods and properly sampled (say, 5 to 10 times the highest signal period), I'd go for an FFT averaged over 200 - 500 periods. PLLs could be used in principle, but I understand discrete PLLs can be difficult to implement. Counting zero crossings... well, why not try it if the signal-to-noise ratio is high enough... For some reason I'm not overly excited by this solution. I can't support my antipathy for this technique with more than that I just don't like it, though. Perhaps it's not sophistcated enough, I don't know... Neural Networks... I don't know how or why NNs work. I don't see any reason why they should be used in a problem as assumed by me here, since the averaged-FFT technique should have few difficulties solving the problem. If you are indeed looking for more complex structures in the data, you may have to resort to NNs, though. Rune
Reply by ●January 7, 20042004-01-07
You don't say exactly what you need the system to do, but I get the feeling you want it to identify various sounds- classifying them , in essence. If so, then a neural network or any capable modeling system (tree induction, rule induction, k-nearest neighbors, etc.) might work, but would probably require "digested" input. I remember reading that Volvo tested engines by starting them up near a microphone which was connected to a PC. The sound was digitized and run through a Fourier transform. The Fourier coefficients were used as inputs to a neural network that had been trained to classify engines as operating normally or not. Perhaps if you supplied more details, we could provide more specific suggestions. -Will Dwinnell http://will.dwinnell.com "Mike H" <mikael.nospam@mhc.nospam.se> wrote: "I'm about to implement a piece of software, which detects the period of a periodic) signal and stores the period of the signal in a table. The signal changes continously and will only stay periodic for a short while, say 1000 periods, before it changes into a new shape and period. Which solution would you choose to detect the shape and frequency of the waveform? A neural network? FFT, overlapped windows Counting zero crossings I've heard about something called Phase Locked Loop (PLL), perhaps suitable? In particular I'm interested in exploring the first one, neural networks. Do you think it'd be possible? Has it been done? Any papers on it?"
Reply by ●January 7, 20042004-01-07
Mike H wrote:> ... But the problem with the FFT > approach is that it's not specific for sound waveforms. ...Defining a sound waveform will go a long way toward closing in on the solution you want. Can you do it? It is always tempting (but not always fruitful) to use a neural net as a DWIM* box. Often a neural net that succeeds brilliantly on the set of training samples fails miserably with real data. You need to understand the nature of your underlying task in order to construct a good training set. Jerry ________________________ * Do What I Mean (so I don't have to say). The philosopher's stone of high-level computer languages. -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Reply by ●January 7, 20042004-01-07
"Will Dwinnell" <predictr@bellatlantic.net> wrote in message news:2b7b8021.0401071136.553b955f@posting.google.com...> You don't say exactly what you need the system to do, but I get the > feeling you want it to identify various sounds- classifying them , in > essence. If so, then a neural network or any capable modeling system > (tree induction, rule induction, k-nearest neighbors, etc.) might > work, but would probably require "digested" input. I remember reading > that Volvo tested engines by starting them up near a microphone which > was connected to a PC. The sound was digitized and run through a > Fourier transform. The Fourier coefficients were used as inputs to a > neural network that had been trained to classify engines as operating > normally or not. > > Perhaps if you supplied more details, we could provide more specific > suggestions. > > -Will Dwinnell > http://will.dwinnell.com >Neural Networks have been around for hundreds of millions of years. The approach described above seems to be the preferred one for acoustic processing. Best wishes, --Phil Martel> > "Mike H" <mikael.nospam@mhc.nospam.se> wrote: > "I'm about to implement a piece of software, which detects the period > of a periodic) signal and stores the period of the signal in a table. > The signal changes continously and will only stay periodic for a short > while, say 1000 periods, before it changes into a new shape and > period. > > Which solution would you choose to detect the shape and frequency of > the waveform? > > A neural network? > FFT, overlapped windows > Counting zero crossings > I've heard about something called Phase Locked Loop (PLL), perhaps > suitable? > > In particular I'm interested in exploring the first one, neural > networks. Do you think it'd be possible? Has it been done? Any papers > on it?"
Reply by ●January 7, 20042004-01-07
"Mike H" <mikael.nospam@mhc.nospam.se> wrote in message news:qzOKb.45262$dP1.184615@newsc.telia.net...> I'm about to implement a piece of software, which detects the period of a(periodic) signal> and stores the period of the signal in a table. The signal changescontinously and will only> stay periodic for a short while, say 1000 periods, before it changes intoa new shape and> period. > > Which solution would you choose to detect the shape and frequency of thewaveform?> > A neural network? > FFT, overlapped windows > Counting zero crossings > I've heard about something called Phase Locked Loop (PLL), perhapssuitable?> > In particular I'm interested in exploring the first one, neural networks.Do you think> it'd be possible? Has it been done? Any papers on it?Mike Google on "detect fundamental frequency", the first hit looks interesting: http://www2.cs.uregina.ca/~gerhard/publications/TRdbg-Pitch.pdf and there are many others that are particularly pertinent. Cepstral processing has been used in speech to separate the fundamental frequency of the exitation from other aspects of the vocal tract response. If you consider a neural net then you need to decide what goes into it. An array of samples? An array of delayed samples so they coincide in time? That is, delay the oldest sample so that it arrives at the input at the same time as the newest sample? I don't know .... not something I've done. Fred
Reply by ●January 7, 20042004-01-07
allnor@tele.ntnu.no (Rune Allnor) wrote in message> If your (single sinusoid) signal is stationary over 1000 periods and > properly sampled (say, 5 to 10 times the highest signal period), I'd go > for an FFT averaged over 200 - 500 periods. > > > Neural Networks... I don't know how or why NNs work. I don't see any > reason why they should be used in a problem as assumed by me here, > since the averaged-FFT technique should have few difficulties solving > the problem. If you are indeed looking for more complex structures > in the data, you may have to resort to NNs, though. > > RuneI am assuming that the signal is not a single sinusoid because the shape changes. This tells me that there are at least 2 signals, even if one is just a modulating signal. Mike, if the number of periods/frequencies and shapes are limited, then a combination of FFT and NN might do the job. Use the FFT to get the frequency domain content of the signal. This will have information about the shape of the signal as well as the frequency. Use the frequency bins of the FFT as the input to the NN. If the data set is limited, and if trained properly (and these are big ifs), then the NN might be able to classify the data for you. Maurice Givens






