Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 05 17:26

    chipmuenk on develop

    clean up imports Signed-off-by:… Replace checkboxes by pushbutto… (compare)

  • Dec 05 16:11

    chipmuenk on develop

    eliminate logging statements to… update docstrings Signed-off-by… remove shared memory fb.fx_stim… (compare)

  • Dec 05 07:09

    chipmuenk on develop

    Reduce logging messages Signed-… Fuse impz() and impz_fx() into … add new data exchange fb.fx_sti… and 2 more (compare)

  • Dec 03 08:28

    chipmuenk on develop

    replace stop by play icon, func… Clean up logging statements Sig… (compare)

  • Dec 02 17:50

    chipmuenk on develop

    increase margins for some butto… streamline code a little Signed… (compare)

  • Dec 01 08:41

    chipmuenk on master

    allow writing "j" for imaginary… Merge branch 'develop' of https… fix some formatting issues Sign… and 23 more (compare)

  • Dec 01 08:41

    chipmuenk on develop

    replace time.perf_counter_ns() … rename update_fx_ui() -> update… update some comments Signed-off… and 1 more (compare)

  • Nov 30 21:27

    chipmuenk on develop

    Change button state "failed" to… make behaviour of run / autorun… fix formatting errors Signed-of… and 10 more (compare)

  • Nov 28 17:43

    chipmuenk on develop

    fix visibility of E_x button an… (compare)

  • Nov 27 14:23

    chipmuenk on develop

    update docstring (compare)

  • Nov 26 08:20

    chipmuenk on develop

    Change icon of run button to "s… Fix auto selection of frame len… Add stop icon Signed-off-by: Ch… (compare)

  • Nov 25 16:50

    chipmuenk on develop

    allow writing "j" for imaginary… Merge branch 'develop' of https… fix some formatting issues Sign… and 1 more (compare)

  • Nov 25 08:43

    chipmuenk on master

    formatting updates Signed-off-b… Operate fixpoint filters with Q… clean up code Signed-off-by: Ch… and 31 more (compare)

  • Nov 25 08:43

    chipmuenk on develop

    Reduce width of progress bar Si… (compare)

  • Nov 24 11:33

    chipmuenk on develop

    change initial settings Signed-… (compare)

  • Nov 22 16:24

    chipmuenk on develop

    reduce logging noise, update co… (compare)

  • Nov 22 15:11

    chipmuenk on develop

    process signals from local fx w… emit {'fx_sim': 'specs_changed'… (compare)

  • Nov 19 13:35

    chipmuenk on develop

    fix wrong name in signal, preve… Fix HDL creation widget becomin… Update docstrings Signed-off-by… and 4 more (compare)

  • Nov 18 12:25

    chipmuenk on develop

    only print first dict_sig k,v; … Only emit a signal when widgets… reformatting Signed-off-by: Chr… and 5 more (compare)

  • Nov 18 04:32
    chipmuenk commented #205
Sriyash Caculo
@sriyash25
I will take this up again with my prof. If it doesn't work out, using the existing boards as a last resort should be okay?
Christopher Felton
@cfelton
i am not familiar with Trello - can't say one way or the other.
@sriyash25 yes that would be fine
Christian Münker
@chipmuenk
@sriyash25 : for me too
Christopher Felton
@cfelton
@sriyash25 note you should create a blog in the next week or two, simply stating who you are and what you are doing, etc.
then you can post the blog to LibreCores as your introduction
if you want you can post your blogs here: https://www.dsprelated.com/
I would prefer you post your blogs at dsprelated but I am ok with others as well.
Sriyash Caculo
@sriyash25
@cfelton Yes, the first post could just be a summery of the project and a bit of introduction?
Christopher Felton
@cfelton
yes
Sriyash Caculo
@sriyash25
Great, will stick to dsprelated
Christopher Felton
@cfelton
I would keep the post simple, it can be hard, but state only the 100% items
possibly the first two items for the project and leave the third unstated for now
Sriyash Caculo
@sriyash25
yes, got it
Christopher Felton
@cfelton
leave the external expectations low
Sriyash Caculo
@sriyash25
also, slightly unrelated topic, needed confirmation on filter order for implementation? The previous attempt, if I may call it so, was 2nd order filter implementation only. How do I go about implementing different orders to interface with pyfda?
Christopher Felton
@cfelton
most practical implementations are cascaded 2nd order filters (second order sections)
Sriyash Caculo
@sriyash25
@chipmuenk I'm not familiar with trello, don't mind trying.
@cfelton right, I'll stick to 2nd order in that case
Christopher Felton
@cfelton
we should be able to make it general enough for any order (but there will probably be intermediate value overflows or very large word widths)
Christian Münker
@chipmuenk
I suggest starting with a simple direct form topology
to gain experience with filters with parametrized order in myhdl, never mind that practical iir filters are usually not implemented that way.
Sriyash Caculo
@sriyash25
@chipmuenk Should I try interfacing a simple moving average filter?
Sriyash Caculo
@sriyash25
The HDL generation seems to be working although I haven't actually checked if the results are accurate.
Christian Münker
@chipmuenk
Yes, you could start with simple FIR-filter if that's what you mean - some books refer to FIR filters as "moving average" or "MA". In pyfda, the term moving average filter is used more strictly for a filter where all coefficients are 1. This should be implemented accordingly with a simple accumulator in HDL.
For a start, you could restrict your filter to a fixed order of say 10, then we should discuss with @cfelton how to parametrize the order.
Christopher Felton
@cfelton
I think there is a general design topic that needs to be determined - should the digital circuit blocks be encapsulated in an object (the original example) or a block with a parameter object.
for the first examples might seem overkill, having a few arguments would suffice
in the long term the filter-blocks should receive design parameters from pyfda and have the ability to send simulation data, etc. back.
Christian Münker
@chipmuenk
I really haven't worked with myhdl blocks so I don't know their limits. The API seems nice though. Wouldn't it be worth a try to design a simple implemementation (DF FIR filter ;-) ...) using a myhdl block to gain a better understanding? The time wouldn't be lost as we have to specify + improve the interface between myhdl and pyfda anyway.
BTW: I'm currently finishing a new pyfda release with some changes to the HDL generation part. Hopefully you haven't started to dig into that part too much.
Christopher Felton
@cfelton
the block decorator doesn't provide much to the user, it is really an internal myhdl thing to simplify some things, it is nice because in explicitly labels functions/methods that are myhdl.blocks
I think the best method, is to implement the digital hardware descriptions like the example I posted, but then to create a class that will encapsulate the parameters, control, and status of the filter creation
the API to pyfda will be provided by these objects and they can be coded here https://github.com/cfelton/filter-blocks/tree/master/filter_blocks/fda
Christopher Felton
@cfelton
the link shows the block usage, not the FIR implementation
Christian Münker
@chipmuenk
Only had the time for a quick look: Looks clear & good, I would only suggest handling the float -> integer conversion of coefficients in pyfda so that the user can make a first estimation whether coefficient quantizations has an disastrous effect. It would also be nice if quantization parameters (e.g. accumulator wordlength and requantization method like floor, fix etc) could be controlled via the ui.
Currently, I'm developing in the branch 'hdl_interface', I've renamed the directory with the fixpoint implementations and some files and I'm in the process of redesigning where and how pyfda looks for user files at startup. Perhaps you can take a look before I merge some time next week.
Christopher Felton
@cfelton
@sriyash25 @chipmuenk we started a discussion, how to pass all the parameters to the filter-blocks
one idea is to have a class that can be used to set all the parameters
Christopher Felton
@cfelton

from ..fir import filter_fir_df

class FIRFilter(HardwareFilter):
    def __init__(self, b):
        self.filter_type = 'direct_form'
        self.n_cascades = 0

    def set_cascade(self, n_cascades):
        self.n_cascades = n_cascades

    @hdl.block
    def filter_block(self, glbl, sigin, sigout):
        # this elaboration code will select the different structure and implementations
        if self.filter_type == 'direct_form':
            if self.direct_form_type == 1:
                # all filters will need the same interface ports, this should be do able
                dfilter = filter_fir_df

            if self.n_cascades > 0:
                filter_insts = [None for _ in range(self.n_cascades)]
                for ii in range(self.n_cascades):
                    filter_insts[ii] = dfilter(
                        glbl, sigin[ii], sigout[ii]
                    )
            else:
                filter_inst = dfilter(...)
there are a lot of details missing
this api will take some experimentation to figure out
these objects would live in filter_blocks/fda/fir.py, filter_blocks/fda/iir.py etc.
Sriyash Caculo
@sriyash25
Okay, I think we can start with DF1 FIR and come to cascades later (as suggester by Christian). I will attempt to set parameters through this class and see how it goes.
Christian Münker
@chipmuenk
@cfelton I agree that organizing filters in a class or in several classes is a good approach to bundle all the functionality we need:
  • setting (and maybe getting) parameters like internal and external word formats or coefficients. I suggest a setter method with **kwargs
  • fixpoint simulation stuff
  • HDL synthesis stuff
  • maybe information on internal quanization noise on an algorithmic / behavioural level etc.
Christian Münker
@chipmuenk
I'm not sure though whether it is easier to write one class per filter implementation (given that fixpoint implementations can be very different in e.g. their parameters and simulation setup) or to create a large class.
Sriyash Caculo
@sriyash25
@chipmuenk I was under the impression that we would be creating only two classes for now, one for fir and one for iir filters. Although, even these two can be bundled into one
Christopher Felton
@cfelton
you want a hierarchy, and only create a new class based on the subclasses if one is needed
Christian Münker
@chipmuenk
I think we have reached a point where it would be best to whip up an example that we can use as a base for discussion. In pyfda, I can now easily write a dict with integer coefficients and word lengths and trigger HDL conversion.