Skip to content

Brian2Hears meeting notes

Victor Benichoux edited this page Jun 25, 2014 · 24 revisions

Brian2hears meeting 22/06/2014

Points to be adressed: #. Strategy for buffering/FIR filtering #. Sounds

  • OnlineSounds idea
  • multichannel audio (= multichannel TimedArray)
  1. General TODO list - FIR filtering with multiple IRs
  2. Misc - implement multiple backends for sound playing (get rid of pygame: portaudio?) - control filterbank/feedback (mostly scheduling issues) - implement the .process() method

Buffering

In brian1hears, Filterbanks operate based on buffers. This means that the result of filtering is always "precomputed" for a given amount of time. This is desirable for example in FIR filtering, for which the most efficient computation methods are FFT-based.

I can see two possible courses of action:

  • Get rid of buffering altogether This means relying on the current FIR filtering scheme (unefficient shift-register technique) everywhere. A plus side is that this requires no modification of B2, and currently works (incl. in standalone mode)
  • Implement buffering This means implementing some buffering mechanism. A plus side is that is could be used also in B2, for example in the context of StateMonitors wherein one may want to record a running average that could be computed online with FIR filtering (note that it can also be done with IIR filtering, which is more efficient)

Scheduling/clock

For now all filterbank objects use the dt of the source to set their internal samplerate. This is also the case when the source is a TimedArray (and Marcel advised against doing this).

It may not be so hard to allow Filterbank objects to have a different dt than the other B2 objects. This could be useful for example when using filterbanks that have a fixed samplerate in their formulation (e.g. TanCarney), whilst still being able to freely set other B2 objects' dts.

Scheduling has to be taken care of, and I have not thought about it much. I think that in most instances it is straightforward, but may be more complex when dealing with control/feedback filterbanks. We could just always update filterbanks and _then_ control filterbank. How good of a control on this schedule do we need (Bertrand: any ideas?)?

Misc

  • Sound playing *

I personally think that pygame is a pain in the a**e, so I think that it would make sense to get rid of it altogether. Other options are available for sound playing/recording on multiple platforms: JACK, portaudio. I think that portaudio would be better, yet it may also be more complicated to install on some platforms (which is also the case of pygame on e.g. OSX). Any thoughts?

  • Control filterbank and feedback

This is not hard to implement in brian2, but simply requires that we carefully think about scheduling, which hasn't been done yet.

Clone this wiki locally