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

assemble_coeffs function in ./examples/spectrograms.py returns error #15

Open
JamesOwers opened this issue Jun 15, 2016 · 3 comments
Open

Comments

@JamesOwers
Copy link

JamesOwers commented Jun 15, 2016

Observing c created on line 108, I see it generates objects of dimension 1 x 66 (a 2d array) therefore the function complains that the index [2] is out of range. This error may well be due to my misunderstanding of arguments.

$ ./spectrogram.py /path/to/wav/audio.wav'
Traceback (most recent call last):
  File "./spectrogram.py", line 112, in <module>
    coefs = assemble_coeffs(c, ncoefs)
  File "./spectrogram.py", line 27, in assemble_coeffs
    out = np.empty((ncoefs,cq0.shape[1],cq0.shape[2]), dtype=cq0.dtype)

If it helps, here is info about the wav file being input:

$ soxi 'MASS/sargon-silenci (metal)/sargon-silenci_1-19_with_effects.wav'

Input File     : 'MASS/sargon-silenci (metal)/sargon-silenci_1-19_with_effects.wav'
Channels       : 2
Sample Rate    : 44100
Precision      : 24-bit
Duration       : 00:00:18.00 = 793801 samples = 1350 CDDA sectors
File Size      : 4.76M
Bit Rate       : 2.12M
Sample Encoding: 24-bit Signed Integer PCM

Seeing as the default for --sr is 44100 I thought it would be fine to run with no additional args set.

@JamesOwers
Copy link
Author

I've had a crack at diagnosing - struggled with the generators. Running np.array(list(c)).shape returns (3, 2, 66) i.e. c is a generator that produces lists of lists ('shape' (2,66)). Is this as expected or is something going wrong upstream? I'm afraid I've run out of time trying to pick through NSGT_sliced.forward.

@grrrr
Copy link
Owner

grrrr commented Jun 15, 2016

The list of lists is on purpose, because the output is not necessarily rectangular (only with —matrixform it is).

I would suggest that you start with a set of trusty command line options, like

myinput.wav
—output=myoutput.h5
--fmin=80
--fmax=14000
--bins=202
--scale=log
--real
--matrixform
--reducedform=2
--fps=100
--downmix-after

and --plot, if you like

Am 15.06.2016 um 17:49 schrieb James Owers [email protected]:

I've had a crack at diagnosing - struggled with the generators. Running np.array(list(c)).shape returns (3, 2, 66) i.e. c is a generator that produces lists of lists ('shape' (2,66)). Is this as expected or is something going wrong upstream? I'm afraid I've run out of time trying to pick through NSGT_sliced.forward.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub #15 (comment), or mute the thread https://github.com/notifications/unsubscribe/AAJ-JisjRSf-5mS_qIsH7wOibQVIqd7Vks5qMB8jgaJpZM4I2Yv8.

@JamesOwers
Copy link
Author

JamesOwers commented Jun 15, 2016

Ok, thanks for the tip. I can get it to run with just the argument --matrixform added. The documented help for this is simply "Use regular time division over frequency bins (matrix form)"; have you any clues as to why running without this doesn't work? Is there a bug here or is this simply expected?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants