Extending Pitch Detect: shift selection and recalculate pitc

Using Nyquist scripts in Audacity.
Post and download new plug-ins.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Mac OS X
GNU/Linux and Unix-like
Post Reply
Posts: 13
Joined: Wed Jan 17, 2018 3:51 am
Operating System: OS X 10.11 El Capitan or later (macOS)

Extending Pitch Detect: shift selection and recalculate pitc

Post by stepheneb » Wed Jan 17, 2018 7:12 pm

Extending Pitch Detect: shift selection and recalculate pitch

I'm measuring the longitudinal stiffness of many guitar strings and have collected audio samples of the strings at a specific tension at 650 mm and then fretted a specific distance down at 325 mm. The stiffer the string the higher the fretted pitch is abobe the octave.

I am collecting data on a device I built that holds a single string and allows me to more easily do multiple measurements while keeping the scale length, tension, fretted position, and fretted depression and pressure identical.

I'd like the frequency measurements to be both as accurate and as repeatable as practical.

I am collecting data in Audacity onto a single-channel at 11025 Hz and using the Pitch Detect 20-1000 Hz Frequency range and analysing the first 1 s on a selection.

Am just learning about programming nyquist plugins and have modified the Pitch Detect plugin to display greater resolution in the frequency determination (whether the additional precision is meaningful remains to be determined).

I'm also displaying the inverse of the Confidence attribute.

When I pluck the string there is an initial sharp attack with more high frequency components. I normally select a range to analyse starting at about 1 one second after the initial pluck of the string.

Here's an example of the kind of frequency data I am collecting for a set of six strings:

Code: Select all

Measured Frequency (Hz)                   % Shift Above
open, L1                  fretted, L2     Octave

284.6                     579.4           1.80%
216.4                     444.8           2.76%
148.2                     300.8           1.50%
113.2                     230.8           1.94%
86.9                      177.7           2.27%
70.7                      145.6           3.06%
Using Pitch Detect I am collecting data with this range of Confidence values (presented below as 1/Confidence):

High E String: has a sharp attack and fast decay; the amplitude values have gotten quite small in the last three rows.

Code: Select all

time   freq     confidence
1.0    309.85   0.997
1.5    308.58   0.997
2.0    306.67   0.993
2.5    307.90   0.989
3.0    309.12   0.984
Low E String: has a long stable sustain and amplitude values in last three measurements are about 20 times greater than those collected for the high-E string.

Code: Select all

time   freq     confidence
1.0    73.35    0.999
1.5    73.28    0.999
2.0    73.25    0.999
2.5    73.20    0.999
3.0    73.22    0.999
At this point I'd like to understand how the to find the section of the waveform which will allow the most accurate calculation of frequency using the Nyquist YIN function that Pitch Detect uses.

Of course there are many features I can imagine adding which would make this data collection easier and more repeatable ... but I want to pick a first feature extension that gives me the most value for my data analysis needs and helps learn more about audacity-nyquist programming.

Thats where I got the idea that I'd like to be able to easily shift the selection and recalculate and redisplay the frequency and confidence. That way I can choose how large a sample Pitch Detect uses and then sweep acros the collected data and see how both confidence and frequency change.

Any tips or pointers apprectiated!

Posts: 4505
Joined: Sat Dec 27, 2008 5:22 pm
Operating System: Windows Vista

Re: Extending Pitch Detect: shift selection and recalculate

Post by Trebor » Wed Jan 17, 2018 11:33 pm

Voxengo does a good free real-time spectrogram plugin ...
voxengo span demo (hold).gif
voxengo span demo (hold).gif (620.68 KiB) Viewed 647 times

Image http://www.voxengo.com/product/span/
I've only used it on in Audacity on Windows, but it's available for Mac too.

Posts: 13
Joined: Wed Jan 17, 2018 3:51 am
Operating System: OS X 10.11 El Capitan or later (macOS)

Re: Extending Pitch Detect: shift selection and recalculate

Post by stepheneb » Fri Jan 19, 2018 8:39 am

Thanks for the suggestion Trebor. I've got it working on my Mac. Am able to open the plugin and click the "play" button to see the spectrum visualization of a plucked string.

Haven't yet found a way to "single-step" forward and back in small increments so I can see how the fundamental pitch and harmonics change as the energy from the plucked string decays.

Sent in a question to Voxengo about this and also reported that the FFT Block Size is difficult to set because the selection is rendered behind the Spectrum Mode Editor dialog making most of he Block Size items unselectable.

Post Reply