Giter Club home page Giter Club logo

Comments (11)

chipmuenk avatar chipmuenk commented on July 24, 2024

That's indeed on my todo list for quite a while now. Currently, I'm working on some file I/O issues and I'm planning to add an export option for coefficients in second-order sections format (i.e. biquads). What would be most useful to you - exporting

  • SOS coefficients as floats
  • SOS coefficients as integers (this probably requires an additional gain factor per section to overcome scaling issues)
  • header files with the coefficients in C format (example needed)
  • C files with the actual filter topology (example needed, maybe even as a template as I'd like to generate ready to use filters from templates)

Contributing examples and / or templates would be most helpful!

from pyfda.

PAk-CatchFire avatar PAk-CatchFire commented on July 24, 2024

Thank you @chipmuenk

Actually I plan to use it for ARM CMSIS in floating point (f32) format (I don't use integer for signal processing anymore), where probably the most common way is direct form II.
https://www.keil.com/pack/doc/CMSIS/DSP/html/group__BiquadCascadeDF2T.html

To help you, maybe this blog post is quite interesting:
http://gaidi.ca/weblog/implementing-a-biquad-cascade-iir-filter-on-a-cortex-m4

also linking to this other post (where an octave implementation is also presented):
https://hackernoon.com/fast-iir-filtering-on-arm-cortex-m-with-cmsis-dsp-and-gnu-octave-qk1n3y66

Here the Github:
https://github.com/matteoscordino/iir-designer-cmsis-dsp?ref=hackernoon.com

From my point of view, pyfda will have a lot of acceptance within the ARM community with this Biquad feature!!

PS: This link is also nice for an example:
http://gaidi.ca/weblog/implementing-a-biquad-cascade-iir-filter-on-a-cortex-m4

from pyfda.

PAk-CatchFire avatar PAk-CatchFire commented on July 24, 2024

In case it helps with python, a couple of links from ARM, where even the CMSIS library could be used from python with a wrapper:

https://developer.arm.com/documentation/102463/0100

https://developer.arm.com/documentation/102463/0100/How-to-implement-biquads-to-filter-an-Electrocardiography-signal

and a PDF (however for df1, not df2):
https://developer.arm.com/-/media/Arm%20Developer%20Community/PDF/How%20to%20use%20the%20Python%20wrapper%20for%20CMSIS-DSP%20with%20biquads%20as%20an%20example.pdf?revision=9a6360f1-e2eb-4d18-83d2-3825c9486dc1

from pyfda.

chipmuenk avatar chipmuenk commented on July 24, 2024

Thanks for all the links! If I understand you correctly, you would like to get the biquad coefficients in the format
{b10, b11, b12, a11, a12, b20, b21, b22, a21, a22, ...} as floats as described in https://www.keil.com/pack/doc/CMSIS/DSP/html/group__BiquadCascadeDF2T.html ? That should be possible without a big effort.

from pyfda.

PAk-CatchFire avatar PAk-CatchFire commented on July 24, 2024

Yes, that could be a fantastic direct first step.

The idea later could be to use the CMSIS library wrapper for testing the embedded library coefficients with your graphic tool - so powerful and handy!!

Again, congratulations on your work on this awesome tool. I will use it with some of our internship students for filter designing (I try to avoid MATLAB as much as possible to provide them opensource engineering tools).

from pyfda.

PAk-CatchFire avatar PAk-CatchFire commented on July 24, 2024

Hello Christian.
I wonder if you had the time to include the biquad filters for ARMs processors.

Best regards

from pyfda.

PAk-CatchFire avatar PAk-CatchFire commented on July 24, 2024

Hello @chipmmuenk, do you plan on a new release any time soon?

Best Regards

from pyfda.

chipmuenk avatar chipmuenk commented on July 24, 2024

Sorry for leaving you waiting for so long - I'm justing implementing some Github Actions at the moment to automate building and releasing to PyPI and then there will be a full new release during the next week. The main branch already contains the CMSIS export, somewhat hidden in the CSV options and is fully functional. In my opinion a new tab / subwidget is required in the future to allow a.o. selecting the order of second order sections and setting fixpoint options.

from pyfda.

PAk-CatchFire avatar PAk-CatchFire commented on July 24, 2024

Thank you.
I am converting Pyfda in my preferred tool for filter designing (so fast and powerful!!)
However, I don't see how to get the CMSIS format export in the CSV.

What I see is the same coefficients as the npy format when I import it in python:
image

Maybe I am missing something?

On the other hand, do you have a time frame for implementing in the GUI the Biquad Cascade IIR Filters Using a Direct Form II Transposed format?
Like in Matlab:
https://es.mathworks.com/help/dsp/ref/dsp.biquadfilter-system-object.html

I am seeing that many embedded applications are porting into this format because they are a quite efficient implementation.

Regards

from pyfda.

chipmuenk avatar chipmuenk commented on July 24, 2024

I've started working on fixpoint filters again. The export option for CMSIS SOS format is implemented for quite a while now but it is hidden somewhat: Open CSV option (the little cog) in the b,a tab and select CMSIS SOS format.

Does this export format work for you?

Regards

from pyfda.

chipmuenk avatar chipmuenk commented on July 24, 2024

Since v0.9.0b1, coefficients can be saved directly in CMSIS SOS format via "save coefficients".

from pyfda.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.