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:
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.
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.
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!