chipmuenk / pyfda

Python Filter Design Analysis Tool
http://chipmuenk.github.io/
MIT License
655 stars 94 forks source link

Allow longer impulse / transient response timescales #245

Closed JSandrock closed 5 months ago

JSandrock commented 8 months ago

If I'm not missing some crucial setting, the time axis for filter response plots seems to be limited to a maximum of 99 time steps right now. For slow filters with low fc a higher value would be pretty helpful.

The settings dialog does allow to change x axis min and max values, but when you set a value above 99 time steps it just resets that value to said 99 steps.

Would it be possible to increase the maximum timescale?

Ekundayo39283 commented 7 months ago

It sounds like you're encountering a limitation in the filter response plots regarding the time axis. Increasing the maximum timescale beyond 99 steps could indeed be helpful, especially for slow filters with low cutoff frequencies.

chipmuenk commented 7 months ago

To my understanding this is a UI problem, not a technical problem: You should be able to increase the length of the x-axis by increasing the value in the "N" field from 0 (automatic length setting) to any value you need.

You are right, however, in "automatic" mode (N = 0), the default length for the x-Axis is either the order of the FIR filter (= length of the impulse response) or 100 data points, whatever is less. You can override this easily by entering a new value in the N box, but it seems this is not self-explanatory as I've had this discussion with other users before.

Which behaviour would you expect / like? For IIR filters, there is no easy solution as their impulse response is infinite in theory. For FIR filters, the impulse response can be quite long (> 1000) so I limited this quite arbitrarily to 100. Of course, it would be easy to remove this initial limitation. Alternatively, I could use an initial setting of N = 100 for all filters.

The following image shows the impulse response of a FIR filter with order 248 in logarithmic scale with N = 270 data points on the x-axis.

pyfda_n_270

JSandrock commented 7 months ago

Indeed, you are absolutly correct. I simply overlooked that parameter N down there. If you know about it, it completly makes sense. I guess I did not correlate it with the simulation time, because the default value was 0. As a sugestion to help new users, maybe you could always show the actually used value there instead of 0? To enable automatic mode an additional toggle box "auto length" or something similar might be needed in that case. Anyway, thanks for your answer and explanation, I really like your tool =)

chipmuenk commented 5 months ago

This has been fixed by a hopefully clearer UI and will be contained in v0.9.0