sfstoolbox / sfs-matlab

SFS Toolbox for Matlab/Octave
https://sfs-matlab.readthedocs.io
MIT License
96 stars 39 forks source link

Fix checking for correct sample length #158

Closed hagenw closed 7 years ago

hagenw commented 7 years ago

In ir_correct_distance() we are checking if conf.N is long enough for the needed delay. Delay is in seconds, but it is directly substracted from conf.N which is in samples.

This pull request should fix that.

fietew commented 7 years ago

It looks good, so far. I would suggest to change the if-condition into ir_origlength+delay*fs>conf.N. It took me a while to figure out the meaning of the current if-condition. This would be also in better alignment with the warning function-call afterwards: there it is also ir_origlength+delay*fs.

hagenw commented 7 years ago

Thanks, I updated the commit accordingly.