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

cqt returns complex number even with #440

Closed
polyrhythmatic opened this issue Nov 15, 2016 · 2 comments · Fixed by #474
Closed

cqt returns complex number even with #440

polyrhythmatic opened this issue Nov 15, 2016 · 2 comments · Fixed by #474
Assignees
Labels
bug Something doesn't work like it should
Milestone

Comments

@polyrhythmatic
Copy link
Contributor

Working with the current master branch 1788566 and I've noticed that the CQT always returns complex numbers even with the flag "real=True" set.

I know there's been work done recently on CQT recently GH-165 and I'm wondering if this got changed along the way.

Am I doing something wrong here?

over_sample = 3
res_factor = 1
fmin = librosa.midi_to_hz(12)
const_q = librosa.cqt(y=y_val, sr=sample_rate, fmin=fmin, n_bins=int(8 * 12 * over_sample), filter_scale=res_factor, bins_per_octave=int(12*over_sample), hop_length=128, real=True, scale=True)
@bmcfee bmcfee added the bug Something doesn't work like it should label Nov 15, 2016
@bmcfee bmcfee added this to the 0.5 milestone Nov 15, 2016
@bmcfee bmcfee self-assigned this Nov 15, 2016
@bmcfee
Copy link
Member

bmcfee commented Nov 15, 2016

Good catch -- you should be getting a deprecation warning though. Are you?

real is deprecated in 0.5 and will be removed in 0.6. That it isn't working is a bug (tagged now, thanks), but you may as well future-proof by taking np.abs(librosa.cqt(...)) instead.

@polyrhythmatic
Copy link
Contributor Author

Here's where I admit to running the script in Node and not paying attention to stderr after getting it set up...

Thanks for the heads up and simple solution with np.abs, and thanks for the inverse cqt! Great function.

bmcfee added a commit that referenced this issue Dec 12, 2016
added real=True deprecation back to cqt. Fixes #440
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something doesn't work like it should
Development

Successfully merging a pull request may close this issue.

2 participants