Re: Fundamental frequency -- limited resources

From: Rob Vermeulen (rvermeulen_at_arbor-audio-antispam-.com)
Date: 08/18/04


Date: Wed, 18 Aug 2004 14:06:11 +0200

Short question,

Why is a median filter not good enough?
These filters are insensitive to glitches. It just takes the middle value of
your sorted array.
Or in your case, sort the periods, and take the middle one as reference.

gl.

Rob.

"Email Unread" <aa99aa@verizonmail.com> wrote in message
news:81c69dd.0408180350.2c79beea@posting.google.com...
> Hi --
>
> Hope this is being posted to the appropriate group(s) -- I didn't want
> to carpet-bomb all the NG's but I figured these 2 groups would be the
> most helpful.
>
>
> After banging my head into a wall for many days on a particular
> problem, I realized I might be able to benefit from the wisdom of
> these newsgroups.
>
> I have inherited a very resource-constrained embedded system,
> primarily performing data acquisition. Memory is the biggest
> constraint, the processor horsepower is not as big a constraint.
>
> Anyways, suppose I have system sampling (via ADC) at 10,000
> samples/sec. Suppose several times per second, I get an "event",
> which is a rectified voltage spike. For the sake of this example,
> let's suppose I get an event every 10ms, i.e. every 100 samples. Thus
> every 100th sample would be non-zero, the rest would be zero. (Let's
> assume no noise, each event is one sample in width, etc...)
>
> So if I had an array of 50,000 elements, which would represent 5
> seconds of data, with most of the samples reading "0", and about 500
> elements reading non-zero when an event occurred. So far, so good....
>
> Now here is the issue... there isn't memory to store 50k, 100k, etc...
> samples. This is a small 16 bit processor board designed years ago
> with limited RAM, not the common 32-bit processor running with 128M of
> RAM like so many "embedded" systems today.
>
> Also, to make things "worse", sometimes an event is missed, and
> sometimes a "ghost event" shows up 1/2 way between real events.
>
> So what I am saying is this... instead of an event every 100 samples,
> sometimes I will get an additional event at sample 150, 550, 750,
> etc... and sometimes we will get an event at 600 and 800, but not 700.
> These "event glitches" are due to shortcomings in the system hardware
> and cannot be fixed.
>
> The system is used to measure the linear speed of a moving system, the
> closer the events are to each other (i.e. smaller period), the faster
> the machinery is moving. The resource constrained system must
> frequently estimate the speed of the system by measuring the time
> between events.
>
> In a perfect world, with no missed events and no false events, we
> could just measure the period between the last 2 events, and that
> would be the best (most recent) estimate of the system speed.
>
> In an almost-perfect world (i.e. non-real time, post-processing on a
> PC, etc...), an FFT could be used on a huge array of time-domain
> samples, and the fundamental frequency of 100 would come through, is
> spite of the "ghost events" and missing events.
>
> But this system has limited memory, and it interrupts every 500
> samples or so, and the driver stores indices of non-zero events. In
> other words, over 1 second (10k samples), if events are happening
> every 100 samples, the driver would store the values 100, 200, 300,
> etc... 9900, 10,000 in a small array.
>
> The reality is that the array will actually hold values like ....4200,
> 4250, 4300, 4400, 4600, 4650, 4700, etc.... due to false & duplicate
> events.
>
> I have tried things like a histogram (find the "mode" of the period),
> a median filter, etc... but they are all succeptible to problems.... I
> keep thinking, "if I could just do an FFT and take the dominant freq,
> I'd be set!"
>
> So the $64,000 question is this .... is there some way to find the
> "fundamental frequency" of this data (which would be 100 in this
> case), assuming I don't have the memory to save (or re-create) a huge
> time-domain array of samples, and perform an FFT?
>
> (Humility note: When I took this little project over, I thought, "no
> problem, visually, I can easily what the period is, this will be a
> piece of cake in firmware....")



Relevant Pages

  • Re: Fundamental frequency -- limited resources
    ... Memory is the biggest ... > constraint, the processor horsepower is not as big a constraint. ... > The reality is that the array will actually hold values like ....4200, ... > keep thinking, "if I could just do an FFT and take the dominant freq, ...
    (sci.math.num-analysis)
  • Re: Median filter in Verilog
    ... I cannot find any starting point for a median filter which needs to ... sort 100 numbers. ... systolic array, which may or may not be useful in this case. ... My first thought on seeing Median was an algorithm ...
    (comp.lang.verilog)
  • Re: Imaginary values non-null in FFTW Java wrapper real transform
    ... the format of the array returned by the FFTW real to ... An FFT of a totally real input signal will, in general, return results with nonzero real and imaginary parts. ... If the input signal has even symmetry around 0 then the FFT should be all real, ... Wescott Design Services ...
    (comp.dsp)
  • Re: What is this
    ... type parameters as an entity of the same in the host would have, ... array of that name. ... one you found for statement function dummy arguments. ... I have to say that constraint doesn't seem to fit well with the material ...
    (comp.lang.fortran)
  • Re: Missing Index Value in Array Aggregate
    ... an array with an elaboration type index to omit one of the ... of an aggregate for a formal parameter of an unconstrained ... compiler knows what type is expected for the aggregate. ... the constraint puts bounds on the indexes. ...
    (comp.lang.ada)