ami-iit / bipedal-locomotion-framework

Suite of libraries for achieving bipedal locomotion on humanoid robots
https://ami-iit.github.io/bipedal-locomotion-framework/
BSD 3-Clause "New" or "Revised" License
132 stars 36 forks source link

Implement the prewrapping in the butterworth filter #841

Closed GiulioRomualdi closed 2 months ago

GiulioRomualdi commented 2 months ago

This pull request introduces the prewrapping technique, enhancing the frequency response consistency of filters across continuous and discrete domains. By implementing this technique, we ensure uniform performance across different signal representations.

filter

The above plot demonstrates the application of the prewrapping technique, resulting in an improvement in the step response of the filter.

Additionally, this PR addresses an issue related to the setInput() method, particularly its compatibility with fixed-size Eigen::Vectors.

[!IMPORTANT]
By implementing the prewrapping technique, the Butterworth filter now produces results identical to those obtained using MATLAB with the following command:

[z_d,p_d,k_d] = butter(order, cutoff_frequency / (sampling_frequency / 2));

This equivalence holds when the same order, cutoff_frequency, and sampling_frequency parameters are used.