Home

Awesome

pyfda

Python Filter Design Analysis Tool

PyPI version Downloads/mo. MIT licensed ReadTheDocs build_pyinstaller build_flatpak

<!-- ![Total Github Downloads](https://img.shields.io/github/downloads/chipmuenk/pyfda/total?label=Total%20Github%20Downloads) --> <!-- [![Join the chat at https://gitter.im/chipmuenk/pyFDA](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/chipmuenk/pyFDA?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -->

pyfda is a tool written in Python / Qt for analyzing and designing discrete time filters with a user-friendly GUI. Fixpoint filter implementations (for some filter types) can be simulated and tested for overflow and quantization behaviour in the time and frequency domain.

Screenshot

<table> <tr> <td><img src = "docs/source/screenshots/pyfda_screenshot_specs_3d_surface.png" alt="Screenshot pyfda, specifications and 3d surface plot" width=300px></td> <td><img src = "docs/source/screenshots/pyfda_screenshot_specs_yn.png" alt="Screenshot pyfda, specs and transient response" width=300px></td> <td><img src = "docs/source/screenshots/pyfda_screenshot_ba_yn_fir.png" alt="Screenshot pyfda, coefficients and transient response" width=300px></td> </tr> <tr> <td><img src = "docs/source/screenshots/pyfda_screenshot_pz_3d_contour.png" alt="Screenshot pyfda, poles / zeros and 3D contour plot" width=300px></td> <td><img src = "docs/source/screenshots/pyfda_screenshot_coeffs_pz.png" alt="Screenshot pyfda, coefficients and pole-zero-plot" width=300px></td> <td><img src = "docs/source/screenshots/pyfda_screenshot_info_pz_hf.png" alt="Screenshot pyfda, infos and pole-zero-plot with embedded amplitude magnitude" width=300px></td> </tr> <tr> <td><img src = "docs/source/screenshots/pyfda_screenshot_pz_yn_cmplx_stim.png" alt="Screenshot pyfda, poles / zeros and transient response with complex stimulus" width=300px></td> <td><img src = "docs/source/screenshots/pyfda_screenshot_fix_yn_t.png" alt="Screenshot pyfda, fixpoint and transient response" width=300px></td> <td><img src = "docs/source/screenshots/pyfda_screenshot_fix_yn_f.png" alt="Screenshot pyfda, fixpoint and transient response (frequency)" width=300px></td> <tr> </table>

License

pyfda source code ist distributed under a permissive MIT license, binaries / bundles come with a GPLv3 license due to bundled components with stricter licenses.

Installing, running and uninstalling pyfda

For details, see INSTALLATION.md.

Binaries

Binaries can be downloaded under Releases for versioned releases and for a latest release, automatically created for each push to the main branch.

Self-extracting archives for 64 bit Windows, OS X and Ubuntu Linux are created with pyInstaller. The archives self-extract to a temporary directory that is automatically deleted when pyfda is terminated (except when it crashes), they don't modify the system except for two ASCII configuration files and a log file. No additional software / libraries need to be installed, there is no interaction with existing python installations and you can simply overwrite or delete the executables when updating. After downloading the Linux archive, you need to make it executable (chmod 775 pyfda_linux).

Binaries for Linux are created as Flatpaks as well (currently broken) which can also be downloaded from Flathub (also broken). Many Linux distros have built-in flatpak support, for others it's easy to install with e.g. sudo apt install flatpak. For details check the Flatpak home page.

pip

Python 3.8 and above is supported, there is only one version of pyfda for all operating systems at PyPI. As pyfda is a pure Python project (no compilation required), you can install pyfda the usual way, required libraries are downloaded automatically if missing:

> pip install pyfda

Upgrade:

> pip install pyfda -U

Uninstall:

> pip uninstall pyfda
<!-- If you have cloned `pyfda` to your local drive you can install the local copy (i.e. create local config files and the `pyfdax` starter script) via > pip install -e <YOUR_PATH_TO_PYFDA_setup.py> -->

Starting pyfda

A pip installation creates a start script pyfdax in <python>/Scripts which should be in your path. So, simply start pyfda using

> pyfdax

The following libraries are required and installed automatically by pip when missing.

Optional libraries:

conda

If you're working with Anaconda's packet manager conda, there is a recipe for pyfda on conda-forge since July 2023:

> conda install --channel=conda-forge pyfda

You should install pyfda into a new environment to avoid unwanted interaction with other installations.

git

If you want to contribute to pyfda (great idea!), fork the latest version from https://github.com/chipmuenk/pyfda.git and create a local copy using

> git clone https://github.com/<your_username>pyfda

This command creates a new folder pyfda at your current directory level and copies the complete pyfda project into it. This Github tutorial provides a good starting point for working with git repos.

pyfda can then be installed (i.e. creating local config files and the pyfdax starter script) from local files using

> pip install -e <YOUR_PATH_TO_PYFDA_setup.py>

Now you can edit the code and test it. If you're happy with it, push it to your repo and create a Pull Request so that the code can be reviewed and merged into the chipmuenk/pyfda repo.

Building pyfda

For details on how to publish pyfda to PyPI, how to create pyInstaller and Flatpak bundles, see BUILDING.md.

Customization

The location of the following two configuration files (copied to user space) can be checked via the tab Files -> About:

Layout and some default paths can be customized using the file pyfda/pyfda_rc.py, at the moment you have to edit that file at its original location.

Features

Filter design

User Interface

Graphical Analyses

Import / Export

Target group

Release History

For details, see CHANGELOG.md.

Planned features (help wanted)