BinauralDB.h File Reference

#include "CSL_Core.h"
#include "SpatialPanner.h"
#include "FFT_Wrapper.h"

Go to the source code of this file.

Namespaces

namespace  csl

Classes

class  csl::HRTF
class  csl::HRTFDatabase

Defines

#define HRTF_BLOCK_SIZE   512
 Typically CGestalt::blockSize().
#define HRIR_SIZE   1024
#define FLIST_NAME   "files.txt"
 name of file list file
#define DEFAULT_HRTF_FOLDER   "IRCAM_HRTF/"
 where are the HRTFs under the CSL_Data folder?
#define HRTF_RESOURCE   "IRC_1047_R"
 What's the default HRTF folder under data?
#define cmac(in1, in2, out)


Define Documentation

#define HRTF_BLOCK_SIZE   512
 

Typically CGestalt::blockSize().

BinauralDB.h -- Specification of the HRTF file format and database This is the CSL 5 version that uses the FFT wrapper framework

Classes HRTF: holds the data that corresponds to an HRTF for a single position as a stereo pair of multi-block arrays of complex spectra. 2 channels * 16 blocks * 512-complex-float arrays There is support in the code for taking a subset of the HRIR and changing the block size.

HRTFDatabase: vector of HRTFs; implemented as a Singleton because it's large. Has a vector of HRTFs and can access them by position -- hrtfAt(CPoint) -- or by index -- hrtfAt(unsigned). Create it with a folder/resource name, it reads "files.txt" for a list of HRIR files to load. This has a number of file/folder/DB IO methods for load/store of bulk HRTF data sets in IRCAM format and CSL's pre-processed HRTF.dat files.

The companion file has the classes BinauralPanner: place sources in 3D using block-wise convolution with an HRTF; best heard over headphones . BinauralSourceCache: used for caching previous state of spatial sources.

See the copyright notice and acknowledgment of authors in the file COPYRIGHT Created by Jorge Castellanos on 7/19/06. Inspired by and partially based on the VST HRTF Plug-in written by Ryan Avery. Rewritten for FFT wrappers and pluggable sound file APIs in 8/09 by STP.

Todo:
HRTFs should be equalized, currently they are being loaded and used raw.

Interpolation of HRTFs. Currently the closest HRTF is being used.

CSL HRTF.dat file format Header = a string with the label and geometry list, label is: "HRTF" name #-hrtfs HRIR-len blk-size #-blocks as in, HRTF 1047 188 8192 512 16

geometry is a cr-separated list of 2 integers per line of the azim/elev in degrees of the points; empty line ends list.

Header is followed by the per-head, per-spsition, blocked HRTF complex vectors. 2-16 blocks/set, each has 257 or 513 complex values for L and R for full-len HRIR, this = 8 * 2 * 513 * 16 = 131 kB / HRTF * 188 = 24.6 MB / DB

Trailer is "\nHRTF\n" The methods storeToDB() and loadFromDB() implement this format.

#define HRIR_SIZE   1024
 

#define FLIST_NAME   "files.txt"
 

name of file list file

#define DEFAULT_HRTF_FOLDER   "IRCAM_HRTF/"
 

where are the HRTFs under the CSL_Data folder?

#define HRTF_RESOURCE   "IRC_1047_R"
 

What's the default HRTF folder under data?

#define cmac in1,
in2,
out   ) 
 

Value:

out[0] += in1[0] * in2[0] - in1[1] * in2[1];    \
    out[1] += in1[0] * in2[1] + in1[1] * in2[0];


Generated on Sat Oct 17 14:12:32 2009 for CSL by  doxygen 1.4.5-20051010