question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

hybrid_cqt magnitude scaling is inconsistent

See original GitHub issue

Hi, With @CarmineCella we’ve tried running the CQT on synthetic sounds, such as white noise (np.random.randn) as well as Diracs. It looks like the cqt function, which relies on the pyramid algorithm of Schoerkuber and Klapuri, is not appropriately scaled in magnitude across octaves.

Below is the code to compute the CQT of a Dirac and the corresponding figure:

import librosa
import numpy as np
x = np.zeros(32768)
x[16384] = 1.0
sr = 22050.0
c = librosa.cqt(x, sr=sr)
librosa.display.specshow(c)

cqt_dirac

Am I mistaken to think that the magnitudes should stay equal across octaves instead ?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
dpwecommented, Apr 29, 2016

It’s odd that it’s not time-symmetric. Setting x[0] to 1 looks about right, x[-1], not so much:[image: Inline image 1] I agree that the noise in the different HF bands is also a problem.

DAn.

On Fri, Apr 29, 2016 at 9:57 AM, Vincent Lostanlen <notifications@github.com

wrote:

I was using librosa v0.4.1. After upgrading to librosa v0.4.2, I can reproduce @bmcfee https://github.com/bmcfee’s figure. This was indeed solved in #307 https://github.com/bmcfee/librosa/issues/307. Sorry for the inconvenience.

Mapping the amplitudes to a dB scale, like you did, makes the artifacts perfectly acceptable. Still, there is a sharp 8x magnitude difference (18 dB) in hybrid_cqt at the frequential boundary between the two methods.

For the record, below is the magnitude (not in dB) at the impulse location with new librosa 0.4.2. Green is hybrid CQT, blue is CQT.

c = librosa.cqt(x, sr=sr) plt.plot(c[:, 32]) hybrid_c = librosa.hybrid_cqt(x, sr=sr) plt.plot(hybrid_c[:, 32])

[image: hybrid_versus_cqt] https://cloud.githubusercontent.com/assets/3943142/14918164/b6a33364-0e22-11e6-8ed9-33c485e056a0.png

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/bmcfee/librosa/issues/341#issuecomment-215722944

0reactions
lostanlencommented, Apr 29, 2016

[I wrote this message after the “sound good ?” of @bmcfee but have just realized that I had not been sent. Better late than never…] Sounds good to me. Most of what I need right now was already fixed in #307 anyway. Then, what do you think about @dpwe 's experiments on moving the impulse location and getting a result that is not covariant with translation ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

If Riot is going to give a champion hybrid scaling or ratios ...
Let me be clear with what I mean with hybrid scaling: when I say hybrid scaling, I mean different parts of a champion's...
Read more >
Research Shows How Hybridization Shaped Feline Evolution
“We know that ancient hybridization in the wild is consistent with extensive evidence for hybridization that has occurred between many distantly related cat...
Read more >
Low rates of hybridization between European wildcats and ...
We report that results based on a set of SNPs were more consistent than on a set of 14 microsatellite markers, showed higher...
Read more >
towards an extensible local magnitude scale a dissertation ...
This thesis aims to redefine the local magnitude scale in a more intentional and physical way, as. Richter had intended it to be....
Read more >
Bump Co-Planarity And Inconsistencies Cause Yield, ...
Scaling With dimensions in chips and packages continuing to shrink, bump technology is being supplanted by hybrid bonding.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found