A quick introduction to this code.  Build like this:

  cc -o hearbr3 -lm hearbr3.c

Run like this:

  hearbr3 -j 1/5 shorttest.dat 130

"shorttest.dat" is an extract of "downey.dat" that I used for those
MP3s.  Or using Jim-M's "log001.dat" (this is useful as it contains
test tones rather than EEG data):

  hearbr3 -j 1/3 log001.dat 140

"filt_designer.c" generates bandpass filters.  To improve the
definition of the sides of the filters in the filter response, you can
use n_stage>1, which stacks filters end to end.  This improves the
definition of the band, but increases the delay.  This code generates
the filter coefficients by doing a search.  Note that the filter
coefficients output when the program starts are in a format suitable
for some Perl-scripts I've written to view the filter responses --
there is nothing else I know that accepts this format.

Within the main code, hopefully it should be fairly clear what is
what.  Pitch is represented in 'cents', or 100ths of a semitone
relative to 256Hz.  An octave difference is 1200, a fifth is 700,
major third 400, and so on.  pitch_freq() converts pitch->frequency.

The output is to /dev/dsp by default.

In the output code (chan_out()), everything slides smoothly from one
pitch/amplitude to the next.  This helps keep weird distortion out of
the results, but maybe you could skip all that if you're just using
plain tones, rather than fast changing pitches, as this code generates
at present.

Jim

--
 Jim Peters                  (_)/=\~/_(_)                 jim@uazu.net
                          (_)  /=\  ~/_  (_)
 Uazú                  (_)    /=\    ~/_    (_)                http://
 B'ham, UK          (_) ____ /=\ ____ ~/_ ____ (_)            uazu.net
