davircarvalho / Individualized_HRTF_Synthesis

Synthesis of individualized HRTFs based on Neural Networks, Principal Component Analysis and anthropometry
GNU General Public License v3.0
62 stars 7 forks source link

Spatialy Resampled HRTF has different HRIR Length, and Equalisation #11

Open ABoredBunny opened 1 year ago

ABoredBunny commented 1 year ago

While using a Spatially Resampled HRTF(SRH) with OpenAL. I noticed it doesn't sound right. So then I tried to use the SRH in other software.

I saw that it truncated the HRIR length to 256 samples. But that seems to be the smallest issue.

The bigger one is that the SRH, had massive differences in frequency.

thingy

I used the 5 Degree resample but it also happens with others.

davircarvalho commented 1 year ago

Sorry I'm not sure if I understand exactly the issue you're reporting.

Please clarify what are you observing and how that differs to what you expected, and also what are the configurations or the steps you've used to come to observe the issue.

Thank you

davircarvalho commented 1 year ago

by the way, what matlab version are you using?

ABoredBunny commented 1 year ago

When I use the function to generate an HRTF with equaly spaced points in the gui.

The generated HRTF has a shorter impulse length. But it also has different Equalisation.

The image shows the difference. I used the SPARTA Binauralizer plugin with a point in the default position. I created two instances one with the resampled HRTF and one with the normally generated. I fed both white noise. There's a massive difference in sound between both of these, the left version is the one that comes out when NOT using this function: Unbenannt The other is the result of using it. There's both a massive bass and high cut. Also at least SPARTA AmbiBIN reports a HRIR length of 256 instead of 3200.

The Matlabs version is the one that comes with your installer, so I believe v911.

My expected result is that if I use this function I will get an HRTF that is identical to the one normaly generated, but with equally interpolated points.

davircarvalho commented 1 year ago

For some reason the low frequency extension was't being preserved when doing the interpolation afterwards and was causing the issue with the custom grid.

This was address in the latest release.

ABoredBunny commented 1 year ago

Didn't seem to fix it. Also, now it doesn't auto install Matlabs.

HRIR Length is still cut down to 256 instead of 3200

To test I used two Sparta Binauralizer set to stereo(30, -30). One without Custom grid one with. I generated SOFA files using the latest release version of this software. I downloaded MATLABS 9.13(because the EXE ask for it) I used the default values inside the software this time. Resampled the SOFA to 48000 because it would crash the software at 44100.

There's still a difference in how they sound(fed White Noise) NOPER

I rendered an exert from Holst Mars as an example. The difference is hearable(It even affected the size of the flac file.)

UNINTERPOLATED HRTF.zip

INTERPOLATED HRTF.zip

davircarvalho commented 1 year ago

there's only one operation difference between the custom grid and the default one, the interpolation. The interpolation now is the first process once the sofa object is assembled. after that all the post processing is the same.

I did all this tests before making the release, I really don't understand why you're experiencing this.

having a shorter length is not a problem, but it tells me the interpolation is happening after the low frequency extension (also not a problem), which doesn't make sense as I've changed that in the last release.

I don't know if sparta is doing something funny either. I'll try to have a look at the files you sent later today

About having to download Matlab, that's expected as the last release was a while ago and it was under a different Matlab version, I never compile with runtime built-in because it makes huge files which are anoying to share.

ABoredBunny commented 1 year ago

It does sound more accurate in OpenAL now(which is what is important, Sparta can use the uninterpolated file).

It is fine if you don't want to include the runtime. But at least link to it. This software is the most convenient middle ground between a generic HRTF, and the higher end methods that involve a lot of work and processing power or a lot of money.

So making it accessible even for Computer Noobs, would be good.

Just wanted to thank you again for making it.