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

Complex coefficients are not read correctly from file #173

Open
chipmuenk opened this issue Apr 7, 2020 · 5 comments
Open

Complex coefficients are not read correctly from file #173

chipmuenk opened this issue Apr 7, 2020 · 5 comments
Labels
bug CSV related to reading / writing CSV files

Comments

@chipmuenk
Copy link
Owner

CSV files with complex data is not read correctly, only the real part of the first row is read, further rows are discarded without warning.

@chipmuenk chipmuenk added the CSV related to reading / writing CSV files label Apr 7, 2020
@guillaumedavidphd
Copy link

I'd love to be able to load a complex filter, from CSV or any other format. At the moment everything is cast to float. I could help if you point me in the right direction.

@chipmuenk chipmuenk changed the title Complex data in CSV file is not read correctly Complex coefficients are not read correctly from file Jan 20, 2022
@chipmuenk
Copy link
Owner Author

chipmuenk commented Jan 20, 2022

Thanks for reminding me of that issue :-) You're right, complex coefficients are parsed incorrectly not only in CSV format. However, saving complex coefficients works and poles / zeros (which usually are complex) are read back correctly. I updated the title accordingly.

Given that most of the functionality works, I hope that this bug is relatively easy to fix. I didn't know whether anyone needed this functionality so I focussed on other stuff. Unfortunately, I'm quite busy till the weekend but I'll try to give you a pointer then.
Your help is very appreciated!

The culprit might be one of the library routines pyfda_lib.fil_save() or pyfda.fil_convert() which convert sos <-> ba <-> PZ formats. If you like, you can start by checking these functions.

When fixing the complex import bug, I'll also look at another intermittent bug that occurs when switching between manual entry of IIR and FIR filters in the coefficient tab. And I'll take a look into saving coefficients in sos format which is another request.

@chipmuenk chipmuenk added the bug label Feb 11, 2022
@guillaumedavidphd
Copy link

What's the status on complex coefficients? You mentioned you would give me some pointer to get me started on this, but that was a while back. I'm still interested in helping if I can.

@chipmuenk
Copy link
Owner Author

I had thought it would be easier to solve this - unfortunately the coefficient widget handles fixpoint quanization as well, and in the process I've created a horribly entangled code. I would be interested in untangling this mess but this is really ugly.
You could take a look into input_widgets/input_coeffs.py and tell me what you think.

@guillaumedavidphd
Copy link

I had a look. Unfortunately I'm lacking the time to untangle the code. Somehow I though the effort would be less than what it is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug CSV related to reading / writing CSV files
Projects
None yet
Development

No branches or pull requests

2 participants