achabotl / pambox

Python auditory modeling toolbox.
http://pambox.org
BSD 3-Clause "New" or "Revised" License
35 stars 8 forks source link

Modulation filtering stage produces different output from "butter" function #14

Closed achabotl closed 9 years ago

achabotl commented 9 years ago

Noticed that the time output of the modulation filterbank is different from the time output if we just use the sp.signal.butter function to create the coefficients and then filter the signal with sp. signal.filtfilt.

Apparently, there an extra "-1" factor in when creating the frequency vector that should not be there. If we remove it, then the output of the mod_filterbank function is the same as when using butter.

It would probably make sense to use butter, since we're using Butterworth filters anyway, instead of using our own implementation. Additionally, because of the way the modulation filtering is currently done, the shape of the filter is dependent on the length of the input signal, because it affects the resolution of the frequency vector.

achabotl commented 9 years ago

After doing a quick test, removing the -1 factor does not affect the predictions of the sEPSM at all; the tests still pass. It does, however, affect the results of the mr-sEPSM; the model is about 4% off the expected values.

Should we change the expected value? Which is now the "reference" implementation?