You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was running your RLS filter on large input and desired output signals (index length c.a. 700k) and noticed that the filter was pretty slow compared to Matlab (c.a. 1-2 hours vs. 5-10 seconds).
Hi,
I was running your RLS filter on large input and desired output signals (index length c.a. 700k) and noticed that the filter was pretty slow compared to Matlab (c.a. 1-2 hours vs. 5-10 seconds).
After looking through https://github.com/matousc89/padasip/blob/master/padasip/filters/rls.py, I noticed that there is a bottleneck in line 123
self.w_history[k:] = self.w
This line inserts w into the kth row and all the rows after the kth one for each k (time complexity O(N^2) where N is the signal length)
This bottleneck can be solved by adding a comma to line 123:
self.w_history[k, :] = self.w
that is, insert w only into the kth line in w_history (worst case time complexity O(M) where M is the filter length?)
After changing this line, the filter performed much faster (5-10 seconds like Matlab's RLS filter).
The text was updated successfully, but these errors were encountered: