-
Notifications
You must be signed in to change notification settings - Fork 9
Closed
Labels
Spectrogramissues related to vocalpy.Spectrogram or spectrograms in generalissues related to vocalpy.Spectrogram or spectrograms in general
Description
- The signal.spectrogram code is ... not great (speaking as the author). In example snippets we log transform to visualize as a very crude sort of map to dB
- Ideally there should be a way to get a Spectrogram by default from some function that looks good. Ofc "looks good" depends on parameters and these can vary depending on species. But seems like we can offer "good enough" for now.
- Librosa.stft provides better looking spectrograms by default, but for someone who does not think DSP natively (e.g., moi) it is not intuitive to have to do the steps of
stft
->amplitude_to_db(np.abs(S))
So I think we should:
- remove
signal.spectrogram
- add a function
vocalpy.spectrogram
orspect_from_audio
that gives back aSpectrogram
from anAudio
- basically a wrapper around
librosa.stft
- that does the
stft
->amplitude_to_db(np.abs(S))
step - that additionally uses other librosa helper functions to get
times
andfrequencies
for thevocalpy.Spectrogram
- and of course in the docstring we should point out it's just a wrapper around these functions and ask people to cite librosa
- basically a wrapper around
... I'm unsure about whether I want to keep the spectrogram
namespace to put other things in or if I want to prefer a flatter namespace. The whole point of this will be to make it as easy as possible to get a vocalpy.Spectrogram
to visualize, so I think we should go with flat. The other things I would put in a spectrogram namepsace would be other ways of computing spectrograms, e.g. multi-taper, time-freq replacement, whatever sigsound does (fancy Theunissen thing I am as yet too dumb to understand). But I think those make more sense in the spectral
module
Metadata
Metadata
Assignees
Labels
Spectrogramissues related to vocalpy.Spectrogram or spectrograms in generalissues related to vocalpy.Spectrogram or spectrograms in general