fgnt / nara_wpe

Different implementations of "Weighted Prediction Error" for speech dereverberation
MIT License
494 stars 164 forks source link

Iteration running on Numpy Online example #34

Closed kanthasamyiit closed 5 years ago

kanthasamyiit commented 5 years ago

Hi. Thanks for this great tool. When I run numpy online example notebook, an iterator runs ( 986it [00:30, 32.21it/s] ). Online implementation is supposed to be non-iterative (according to the paper). Right? Also, I noticed, Numpy offline is much faster than Numpy online. I expected the opposite. Is there anything I should edit to avoid iterating? Thanks. Kanthasamy

LukasDrude commented 5 years ago

Dear kanthasamyiit,

thank you for your interest in Nara-WPE. Let me clarify a few things:

Offline-WPE estimates parameters with an EM algorithm. Therefore, it consists of several EM iterations. The online-implementation only uses one EM iteration (the power estimate is not updated again). The progress bar you are seeing in the example counts the number of frames the algorithm goes through: in an online algorithm you move from frame to frame, the speed is then basically 32.21 frames/s on your machine. Whether this is real-time ready or not is a different matter. The term online-WPE only states, that it is capable to make predictions per frame without looking into the future (just as in the Google Home paper from 2017).

The offline-WPE version is indeed much faster because it can access all frames at once and does not need to move forward step by step. Although it is faster, it is not applicable in an online scenario because it looks into the future to predict the current frame output. Further, the offline version is better tuned.

Let us know if you need further details, e.g. ideas how to speed up the online implementation.

kanthasamyiit commented 5 years ago

Hi LukasDrude. Thank you for the clear answers. As a newbie to the field, it was very helpful to read your comment. Now, I understand the difference between online and offline processing. I just downloaded the 'Acoustic Modelling for Google Home' - paper. Thanks for the reference. I am certainly interested in ways to speed up the algorithm for real time processing with smaller delays. Could you please point me to any papers/resources in that direction if possible? That will be very helpful!

boeddeker commented 5 years ago

Dear kanthasamyiit, thanks for your interest. When you want to think about real time processing, there are multiple things to consider:

I hope this gives you a starting point. A hint from my side, I do not recommend taking this to start in this area. Speed optimizations are always difficult and require much testing if it still works, if it is faster, if it is numerically accurate and if the code is still readable.

Feel free to ask more questions.

kanthasamyiit commented 5 years ago

Hi boeddekar. Thanks for the detailed answers. I am looking to develop a c++ version (float32 is sufficient enough). I am looking for low latency implementation for real time processing. I am looking for a computationally cheaper algorithm. Let me explore more algorithms and come back to you. Thanks!