Skip to content

dsp: p_firsym: API issue and implementation #158

@lfochamon

Description

@lfochamon

Although I think having a separate implementation specific for filters with symmetric coefficients is a great idea, there is the issue of dealing with the different types of symmetric FIR filters. For reference:

  • Type I: symmetric coefficients, odd length;
  • Type II: symmetric coefficients, even length (cannot be high pass, zero at -1);
  • Type III: anti-symmetric coefficients, odd length (cannot be high pass, low pass, or band stop, zeros at +1 and -1);
  • Type IV: anti-symmetric coefficients, odd length (cannot be low pass, zero at +1).

The way the function description is written today, I guess it would imply a type II filter. The implementation of all these FIR are very similar, but it should be defined whether it would make more sense to have (a) a single function that support all types of filters or (b) different functions.

For (a), the function interface needs to be updated to either pass symmetric/anti-symmetric and odd/even length parameters or the filter type. Option (b) would mean less branching and more straightforward code, although it could increase code footprint if someone used all 4 kinds of filters in a project (something really unlikely in practice).

I've written the code, but I guess I'll wait for a consensus before submitting a pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions