psambit9791 / jdsp

A Java Library for Digital Signal Processing
https://jdsp.dev
MIT License
240 stars 45 forks source link

[fixes #26] Implement LMS & NLMS adaptive filter #30

Closed SiboVG closed 2 years ago

SiboVG commented 2 years ago

This PR implements the LMS and NLMS adaptive filter.

@psambit9791 in the light of how padasip implements its functions, I used a 'run()'-method for running the filtering algorithm. This got me thinking whether it would be an idea to use this terminology in the other classes as well? So instead of having to call the 'dft()'-method on a DiscreteFourier-object, you would just have to call the 'run()'-method. In this way, the user only has to "remember" one method, i.e. the run-method, instead of knowing 'I have to run 'dft()' for a DiscreteFourier, stft() for ShortTimeFourier etc. I think this could generalize and simplify jDSP. What is your opinion on this?

psambit9791 commented 2 years ago

So, regarding your comment about using 'run()', the latest commit on master converts all "dft()" "hilbert()" etc to simply "transform()" based on the sklearn implementations of some similar functions.

So at the moment, building any object of the transform package and calling the transform() function using the object would run the specific transform. Chose transform() instead of run() because it seemed more intuitive.

SiboVG commented 2 years ago

Ah alright, wasn't aware of that change, great :) you wanna change all the methods for the filters to 'filter()' then

psambit9791 commented 2 years ago

That would make sense. But think it should be limited to the adaptive filters for now. The IIR filters have different initialisation depending on the type of filter so I would let them be as they are.

SiboVG commented 2 years ago

Alright, latest commit fixed it