Closed VeraE closed 8 years ago
Hm, I'm not sure when you need this inside the SFS Toolbox to load the impulse responses in their original length. Do you have an example? If it is necessary to have this we could move the zero-padding of the HRIRs to conf.N
inside if ~useoriglength
and adapt the new if condition for the length check.
By the way, this question would not arise if we didn't use conf.N... :)
Regarding the question of keeping conf.ir.useoriglength
, I'm also not sure what it is used for...?
You are probably right, we don't need this inside the Toolbox.
But as there are no other functions to work with SOFA files, I have also used get_ir()
in order to work with SOFA files. And in this case I used conf.ir.useoriglength
in order to get exactly the signal that is stored inside the SOFA file.
But I agree, we should remove this functionality.
Regarding conf.N
, I have to think about this and would propose to not include changes to it into this pull request.
Maybe we can also remove this from ir_correct_distance()
?
% Stop extrapolation for distances larger than 10m
if any(ir_distance>10)
ir_distance = min(ir_distance,10);
warning(['%s: Your desired radius is larger than 10m, but we will ', ...
'only extrapolate up to 10m. All larger radii will be set to ', ...
'10m.'],upper(mfilename));
end
I wouldn't mind if you want to hold on to the possibilty of loading SOFA files in their original condition via get_ir()
. It could be done as described above. But it would be cleaner without that.
The distance restriction to 10 m can be removed in my opinion. It would even be disturbing if you wanted to calculate something like an auralization of an image source model.
The problem of conf.N
is continued in #90, the rest can be merged.
It works nicely.
There is only one drawback of the current solution. As
ir_correct_distance()
now always returns an impulse response with the lengthconf.N
, there is no way to get the original impulse response from the SOFA file withget_ir()
. This was possible before, if you have specifiedconf.ir.useoriglength = true
and chosen the same distance for the desired impulse response as the measured impulse response provided.Do you think this is ok, and we should abandon that feature as you can simply set
conf.N
after the length you can lookup in the SOFA file. If so, would it also make sense to abandon theconf.ir.useoriglength
setting altogether?/cc @fietew