sfs-matlab icon indicating copy to clipboard operation
sfs-matlab copied to clipboard

delayline() is called twice for every impulse response in ir_wfs()

Open hagenw opened this issue 8 years ago • 3 comments

This is a follow up on #115.

There @VeraE wrote that delayline() gets called several times:

  1. when calculating the driving function,
  2. in ir_correct_distance()

One way to improve this might be to let ir_correct_distance() return delay and weight instead of the actual shifted impulse response. The downside is that this would complicate how get_ir() works as this would then need to return the unmodified impulse response and the delay and weight. I guess in this case it would even be better to remove ir_correct_distance() from get_ir() and apply it somewhere else.

Maybe we find a good solution for this, but in my opinion it would be also ok, to stay with the current state.

hagenw avatar Dec 06 '16 09:12 hagenw

The same problem applies to ssr_brs_wfs().

VeraE avatar Dec 06 '16 12:12 VeraE

I would not want to change how get_ir() works either. But I have the following suggestion: The only delay that should be returned from ir_correct_distance() is the one that can be caused by delayline(), I think. So this should be returned from ir_correct_distance() to get_ir() to ir_generic() where it can be added to the delay returned by driving_function_imp_wfs(). What do you think?

VeraE avatar Dec 06 '16 12:12 VeraE

Ah ok, now I see the real problem. I thought it was just a problem performance wise. But the problem is of course that delayline() can add a processing delay already inside ir_correct_distance(). So the only solution seems indeed to return that delay in ir_correct_distance() and pass it on. I do not like that very much as it add a returning parameter to get_ir() that you would not expect there, but I have no better proposal at the moment.

hagenw avatar Dec 06 '16 13:12 hagenw