Closed Toby990 closed 8 years ago
Hi, The way we use the hrtfs is not a standard. We convert the impulses into 1 big matrix in the harmonics domain, here a pseudo code :
harmos[0] = 1.f; for(i = 0; i < number of harmonics; i++) { if(i != 0) { harmos[i-1] = 0.f; harmos[i] = 1.f; } decoder.process(harmos, channels); for(j = 0; j < number of samples by impulse; j++) { left = 0.; right = 0.; for(k = 0; k < number of channels; k++) { right += channels[k] * impulse_r[k][j]; // << inpulse right [channels, sample index] left += channels[k] * impulse_l[k][j]; // << inpulse left [channels, sample index] } matrix[j * number of harmonics + i] = value_left; matrix[(j + number of samples by impulse) * number of harmonics + i] = value_right; } }
If you want to change the HTRF you'll have to change the matrix in the hrtf.hpp file and the macro in the decoder.hpp file if the impulse size or the order are different. for 2D :
for 3D :
Ok, but I don't understand use of impulses. How the HRIR for particular azimuth angle is considered?
Each impulse matches with a "virtual" loudspeaker (or output channel). You have to configure the decoder with the angles of the impulses. If you just want to try several hrtfs, you can create a PD or Max patch and use the c.convolve~ external to apply the filters : For example :
"I have found a thesis (www.ambisonia.com/Members/DrWig/bwphdthesis.pdf) where (chapter 4, page 104) is an equation 4.2. Are these operations exactly the same to what you wrote in pseudo code?"
Hi, Yes, this seems to be the same thing. We compute the harmonic coefficients of each set of samples (I mean that all the first samples of the impulse responses give a first set of coefficients, and all the second samples give a second set, etc.) for the two ears and we fill a matrix with the results (cf speudo code) . Then, the only complex thing that we do is in the "perform" method where we take advantage of the matrix optimizations of the blas library to perform the convolutions.
Hi if you have Xcode, you can have a look at https://github.com/CICM/HoaLibrary-Tools. The subject class generates the HRIRs. Cheers
Hi, I know where hrtf impulses are stored and that there are in harmonics domain. I'd like to try this measurments https://dev.qu.tu-berlin.de/projects/measurements/repository/show/2010-11-kemar-anechoic, but don't know if they are in the same domain and if not how to convert them.
I need some pointers, articles which describe hrtf impulses, so I could understand it. The way hoa-library use these impulses is some kind of standard?
I hope you could help me.