This is the procedure:

- Build the tools using 'mk' if the pre-built versions don't work for
  you.  (These require my fidlib filter design library, which is in
  the 'fidlib' directory.)

- Extract the audio from the CD or tape at 44100Hz as a WAV or RAW
  audio file (i.e. 16-bit stereo little-endian data).  You'll need a
  RAW (headerless) file to work on, but as a short-cut you can treat a
  16-bit WAV file as a RAW file -- the worst that can happen is that
  the L+R channels get swapped and there is a bit of noise at the
  start of the recording.

- Downsample this RAW file to 2004.5Hz using 'downsample':

    Usage: downsample <input-rate> <downsamping-ratio> [<gain>]
    e.g. use: downsample 44100 22 0.9 <in.raw >out.raw
    to downsample a 16-bit stereo raw file from 44100 to 2004.55Hz

  The point of downsampling is to reduce the amount of data that needs
  to be processed later, speeding up the process.  A sampling rate of
  2004.5Hz leaves everything up to ~700Hz intact.  If you are looking
  at higher carrier frequencies, you'll need to use a higher sampling
  rate when you downsample, and it will be a bit slower to run.
  Example command-line for 2004.5Hz:

    downsample 44100 22 <in.raw >out.raw

- Get a rough idea of where the interesting frequencies are using some
  other visual frequency-display application.  (It is possible to use
  BWView, although this isn't ideal for this task).

- Analyse the downsampled file using 'anarange':

    Usage: anarange <rate> <from> <to> <step>
     e.g.: anarange 2004.5 118 132 0.1 <in.raw >out.txt

  For example:

    anarange 2004.5 118 132 0.1 <out.raw >log
    less log

  The parameters here are: the sampling rate (Hz), the lower and upper
  bounds of the frequency range to analyse (Hz,Hz), and the step to use.
  For example, in the line above, there will be (132-118)/0.1 bands
  analysed, or 140.  The analysis outputs its results for every second
  of the recording, so the output text file can be quite long.

The analysis works by doing using very narrow filters to pick up each
of those frequency bands separately, using this to pick up the peak
frequency in each channel.  From this the binaural carrier and beat
frequencies are calculated, and the amplitude.  This is not fool-proof
-- noise or other frequencies in the same frequency range on the
recording can put off the readings, but by scanning through the
results, you will soon be able to see the trends and distinguish the
real data from the interference.

Note that the algorithm may need tweaking if you have a recording that
isn't being analysed well.  This is all still quite improvised code --
I'm not making any promises that this is going to work straight off
for everything.  You may have to modify the code a little.  (There is
also quite a lot of unused routines in the source from previous
experimental approaches.)

Hope this is useful --

Jim

