Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bottleneck in RLS filter #1

Closed
kristoferm94 opened this issue Nov 15, 2016 · 2 comments
Closed

Bottleneck in RLS filter #1

kristoferm94 opened this issue Nov 15, 2016 · 2 comments
Assignees
Labels

Comments

@kristoferm94
Copy link

kristoferm94 commented Nov 15, 2016

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).

@matousc89
Copy link
Owner

Thank you for pointing that out. In new version it will be corrected.

@matousc89 matousc89 self-assigned this Nov 16, 2016
@matousc89 matousc89 added the bug label Nov 16, 2016
@matousc89
Copy link
Owner

Solved in version 0.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants