nelson-lang / nelson

The Nelson Programming Language
https://nelson-lang.github.io/nelson-website/
GNU Lesser General Public License v3.0
92 stars 16 forks source link

Function "bode" does not unwrap phase #1210

Closed rdbyk closed 4 months ago

rdbyk commented 4 months ago

To Reproduce Screenshot from 2024-06-04 16-01-39

Expected behavior Screenshot from 2024-06-04 15-59-45

Desktop (please complete the following information):

Additional context Please note, that M****b has an "unwrap" function as well.

Nelson-numerical-software commented 4 months ago

https://koor.fr/Python/API/scientist/numpy/unwrap.wp

Nelson-numerical-software commented 4 months ago

any chance that you contribute to this code ? :) @rdbyk

rdbyk commented 4 months ago

May be ;-)

I thought about using/porting

https://github.com/gnu-octave/octave/blob/7b28e1948cffb91871e818009e5a1eb4b265cec6/scripts/signal/unwrap.m#L1

I will have a look, but it may take some time ...

Nelson-numerical-software commented 4 months ago

no time pressure :)

rdbyk commented 4 months ago

A minimal solution to fix the bode function regarding phase unwrapping

https://github.com/rdbyk/nelson/commit/38cf6880502d512432c85257e75b0e92dca6099a

Nelson-numerical-software commented 4 months ago

@rdbyk thanks. Do you want to create a PR from your repo or create it ? :)