gammatone
gammatone copied to clipboard
fft_gtgram: number of frames different from MATLAB implementation for the same signal
While testing this for a real signal, I have noticed that the Python implementation of fft_gtgram
results have less frames than the MATLAB implementation. A test script as well as .mat files containing the input audio and output from MATLAB can be found here.
Note: I actually was using specgram
from MATLAB's Signal Processing Toolbox instead of the version shipped with the toolbox, so that's one thing to take into account. It would not be possible to support both versions of specgram, unless we fix auditory_toolbox/specgram
to have a similar behaviour to MATLAB's specgram
(and I understand that may be a pain).
Another small issue with the data generation code for tests is that it does not actually work on MATLAB (at least on MATLAB 2013a), as it uses syntax that only used to work on Octave (like size(x)(1)
instead of size(x,1)
and some of the cell syntax as well). Even though I agree that it is better to ship scripts that work on Octave, I think we could try to make them compatible both with MATLAB and Octave, so people that only have MATLAB installed could still use them.
In case you are willing to update the data generation scripts, let me know. I am already working on it on a separate (local) branch. Otherwise, feel free to disconsider this!
I am very reluctant to commit to MATLAB syntax compatibility simply because I don't have MATLAB at home. In order to verify compatibility whenever I make changes, I'd need to wait around for someone else to check it.
I'd be happy to take in non-breaking changes that allow for MATLAB compatibility, as long as it's understood not to be a commitment to future MATLAB compatibility.
Regarding the version of specgram
in auditory_toolbox
: it's there because the behaviour of MATLAB's specgram
has changed over the years, and the toolkit code (which was written against an older version) doesn't work for certain input dimensions or arguments with the new version.
I understand and agree completely. I'll try to get the same code working both on MATLAB and Octave, and will submit a pull request if I get something decent.