python-acoustics / python-acoustics

A Python library aimed at acousticians.
BSD 3-Clause "New" or "Revised" License
513 stars 142 forks source link

Filterbank using second-order sections #81

Closed FRidh closed 9 years ago

FRidh commented 10 years ago

Second-order sections allow more stable filters. Scipy currently doesn't support SOS however, it is work in progress. https://github.com/scipy/scipy/pull/3717

On the web I found another module that includes a filterbank, using SOS. https://github.com/SiggiGue/pyfilterbank It does use an extension module for it though.

FRidh commented 9 years ago

At least in 0.14 the zpk representation is used internally as mentioned also elsewhere http://docs.scipy.org/doc/scipy-dev/reference/release.0.14.0.html#scipy-signal-improvements

FRidh commented 9 years ago

In 0.16 sosfilt is available and butter supports sos as output. For low frequencies and high filter orders (8/2 which is needed for 1/3-octave filters) using b,a gives NaN whereas sos gives reasonable values. Therefore, my plan is to convert to sos and require 0.16 from then on.

FRidh commented 9 years ago

Unfortunately there is not yet a filtfilt version that can handle sos though.

FRidh commented 9 years ago

Because 'sos' filtfilt is not available, Filterbank will use 'ba' for now.

FRidh commented 9 years ago

Closed with 81e0cbf50058536e123b33243bafd7e3f81ab3a8