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
Further CQT enhancements #279
Conversation
Paging @ebattenberg for feedback. Not urgent, but I reordered some of the UPDATE: hybrid cqt tests still pass with the new order of operations ( |
Changing the Pseudo CQT to take phase into account changes it into not a pseudo CQT but an undersampled (in time) CQT. |
Fair enough. Is this really a meaningful distinction, or is there a reference implementation/description of pcqt that we adhere to? |
It's a big deal. Imagine the "impulse response" corresponding to a If you do a single calculation against the complex Fourier coefficients, Taking the average magnitude, the total energy coming through the filters DAn. On Friday, November 13, 2015, Brian McFee notifications@github.com wrote:
|
Ok, this makes sense. Thanks. Backing up a bit: maybe it's just silly to offer complex mode for pseudo-cqt in the first place? I suppose that anyone that cares enough about phase (eg for later cqt inversion or what-have-you) would just use the full cqt anyway. Does that seem reasonable to everyone else? |
Yeah. The Pseudo CQT is an alternative to averaging and downsampling the CQT for higher frequency bands. It should be more efficient but is not exactly equivalent. Though I don't know how well inverting the CQT will go if you average and downsample in time to get down to the desired hop size. |
I just googled "pseudo CQT" to get the exact definition, but just got links to librosa. ;) |
I guess the spirit of my question was more: is "pseudo CQT" a precise term, or do we have some wiggle room in its definition? At any rate, DAn's comment makes sense, and I'm happy to keep pcqt as magnitude-only. |
5a96590
to
bcbd151
Compare
9345878
to
894e002
Compare
I don't think there's anything left to do on this one. I have a working (but terribly slow) inverse-cqt implemented in a notebook, but I don't think perfecting inverse-cqt should hold up complex-cqt. Does anyone object to merging? |
In working out #302 , it occurred to me that we should probably rename the Do folks on this thread have any thoughts on a better name for (And don't worry, we have a warning shim that will provide backward compatibility now, so the old argument name will continue to work.) |
Fast inverse CQT implementation is here ; gist won't store audio buffers, so you'll have to download it and run it on your own favorite example. I think this basically demonstrates that the complex cqt is doing the right thing. (Caveats abound: icqt sounds lousy for resolution > 1, and frequency over-sampling actually degrades quality due to using filter^H instead of a proper basis inversion. SNR is also rather low, mostly i suspect due to LPF inherent in this cqt implementation, but to my ear it sounds pretty good.) |
Final to-dos:
|
The current cqt implementation returns only magnitude. If we're going to support inverse CQT #165 , phase will be critical for good reconstruction.
This PR is the first step in this direction.
It's currently implemented as API-compatible with the existing CQT; complex-output is enabled by setting
real=False
. In 0.5, we should remove this parameter and make it always return complex-valued transforms.As a side issue, this PR fixes
util.sync
to retain thedtype
of the input data.