Improve lfilter functional (#374)
* Simplify lfilter functional * use `torch.clamp` instead of `torch.min(..., torch.max(...))` * remove unneeded creation of ones tensor for previous method The current lfilter function uses min and max to essentially do a clamp function. I changed the code to use clamp instead. It is more readable than the previous version. FYI, if you want to keep the previous way, you could make a broadcastable tensor of size 1 instead of creating a tensor the size of the input. Signed-off-by:David Pollack <david@da3.net> * Parallelize waveform windows calculation I've parallelized the calculation of the waveform windows and also removed the inefficient calculation within the for-loop. Signed-off-by:
David Pollack <david@da3.net> * Refactoring and minor readability changes Signed-off-by:
David Pollack <david@da3.net> * Remove one more creation of a temporary tensor Signed-off-by:
David Pollack <david@da3.net>
Showing
Please register or sign in to comment