
andresbrocco
@Obineg sorry for the delay!
Actually I'm not the one that designed the filters. I just copied the coefficients from a research published by IRCAM! That is mentioned at the readme file.
Regarding the LR phase difference, that's also a parameter provided by IRCAM (ITD), which I implemented using 2 delay~ lines, one for each channel.
Have you tested out? What do you think of the performance? Does it sound good for your ears?

andresbrocco
Ahh, indeed! I forgot to mention that
The goal is to be pure vanilla, so I'll replace it with:[*~ 1]

[+~ 1]Thanks @FFW and @alexandros

andresbrocco
Hey @alexandros. that's not a typo! That's short for [expr(1$f1)]: the exclamation point reverses the order of the inlets when preceding basic math operators +  * /

andresbrocco
An efficient binaural spatializer
The "binauralModeledircam" object is a purevanilla implementation of the binaural model created at IRCAM.. An example of its capabilities can be found at this page.
The object is found at my repository: https://github.com/andresbrocco/binauralModeledpd
Main concept
Basically, it applies ITD and approximates the HRTF to a series of biquad filters, whose coefficients are avaliable here.
Sample Rate limitation: those coefficients work for audio at 44100Hz only!
Space interpolation
There is no interpolation in space (between datapoints): the chosen set of coefficients for the HRTF is the closest datapoint to the given azimuth and elevation (by euclidean distance).
Time interpolation
There is interpolation in time (so that a moving source sound smooth): two binauralModels run concurrently, and the transition is made by alternating which one to use (previous/current). That transition occurs in 20ms, whenever a new location is received.
Interface
You can control the Azimuth and Elevation through the interface, or pass them as argument to the first inlet.
Performace
Obs.: If the Azimuth and elevation does not match exactly the coordinates of a point in the dataset of HRTFs, the object will perform a search by distance, which is not optimal. Therefore, if this object is embedded in a higher level application and you are concerned about performance, you should implement a kd tree search in order to find the exact datapoint before passing it to the "binauralModeledircam" object.
Ah, maybe this statement is obvious, but: it only works with headphones!

andresbrocco
Just to document it here. If you want to create a hann window and store it in an array, you can do the following:

andresbrocco
@ddw_music I totally agree with you. That makes me nervous sometimes
Maybe @Miller Puckette could change this behaviour in future releases? I would be glad

andresbrocco
Thanks for replying, @ilpleut I've edited the original post!

andresbrocco
Hello, I made a patch to undo what [wrap~] does.
It basically remove discontinuities when the signal jumps from pi to pi or viceversa. As shown in the image below:
I personally needed for unwrapping phase before applying complex logarithm when I was trying to implement liftering in the complex cepstrum... (What didnt go so well, by the way...)
Hope it's useful for someone else  The patch is pure vanilla.

andresbrocco
There is an object in the iemmatrix that implements the fletcherMunson curve (equal loudness contour)... Take a look!

andresbrocco
@solipp, I want to get high resolution in both frequency and time.
So if I do an FFT after every block, I get high resolution in time, but the block is too small, so I zeropad it to increase frequency resolution.