Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dpss window in Spectrogram class uses wrong value for NW #91

Open
NickleDave opened this issue Apr 9, 2021 · 0 comments
Open

dpss window in Spectrogram class uses wrong value for NW #91

NickleDave opened this issue Apr 9, 2021 · 0 comments
Assignees
Labels
BUG: a bug something isn't working

Comments

@NickleDave
Copy link
Collaborator

the Spectrogram class in audiofileIO allows the user to specify a window, which can be one of `{None, 'Hamm', 'dpss'}.

The dpss option is supposed to reproduce the behavior from Koumura Okanoya 2016

In computing spectra, the 0th order DPSS with a parameter W = 4 / 512 was used as a taper [45].
I believe this is implemented in the code somewhere here, note the taper argument:
https://github.com/cycentum/birdsong-recognition/blob/5b28e57ad6b20b5669e792f9b0abf43a36a2e5ea/birdsong-recognition/src/utils/SoundUtils.java#L95

in fixing issues caused by updating to newer versions, I noticed that the slepian function I used is now deprecated. It also seems there were some bugs in the implementation, see scipy/scipy#4354

which makes me think I was never really generating this taper the right way, anyway

to truly fix this, I need to figure out what the right value for NW should be, the standardized half-bandwidth.
Not clear to me if W parameter that Koumura Okanoya 2016 is the full bandwidth, think I would need to actually look at the textbook they cite (also cited now by the scipy.signal.windows.dpss docs).
Matlab docs give slightly more detailed equations for how they are related:
https://www.mathworks.com/help/signal/ref/dpss.html

for now, just to prevent crash on import, I am going to change to the replacement dpss function

It's probably the case that neither I or anyone else is using this window anyway

but strictly speaking it's using the wrong value and should be fixed

@NickleDave NickleDave added the BUG: a bug something isn't working label Apr 9, 2021
@NickleDave NickleDave self-assigned this Apr 9, 2021
NickleDave added a commit that referenced this issue Apr 9, 2021
note that this merely fixes an AttributeError,
`AttributeError: module 'scipy.signal' has no attribute 'slepian'`

There's a deeper issue with whether I'm calling `dpss` with the
right values, see
#91
NickleDave added a commit that referenced this issue Apr 9, 2021
note that this merely fixes an AttributeError,
`AttributeError: module 'scipy.signal' has no attribute 'slepian'`

There's a deeper issue with whether I'm calling `dpss` with the
right values, see
#91
NickleDave added a commit that referenced this issue Apr 10, 2021
note that this merely fixes an AttributeError,
`AttributeError: module 'scipy.signal' has no attribute 'slepian'`

There's a deeper issue with whether I'm calling `dpss` with the
right values, see
#91
NickleDave added a commit that referenced this issue Apr 10, 2021
note that this merely fixes an AttributeError,
`AttributeError: module 'scipy.signal' has no attribute 'slepian'`

There's a deeper issue with whether I'm calling `dpss` with the
right values, see
#91
NickleDave added a commit that referenced this issue Apr 10, 2021
note that this merely fixes an AttributeError,
`AttributeError: module 'scipy.signal' has no attribute 'slepian'`

There's a deeper issue with whether I'm calling `dpss` with the
right values, see
#91
NickleDave added a commit that referenced this issue Apr 10, 2021
note that this merely fixes an AttributeError,
`AttributeError: module 'scipy.signal' has no attribute 'slepian'`

There's a deeper issue with whether I'm calling `dpss` with the
right values, see
#91
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG: a bug something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant