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

Moving average vs. CIC filter design, Terminology #152

Open
dsvf opened this issue Jul 23, 2019 · 6 comments
Open

Moving average vs. CIC filter design, Terminology #152

dsvf opened this issue Jul 23, 2019 · 6 comments

Comments

@dsvf
Copy link

dsvf commented Jul 23, 2019

Two points to consider when adding a CIC mode to pyfda:

  1. When designing a moving average filter which averages over 10 samples, then the number of delays is obviously only 9 since I can use the latest, non-delayed sample. Setting M to 10 returns an 11-tap FIR filter.
    When designing a CIC filter, to achieve decimation-by-10, the user would have to set M to 9 to obtain the correct response. It might be advisable to either notify the user about this, use a different name for the input parameter or increment it (internally/silently?)

  2. From what I can find, in CIC filters the parameter "M" denotes the number of delays inside one integrator/differentiator and in most cases is set to 1. The parameter "N" is the number of integrator and differentiator stages. This collides in terminology with the MA filter UI, where "M" is the decimation ratio (off-by-one), and "Stages" is the number of stages (alright).

@chipmuenk
Copy link
Owner

Thanks for your feedback! I agree that my naming conventions are a bit questionable. For MA filters I decided to keep parameter name N for the total order (as in e.g. number of zeros) obtained by cascading identical stages of simple MA filters with M delays each (not the same as the number of delays inside CIC stages, AFAIK this is either 1 or 2).

Concerning CIC filter, it was probably a bad idea to confuse the user in #149 by saying "well, a MA filter is more or less the same as a CIC filter". Well, it isn't, so it would be better to design a new filter class (that also allows decimation / interpolation) with the parameters R or I (decimation / interpolation ratio resp. order of the comb filter), M (1 or 2, number of delays in the CIC stages) and "stages" (how many times are integrators / comb filters cascaded). What do you think?

CIC-MA_filter.pdf

CIC-simple.pdf

@dsvf
Copy link
Author

dsvf commented Sep 16, 2019

I'd like to try some ideas out myself, but I am unable to get pyfda(x) to run from the source. Do you have a short hint on how you start the program itself from the source files?

@chipmuenk
Copy link
Owner

Did you receive my mail (about a week ago)? Were you able to start pyfda?

@dsvf
Copy link
Author

dsvf commented Sep 24, 2019

No, I did not receive any email. I have now added it to my github profile.

@chipmuenk
Copy link
Owner

Ah, I see. I've added the info that I tried to mail you to the github project Readme (where it belongs, I guess). Please give it another try and tell me whether you had success.

@dsvf
Copy link
Author

dsvf commented Sep 24, 2019

Thanks! I had an unrelated problem with multiple python versions interfering with each other, but now it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants