Menu

Filter delay

Pierre
2022-03-25
2022-03-25
  • Pierre

    Pierre - 2022-03-25

    Hi.

    First of all thanks for this great contribution. Sigpack is very nice.

    One question : is plan to handle initial and final conditions of the filter delays (zi and zf) (like matlab does)?
    [y, zf] = filter(b,a,x,zi)

    This would be very nice to implement properly zero phase filter.

    Could you recommand a library that computes butterworth coefficient ?

    Thanks again for your help
    Pierre

     
  • Claes Rolen

    Claes Rolen - 2022-03-25

    Actually this is already partly handled in SigPack since the filter itself is a class and the internal state will be encapsulated within the class between calls of filter() or the filter operator. That means that consecutive calls to the filter function

      iir_filt.set_coeffs(b, a);
      Y1 = iir_filt.filter(X1);
      Y2 = iir_filt.filter(X2);
    

    will behave like the Matlab version

    [Y1, ZF1] = filter(b,a,X1);
    [Y2, ZF2] = filter(b,a,X2,ZF1);
    

    However, there is no direct function to set and get the internal state. As a temporary workaround you could change the b_buf class member to be public or add a set and a get function. Maybe I can add this feature in the next release. Regarding the butterworth and other IIR/FIR filter design tools I have planned to implement them but do not know when I will have time to do it ...
    BR Claes

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.