From: Jim Peters (jim_at_uazu.net)
Date: 2002-03-06 11:40:02
Doug Sutherland wrote:
> Excellent point. For biofeedback, the speed of actual feedback
> to human is important. FFT is slow in this respect relative to
> digital filtering (IIR or FIR).
There are two or three aspects here:
- The actual processor time it takes to compute the filter (of
whatever type). This limits the number of bands you can follow
simulaneously on slow machines, i.e. how many bands you can handle
per unit of input data.
- How often you choose to run the filter. For IIR you automatically
run it every sample, so you get analysis output every sample, with
no delay. For FIR, the processing overhead is greater, and you
might choose to run it only every 16 samples, say. This means there
is an additional delay of between 0-15 samples.
- The actual signal delay introduced by the filter itself. For
example, a nice symmetrical FIR filter delays the signal by half the
filter length. IIR, even though it works every sample, also delays
the signal by a similar amount (if you look at the impulse response
of an IIR filter, there is a noticeable delay before the first peak
arrives). The signal delay is related to the width of the band -- a
narrow frequency band requires a long filter (remember the 'window'
display in BWView when you hold the mouse button?), and hence
introduces a larger delay. A wide frequency band means a short
filter, and so a shorter signal delay.
Really, I think that the way to choose our filters is to try BWView
with different window widths, and choose the one that looks best to
use (I personally like a window of 4 wavelengths). That then fixes
the signal delay due to the filter. We then have a choice of either
using FIR or IIR. FIR gives a precise response, but the processing
overhead is higher. IIR gives a response with some 'memory', but the
processing overhead is much less. That's about it as a choice, as far
as I can see.
(I'm rejecting FFT, which is a kind of accelerated FIR filter, because
if you measure the window width in wavelengths, it gives a different
window width for every frequency band, and it also forces us to use a
linear frequency scale.)
When we get to this, I could perhaps put a mode into BWView to emulate
the use of IIR filters, so we can see what that looks like on known
data, and choose that way.
Does that sound like a viable plan ?
I did look at some of the types of IIR filter you mention, but in the
end I found one page that summarised a whole load of IIR filter types
very simply, and I decided to stick with that. I believe the
trade-off is between a clean frequency-response, and a clean
time-response (i.e. not too much blurring into the recent past). I
can perhaps look at that later if no-one else has any experience with
this.
Doug, you'll forgive me if I don't read all these links ? There is
much too much there for me to read right now. I haven't even started
on your list of EEG software display interfaces, which is likely to be
much more interesting. I'll keep the list for reference, though.
By the way, BWView is progressing -- I'm O-O-ing a lot of the stuff
which wasn't O-O-ed before. I'm not quite ready to build and release
yet, but did you get anywhere with cleaning up the build on Windows ?
I'll incorporate all the suggested FFTW ./configure options when I
come to rebuild on Linux, but shall I stick with my hacks to build on
Windows for now ?
Cheers --
Jim
-- Jim Peters (_)/=\~/_(_) jim_at_uazu.net (_) /=\ ~/_ (_) Uazú (_) /=\ ~/_ (_) http:// B'ham, UK (_) ____ /=\ ____ ~/_ ____ (_) uazu.net
This archive was generated by hypermail 2.1.4 : 2002-07-27 12:28:39 BST