Discussion:
[Audacity-devel] I implemented another spectrogram algorithm: constant Q
Paul Licameli
2017-02-15 17:28:54 UTC
Permalink
I put a branch in my fork called constant-q.

The "constant Q transform" makes the horizontal bands of the spectrogram
have equal height on the logarithmic scale, rather than on the linear.
Thus each band could correspond to a semitone of the chromatic scale, that
is, whole numbered MIDI tones.

You can turn this on in Spectrogram Settings or Preferences by choosing
"Tones" for the algorithm.

There is a hard coded numer in SpectrogramSettings::GetConstantQSettings
that controls the width of the bands. You can change it and recompile. I
didn't yet do the work to put that choice in the user interface.

So you can choose a fine quarter-tone resolution, or semitone resolution,
or a resolution corresponding to the 31 equalization sliders (exactly 10
per decade, or very close to 3 per octave).

I also haven't yet done the work to tune the bands precisely, so that, say,
440 Hz is exactly at the (geometric) mean frequency of a band.

Another feature of this algorithm, which you can observe if you make a
click as with click track, is that the time resolution is finer at higher
frequencies, as the frequency resolution becomes coarser.

Now I am not yet convinced that this looks interesting and compelling
enough to put into 2.1.4, but I was very interested to learn how to
implement the mathematical method described here...

http://academics.wellesley.edu/Physics/brown/pubs/effalgV92P2698-P2701.pdf

... which is something I may also want to redo in Nyquist Lisp to improve
my DeClicker plug-in so it might work much faster.

PRL
James Crook
2017-02-16 17:05:26 UTC
Permalink
Lovely. I've just tried this branch out. I've long wanted us to have
constant Q.

And but, I would have expected a dramatic and compelling change in
appearance. I'd expect to see detailed structure better where it is
most needed (without futile computation being done - because it's all
being calculated for the 'appropriate' bands/times). Are the settings
you compiled with simply too coarse?? Or is the idea of constant Q not
as compelling as it sounds?

--James
Post by Paul Licameli
I put a branch in my fork called constant-q.
The "constant Q transform" makes the horizontal bands of the spectrogram
have equal height on the logarithmic scale, rather than on the linear.
Thus each band could correspond to a semitone of the chromatic scale, that
is, whole numbered MIDI tones.
You can turn this on in Spectrogram Settings or Preferences by choosing
"Tones" for the algorithm.
There is a hard coded numer in SpectrogramSettings::GetConstantQSettings
that controls the width of the bands. You can change it and recompile. I
didn't yet do the work to put that choice in the user interface.
So you can choose a fine quarter-tone resolution, or semitone resolution,
or a resolution corresponding to the 31 equalization sliders (exactly 10
per decade, or very close to 3 per octave).
I also haven't yet done the work to tune the bands precisely, so that, say,
440 Hz is exactly at the (geometric) mean frequency of a band.
Another feature of this algorithm, which you can observe if you make a
click as with click track, is that the time resolution is finer at higher
frequencies, as the frequency resolution becomes coarser.
Now I am not yet convinced that this looks interesting and compelling
enough to put into 2.1.4, but I was very interested to learn how to
implement the mathematical method described here...
http://academics.wellesley.edu/Physics/brown/pubs/effalgV92P2698-P2701.pdf
... which is something I may also want to redo in Nyquist Lisp to improve
my DeClicker plug-in so it might work much faster.
PRL
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Pokechu22
2017-02-16 20:19:43 UTC
Permalink
This is pretty neat. However, it's currently breaking when the window
Debug Assertion Failed!
Program: C:\WINDOWS\SYSTEM32\MSVCP120D.dll
File: c:\program files (x86)\microsoft visual studio 12.0\vc\include\vector
Line: 1201
Expression: vector subscript out of range
Audacity.exe!SpecCache::Populate(const SpectrogramSettings & settings, WaveTrackCache & waveTrackCache, int copyBegin, int copyEnd, unsigned int numPixels, sampleCount numSamples, double offset, double rate, double pixelsPerSecond) Line 1107
--Poke
Martyn Shaw
2017-02-17 01:02:24 UTC
Permalink
Hi Paul

This sounds interesting and I would like to try it out and see the
results. Unfortunately I have not got into Git and don't know how to
get your current version to try it out. I think I did it once many
months ago but have not done it since.

I have found much less time for Audacity since I gave up working.

Good luck! And thanks for the link to an interesting paper.

TTFN
Martyn
Post by Paul Licameli
I put a branch in my fork called constant-q.
The "constant Q transform" makes the horizontal bands of the
spectrogram have equal height on the logarithmic scale, rather than on
the linear. Thus each band could correspond to a semitone of the
chromatic scale, that is, whole numbered MIDI tones.
You can turn this on in Spectrogram Settings or Preferences by
choosing "Tones" for the algorithm.
There is a hard coded numer in
SpectrogramSettings::GetConstantQSettings that controls the width of
the bands. You can change it and recompile. I didn't yet do the work
to put that choice in the user interface.
So you can choose a fine quarter-tone resolution, or semitone
resolution, or a resolution corresponding to the 31 equalization
sliders (exactly 10 per decade, or very close to 3 per octave).
I also haven't yet done the work to tune the bands precisely, so that,
say, 440 Hz is exactly at the (geometric) mean frequency of a band.
Another feature of this algorithm, which you can observe if you make a
click as with click track, is that the time resolution is finer at
higher frequencies, as the frequency resolution becomes coarser.
Now I am not yet convinced that this looks interesting and compelling
enough to put into 2.1.4, but I was very interested to learn how to
implement the mathematical method described here...
http://academics.wellesley.edu/Physics/brown/pubs/effalgV92P2698-P2701.pdf
... which is something I may also want to redo in Nyquist Lisp to
improve my DeClicker plug-in so it might work much faster.
PRL
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Pokechu22
2017-02-17 03:53:48 UTC
Permalink
Martyn:
It's not too hard to find get his version once you know his repo, but
if you don't know where that is (which requires a bit of understanding
of GitHub), then it can be difficult. You can find it by going to the
"contributors" tab on audacity/audacity, then selecting his name, and
then selecting his fork of audacity. This brings you to
"https://github.com/Paul-Licameli/audacity".
From there, you can either get the code from the git command line, or
by downloading a zip directly. If you want to directly download the
zip, first change the branch to "constant-q" and then select "clone or
download". If you want to do it from git, though, instead perform
these commands within your copy of the audacity repo:

git remote add PRL https://github.com/Paul-Licameli/audacity.git
git fetch PRL
git checkout constant-q

Hopefully this helps.

--Poke
Hi Paul
This sounds interesting and I would like to try it out and see the
results. Unfortunately I have not got into Git and don't know how to
get your current version to try it out. I think I did it once many
months ago but have not done it since.
I have found much less time for Audacity since I gave up working.
Good luck! And thanks for the link to an interesting paper.
TTFN
Martyn
Post by Paul Licameli
I put a branch in my fork called constant-q.
The "constant Q transform" makes the horizontal bands of the
spectrogram have equal height on the logarithmic scale, rather than on
the linear. Thus each band could correspond to a semitone of the
chromatic scale, that is, whole numbered MIDI tones.
You can turn this on in Spectrogram Settings or Preferences by
choosing "Tones" for the algorithm.
There is a hard coded numer in
SpectrogramSettings::GetConstantQSettings that controls the width of
the bands. You can change it and recompile. I didn't yet do the work
to put that choice in the user interface.
So you can choose a fine quarter-tone resolution, or semitone
resolution, or a resolution corresponding to the 31 equalization
sliders (exactly 10 per decade, or very close to 3 per octave).
I also haven't yet done the work to tune the bands precisely, so that,
say, 440 Hz is exactly at the (geometric) mean frequency of a band.
Another feature of this algorithm, which you can observe if you make a
click as with click track, is that the time resolution is finer at
higher frequencies, as the frequency resolution becomes coarser.
Now I am not yet convinced that this looks interesting and compelling
enough to put into 2.1.4, but I was very interested to learn how to
implement the mathematical method described here...
http://academics.wellesley.edu/Physics/brown/pubs/effalgV92P2698-P2701.pdf
... which is something I may also want to redo in Nyquist Lisp to
improve my DeClicker plug-in so it might work much faster.
PRL
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Martyn Shaw
2017-02-18 00:28:11 UTC
Permalink
Thanks Poke, this is helpful. I knew this stuff once I'm sure!

TTFN
Martyn
Post by Pokechu22
It's not too hard to find get his version once you know his repo, but
if you don't know where that is (which requires a bit of understanding
of GitHub), then it can be difficult. You can find it by going to the
"contributors" tab on audacity/audacity, then selecting his name, and
then selecting his fork of audacity. This brings you to
"https://github.com/Paul-Licameli/audacity".
From there, you can either get the code from the git command line, or
by downloading a zip directly. If you want to directly download the
zip, first change the branch to "constant-q" and then select "clone or
download". If you want to do it from git, though, instead perform
git remote add PRL https://github.com/Paul-Licameli/audacity.git
git fetch PRL
git checkout constant-q
Hopefully this helps.
--Poke
Hi Paul
This sounds interesting and I would like to try it out and see the
results. Unfortunately I have not got into Git and don't know how to
get your current version to try it out. I think I did it once many
months ago but have not done it since.
I have found much less time for Audacity since I gave up working.
Good luck! And thanks for the link to an interesting paper.
TTFN
Martyn
Post by Paul Licameli
I put a branch in my fork called constant-q.
The "constant Q transform" makes the horizontal bands of the
spectrogram have equal height on the logarithmic scale, rather than on
the linear. Thus each band could correspond to a semitone of the
chromatic scale, that is, whole numbered MIDI tones.
You can turn this on in Spectrogram Settings or Preferences by
choosing "Tones" for the algorithm.
There is a hard coded numer in
SpectrogramSettings::GetConstantQSettings that controls the width of
the bands. You can change it and recompile. I didn't yet do the work
to put that choice in the user interface.
So you can choose a fine quarter-tone resolution, or semitone
resolution, or a resolution corresponding to the 31 equalization
sliders (exactly 10 per decade, or very close to 3 per octave).
I also haven't yet done the work to tune the bands precisely, so that,
say, 440 Hz is exactly at the (geometric) mean frequency of a band.
Another feature of this algorithm, which you can observe if you make a
click as with click track, is that the time resolution is finer at
higher frequencies, as the frequency resolution becomes coarser.
Now I am not yet convinced that this looks interesting and compelling
enough to put into 2.1.4, but I was very interested to learn how to
implement the mathematical method described here...
http://academics.wellesley.edu/Physics/brown/pubs/effalgV92P2698-P2701.pdf
... which is something I may also want to redo in Nyquist Lisp to
improve my DeClicker plug-in so it might work much faster.
PRL
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Loading...