In article UATub.191555$275.664852@attbi_s53, Brian Reinhold at
[email protected] wrote on 11/19/2003 19:07:
> What is wrong with this thinking about computing a running integral over a
> data sample:
>
> y(n) = ?x(i) * cos(w*i) where the sum is over the previous N data points.
> y(n+1) = ?x(i+1) * cos(w*(i+1)) again where the sum is over the previous N
> data points.
>
> What this means is that
> y(n+1) = y(n) + x(i+1)*cos(w*(i+1)) - x(n-N)*cos(w*(n-N)).
>
> Thus one can compute the running integral with 2 multiplies and 2 adds.
i dunno what the 2 multiplies has to do with the "moving sum" (what is
commonly called this thing you're calling a "running integra").
x[i]*cos(w*i) is just a definition of the input to your moving summmer. the
multiplication is part of that signal definition. let's just call the input
"x[n]" and make our lives easier.
the moving sum operation:
N-1
y[n] = SUM{ x[n-i] }
i=0
is an FIR filter that can be computed with the recursion equation:
y[n] = y[n-1] + x[n] - x[n-N]
this is probably the simplest non-trivial example of what has been dubbed by
Julius Smith a "Truncated IIR" filter. it really is an FIR but it is
implemented with an IIR (in this case the IIR is an integrator), a delay
line and some subtraction.
you can pretty easily extend this concept to 1st order decaying exponential
impulse responses:
y[n] = alpha*y[n-1] + x[n] - (alpha^N)*x[n-N]
that's the same as
N-1
y[n] = SUM{ (alpha^i)*x[n-i] }
i=0
with a little more thought, you can extend it to 2nd order or any other IIR
filter where you can truncated the "infinite" impulse response at some
defined finite limit.
> Seems way too simple, though nothing says to me that I should not be able to
> move the cosine function one phase increment each sample increment thus
> avoiding the sum over N multiplies and adds.
>
> What I want to do is an integrate and dump scheme for demodulating an FSK
> signal. Perhaps use a Goertzel filter for each frequency as well (if I can
> figure out how to apply it to a data stream.) Any sources or help greatly
> appreciated. I am sure someone has figured out how to do a great FSK
> demodulator (much better than I would come up with) and I don't want to
> re-invent the wheel!
it would be doing that.
r b-j