Pickup position and plucking point estimation on an electric guitar

This paper describes a technique to estimate the plucking point and magnetic pickup location along the strings of an electric guitar from a recording of an isolated guitar tone. The estimated values are calculated by minimising the difference between the magnitude spectrum of the recorded tone and that of an electric guitar model based on an ideal string. The recorded tones that are used for the experiment consist of a direct input electric guitar played on all six open strings and played moderately loud (mezzo-forte). The technique is able to estimate pickup locations with 7.75–9.44 mm average absolute error and plucking points with 10.45–10.97 mm average absolute error for single and mixed pickups.


I. INTRODUCTION
Several papers in the literature have dealt with analysing and synthesising plucked string instruments, particularly acoustic 1,2 and electric guitars. 3,4 In this paper, we focus on the analysis of electric guitar sounds. The motivation for this work is to understand the factors that influence the sound of popular guitarists, in order to be able to replicate their sound by extracting the relevant parameters from their recordings.
A number of parameters determine the timbre of the electric guitar. For instance, an electric guitar sound can be altered immensely by selecting different combinations of amplifier, loudspeaker cabinet, and effects. Case et al. 5 describe how the combination of the electric guitar, amplifier, and recording techniques enables musicians and recording engineers to define and refine their tone, and to explore new sounds as desired. The tone can be further varied by adjusting the parameters of the various elements in the chain. Moreover, the way the musician plays, for example, the strength and the location of the pluck, also influences the sound.
It is well known that the plucking point and pickup position produce a comb-filtering effect on the spectrum of the electric guitar. 4,6,7 To synthesise a realistic electric guitar sound requires careful choice of these parameters. For modelling realistic playing in acoustic guitar synthesis, Laurson et al. 2 incorporate the comb-filtering effect caused by the plucking point into the excitation signal, in order to provide better control over the timbre. Recent papers introduce techniques to model the physical interactions of the player with the guitar to produce a more realistic guitar sound, such as modelling the interactions of the guitar pick 8,9 or fingers 9 with the string, and the fingers with the fretboard. 9,10 When the pickup selector of an electric guitar is switched, the difference in the sound is recognisable. Furthermore, the positioning of pickups on particular electric guitar models contributes to their unique sound. Thus, estimating the precise location of the magnetic pickup of an electric guitar could possibly help distinguish which pickup configuration is selected for a known guitar, or which electric guitar model is played for an unknown guitar (e.g., Fender Stratocaster or Gibson Les Paul, etc.). Popular electric guitars have different pickup locations, thus, estimating the locations could help musicologists in determining which guitar is used in a recording where there is little information about the original instrument and/or its pickup selection.
To date, there are few papers on extracting information from electric guitar recordings, such as classifying the types of effects used 11 and estimating the decay time of electric guitar tones. 12 Other research involved extracting information from related string instruments, such as extracting plucking styles and dynamics for classical guitar 13 and electric bass guitar. 14 Papers that dealt with estimating the plucking point of a classical guitar have used both frequency-domain 15,16 and time-domain 17 approaches. This paper extends recent research on estimating the pickup position and plucking point of electric guitar tones. 18 The parameters are estimated using a frequency-domain approach, where the parameters of the electric guitar model that best fit the observed data are chosen. In this paper, we propose an improved method to estimate the locations of the pickup and plucking events based on the autocorrelation of the spectral peaks.
The paper is organised as follows: Sec. II explains the datasets that are used in this paper. The derivation of an ideal string model that includes a pickup model is explained in Sec. III and we extend the existing models in Sec. IV. In Sec. V, we introduce a method to estimate the plucking point and pickup position given a direct input audio recording of individual tones played on the electric guitar. We evaluate our method on two datasets: (1) we evaluate the accuracy of the estimates for tones played mezzo-forte on open strings using either single or mixed pickups in Sec. VI and (2) we evaluate the effects on the accuracy when different plucking dynamics and frets are played in Sec. VII. Finally, the conclusions are presented in Sec. VIII.

II. DATASETS
In this paper, we use two datasets, which are designed to (1) test the accuracy of our algorithms on single and mixed pickups; and (2) test the effects of different plucking dynamics and fret positions.
For the first dataset, we record (one instance for each combination) moderately loud isolated tones played at eight plucking points, on each of the six open strings, using five different pickup selections (three single and two mixed) on a Stratocaster model guitar manufactured by Squier. The Squier Stratocaster is modified so that the electric guitar can be recorded from three single pickups simultaneously. 19 Note that the mixed pickup selections are recorded on a separate occasion. The plucking points range from 30 to 170 mm from the bridge with 20 mm intervals and the strings are plucked using a 0.88 mm thick plastic plectrum. Figure 1 shows where the plucking events occur. The pickup selector allows us to select single pickups or mixed pickups. The single pickups consist of neck pickup, middle pickup, and bridge pickup. The two mixed pickups are a mix between neck and middle pickup and a mix between middle and bridge pickup, where all pickups are in-phase.
The second dataset is taken from Mohamad et al., 19 which consists of isolated tones played at three plucking points (above each pickup) with three single pickup configurations and three plucking dynamics, played on open and fretted strings (fifth fret and twelfth fret), with three repetitions of each condition.
All samples (first and second dataset) were recorded at 44 100 Hz sampling rate with the same electric guitar, string gauges, plectrum and recording equipment. The lengths of each string differ slightly due to the different positions of each bridge saddle. The measurements of the length of string and pickup locations are shown in Table I. The pickup locations are measured from each bridge saddle to the middle of the pickup, where the string is most strongly sensed.

III. ELECTRIC GUITAR MODEL BASED ON IDEAL STRING EQUATION
In this section, we discuss the theoretical background of an electric guitar model based on an ideal plucked string equation.
A. Ideal string model From the point a guitar string is plucked, waves travel in two opposite directions along the string propagating away from the plucking point. The waves are then reflected from the end supports of the string producing a standing wave in the string.
The amplitude spectrum of the ideal string model can be derived by integrating the initial geometrical form of the   649  38  99  157  Second, B3  650  41  100  158  Third, G3  652  45  102  160  Fourth, D3  651  46  101  159  Fifth, A2  652  49  102  160  Sixth, E2  650  49  100  158 plucked string (the initial form of the string is assumed to have a triangular shape). The Fourier series coefficients,Ĉ k of a string of length L plucked at a point q from the bridge with a vertical displacement a are given by 6 where a is the amplitude of the pluck, k is the harmonic number and R q ¼ q/L. For example, plucking one-third of the distance along the string results in every third harmonic having zero amplitude. Note that in the ideal string model, the end supports are assumed to be rigid and no energy is lost.

B. Velocity of ideal string
A typical electric guitar uses magnetic pickups to sense the vibration of its strings and convert it into electrical signals in order to produce sound. The magnetic pickup senses the velocity of the string, 20,21 therefore, modelling the electric guitar string requires a time derivative of the ideal string model. The velocity of an ideal string that is sensed at a single point d is given by 12 where r and M are the string's tension and mass per unit length, respectively), The effect on the timbre due to the pickup placement and plucking point can be understood via its spectrum. The Fourier series coefficients of the velocity of the ideal string sensed at a single point,V k can be computed aŝ For example, Fig. 2 shows the spectrum of the electric guitar model plucked at one-third of the string length with the pickup placed at one-fifth of the string length. Notice that in Fig. 2 for multiples of k 1 ¼ L/d and k 2 ¼ L/q harmonics are suppressed. This effect is what makes a neck pickup sound warmer than a bridge pickup, as more of the harmonics are not sensed or weakly sensed.

C. Pickup mixing effect
An electric guitar commonly has an option to mix two pickups together. Tillman 22 and Paiva et al. 7 studied the effect of mixed pickups. The electric guitar model in Eq. (3) can be extended to include mixing two pickups of distance d 1 and d 2 along the string of length L, assuming that both pickups sense at a single point: 18 is the sum of two sine functions and can be further derived using trigonometric equation: Note that a mixed pickup signal produces a sine function that relates to the average of the two pickup locations i and a cosine function that relates to half of the distance between the two pickup locations j. If the mixed pickups have opposite phases, this can be modelled aŝ where S À l ¼ S d 1 À S d 2 represents two mixed out-of-phase pickups. The in-phase connection of the two pickups is more typically used than the out-of-phase connection. 7 D. Plucking mechanism width effect on single pickup An electric guitar string is usually plucked with a finger or plectrum of a finite width d. Previously, the electric guitar model in Eq. (3) assumed that the string is plucked with a plectrum of infinitesimally small width. The effect of the width of the plucking mechanism d on the velocity of an ideal string sensed at a single point is given by 6 where plucking width affects the level of high harmonics causing a low pass filtering effect by introducing a 6 dB/octave rolloff above a mode number k ¼ 2L/(pd), where harmonics above mode number k d ¼ 2 L/d are not excited. 23 Hence, this will limit the spectrum to k < k d harmonics.

IV. EXTENDING THE EXISTING ELECTRIC GUITAR MODEL
In this section, we extend the ideal electric guitar string model to include the pickup width effect for single and mixed pickups.

A. Pickup width effect for a single pickup
The pickup senses the velocity of a string around an area (with a finite width w) rather than at a single point. Hence, the electric guitar model in Eq. (8) can be further extended aŝ Evaluating the integral gives and substituting into Eq. (9) yieldŝ where This effect adds a 6 dB/octave rolloff above the mode number k ¼ 2L/(pw), where harmonics above mode number k w ¼ 2L/ w exhibit very little excitation. The area sensed is assumed to have a rectangular shape, whereas in practice, the string is more strongly sensed around the middle of the pickup than at the ends. Paiva et al. models the pickup width effect with a Hamming window. 7 Note that the pickup width effect is similar to the plucking width effect where a wider pickup sensitivity lowers the level of high harmonics. Combining both width effects, the limit of the spectrum is reduced to k < minðk d ; k w Þ.

B. Final electric guitar model
The final electric guitar model can be computed by introducing the pickup width and plucking width effects into the mixed pickup model by substituting Eq. (10) into Eq. (4) and adding the plucking width factor from Eq. (8), where w 1 and w 2 are the widths of the two pickups: Typically, a mixed pickup such as a humbucker has two pickups with the same width. If both widths are equal such that w 1 ¼ w 2 , the model can be simplified tô Figure 3 shows two spectra of the final electric guitar model with different pickup widths, illustrating how a greater pickup width lowers the amplitude of higher harmonics.

V. ESTIMATING PLUCKING POINT AND PICKUP POSITION
This section explains the methods to estimate the locations along the string of the selected guitar pickup(s) and where it is plucked. An overview of the whole system is shown in Fig. 4.

A. Onset time estimation
The onset time of the recorded tone is estimated using spectral flux. The spectral flux is the sum of positive changes in the magnitude of each frequency bin across all frequency bins for a frame. 24 The peaks in spectral flux are interpreted as possible onset times. Since we are dealing with single tones, we select the highest peak as the estimated onset time. We use a frame size of 11.6 ms with overlapping windows of 50%. A window of 46 ms starting from the onset time is then taken to determine the fundamental frequency f 0 of the recorded tone using autocorrelation. 25 The initial estimate of the onset time is typically just before the plucking noise, thus we refine the onset estimate to be closer to the end of the plucking event. Starting from the initial onset estimate, we take a time-domain window of size 4T samples, where T ¼ 1=f 0 , and perform peak detection. We discard peaks which are less than 20% of the maximum value in the window in order to avoid unwanted small peaks at the beginning of the tone due to the plucking noise.
To determine the start of the plucking event, we find the last zero crossing of the signal before the first peak by working backwards from the peak to the initial onset estimated earlier. Figure 5 shows an example of onset estimation.

B. Computing the amplitudes of spectral peaks
Once the time of the plucking event is found, we perform short-time Fourier transform (STFT) analysis on the signal using a Hamming window with support size of 3T samples and zero padding factor of 4. The window size is chosen to be as small as possible, in order to capture the initial conditions of the pluck before information is lost due to the uneven decay of harmonics. Figure 5 shows an example of such a window of three cycles for an electric guitar tone at pitch A2.
We then search for spectral peaks in windows of 630 cents around expected partial frequencies f k ¼ kf 0 ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi 1 þ Bk 2 p , where B is the inharmoncity coefficient for each string 26,27 (using empirical measurements of B provided by Barbancho et al. 28 ). The magnitudes of the spectral peaks are further refined using quadratic interpolation. 29 Figure 6 shows the spectrum of the electric guitar tone from Fig. 5 with the detected spectral peaks represented by crosses.
The total number of harmonics K that we consider depends on a number of factors. If the number of harmonics is too low, we cannot properly estimate pluck or pickup positions that are close to the bridge. For instance, if we set K ¼ 20 harmonics and the string length L is 648 mm, we cannot estimate any pluck or pickup positions below L/K ¼ 32.4 mm. Also, the number of harmonics should not be higher than the Nyquist rate. For example if T is 66 samples, then we cannot set K to be more than 33 harmonics. The number of harmonics also depends on the fret at which the string is stopped. The number of harmonics available on an open string is double the number for the same string played at the twelfth fret. Also, when the string is fretted, the string length is shortened but the pickup width remains constant, hence, the number of harmonics available decreases [see Eqs. (11) and (13)]. Thus, we set the total number of harmonics for open string, fifth fret, and twelfth fret to be 25, 20, and 15, respectively.

C. Estimating spectral slope
In order to compensate the low-pass filtering effect due to pickup width, plectrum width, and plucking dynamics and compensate for the energy losses due to nonrigid end supports (e.g., bridge and fingers), the spectrum of the analysed signal needs to be flattened. The slope of the spectrum of an observed data X is estimated by fitting a line in the logfrequency domain. The best fitting line can be written as where the spectral peak X k for harmonic k is normalised to a maximum of 0 dB and / is the slope of the spectrum. Hence, the variable power of the harmonics determines the slope of the spectrum where k -/ has a À6/ dB/octave slope [see Eq. (3)]. Once the parameter / is determined, we can adjust this accordingly to obtain a flatter spectrum.
Once the slope of the spectrum is estimated, we use this value to obtain a better fit to the model. Ideally we want to flatten the spectrum to 0 dB/octave but this would produce unwanted troughs in the autocorrelation. We will further discuss the use of this technique and the problems of overflattening the spectrum in Sec. V D.

D. Estimating the pickup and pluck locations
The magnitudes of the first K harmonics are used to calculate the autocorrelation: 16 where X is the flattened spectrum. The autocorrelation of an electric guitar signal should produce two dominant troughs: the lag s q of one trough indicates the location of the pluck and the lag s d of the other indicates the location of the pickup. Note that the plucking and pickup positions have similar effects and produce similar troughs but at different locations. Distinguishing between the two troughs could be determined using post-processing techniques as discussed later in Sec. VIII. Once the time lag estimatesŝ are found,  Figure 7 shows the autocorrelation of the electric guitar tone from Fig. 5, and the two dominant troughs can be seen, whereŝ q is at 69 samples andŝ d is at 100 samples. The autocorrelation is calculated from the spectrum that is flattened to À3 dB/octave. Also, note that we are only interested in the troughs that are located in the first half of the autocorrelation period. We estimate the plucking point and pickup position with Eqs. (16) and (17) where L ¼ 652 mm and T ¼ 408 samples. This yields an estimated plucking point at 110.26 mm and pickup position at 159.80 mm from the bridge, giving less than 60.3 mm error for both estimates.
If the plucking position is at or near the pickup, the troughs merge into one, making it impossible to estimate the two locations independently from the time lags of the troughs. Finding the plucking point of an acoustic guitar is therefore easier, because the autocorrelation of an acoustic guitar signal only produces one trough. 16 Troughs that are closer to zero lag represent pluck or pickup locations nearer to the bridge. Flattening the spectrum emphasises the higher harmonics, enhancing detection of troughs that correspond to positions near the bridge. Over-flattening the spectrum would create unwanted troughs near the zero lag. Figure 8 shows three autocorrelations of the same electric guitar tone where the slope of its spectrum is adjusted differently each time. We can observe that there is an unwanted trough near the zero lag if the spectrum is over-flattened. Moreover, we can also see that by not flattening the spectrum, the two troughs are merged into a single trough.
To solve the problem of merged troughs, where the pluck and pickup locations are close to each other, we employ a grid search to estimate the values. We calculate the mean square error between the autocorrelations of the observed data and our model for plucking points and pickup positions ranging from 25 mm to 180 mm with a spatial resolution of 1 mm. The electric guitar model is calculated using Eq. (3) to avoid using more parameters such as the plectrum and pickup width. Both the spectra of the observed data and the electric guitar model are flattened to À3 dB/octave beforehand. The minimum mean square error gives the estimated pluck and pickup locations. We refer to this method below as ASP1.
Estimates that are located near the bridge can be further improved. While flattening the spectrum to À3 dB/octave might suppress unwanted troughs near zero lag, any correct estimates near the bridge will have a less sharp trough near zero lag in the autocorrelation. To compensate for this problem, we flatten the spectrum to 0 dB/octave for any pluck or pickup estimates that are less than 60 mm from the bridge. Then we repeat the grid search procedure described above, where the range of the search is from 25 mm to the estimated value. This method will be referred to as ASP2.

E. Parameter estimation for mixed pickups
The electric guitar model with in-phase mixed pickup signal, given in Eq. (4), predicts two troughs in the autocorrelation, with time lags corresponding to the locations of the pluck s q and the average of the two pickup locations s i , plus one peak at lag s j corresponding to one half of the distance between the two pickups j. To estimate mixed pickup signals, first we estimate the locations of the pluckq and the average of the two pickupsî using the method described in Secs. V A-V D. Although a humbucker pickup could be considered as a mixed pickup, for our purposes, it will be useful to treat it as a wide single pickup and the lag s i will correspond to the middle of the humbucker. In the case of a known guitar, if the estimatesî are located in between two single pickups, we can assume that a mixed pickup configuration is selected (further details of how pickup configurations are identified using the estimates are discussed in Sec. VI D). Then, we search for s j to estimate the two locations of the mixed pickups (d 1 andd 2 ) and the plucking pointq. The steps of estimatingd 1 ;d 2 ; andq are shown in Fig. 9.  The lagŝ j is estimated using peak and trough detections instead of grid search. We search for peaks and troughs from zero lag until the lag that corresponds to 65 mm (s ¼ 65 T/L). We chose the limit by finding the largest distance j amongst popular electric guitars. A Fender Telecaster has the largest distance between its two pickups which is around 120 mm (i.e., j ¼ 60 mm). We flatten the spectral slope to 0 dB/octave and calculate the log-correlation of the signal as described by Traube and Depalle: 16 Since the lag s j is near zero lag, we chose to flatten the spectrum to 0 dB/octave instead of À3 dB/octave to further emphasise the peaks and troughs in the search range. Furthermore, we take the log magnitude of the spectral peaks to calculate the autocorrelation which emphasises the low amplitude harmonics so that the peaks and troughs will become more apparent.
There are two cases to consider for finding the lag s j : one is when the plucking point distance from the bridge is near the distance j and the other is when the plucking point distance is not close to j. Figure 10 illustrates two logcorrelations with the same mixed pickup configuration where the string is plucked at 30 and 110 mm from the bridge (lags s q are 14.15 and 51.87 samples, respectively). Note that the distance j for this example is 29 mm (s j ¼ 13.66 samples) and the time lag limit for finding the peaks and troughs is 31 samples. Figure 10(a) shows the log-correlation of the electric guitar plucked at a distance from the bridge q % j. To find the estimated lagŝ j , we select the trough or peak that is closest to zero lag. In this example, the trough that corresponds to the plucking point s q seems to be more dominant than the expected peak at s j even though theoretically the peak and trough should cancel each other out. Here, we can assume that the plucking point q is at distance j. Thus, both the estimated lagsŝ j andŝ q are at the first trough which is at 13.01 samples (ĵ andq are 27.41 mm). Note that quadratic interpolation is used to refine the location of the trough. 29 Figure 10(b) shows the log-correlation of the electric guitar plucked at a distance q 6 ¼ j from the bridge. The peak that corresponds to the distance j is apparent. Similarly to the previous case, we are only interested in the trough or peak that is nearest to the zero lag. However, the logcorrelation always starts with a trough. The trough is removed if the absolute amplitude of the trough is less than the amplitude of the peak. Note that this method is also applied to the previous example. Hence, the peak is selected because it is now located closest to zero lag. The lag of the peak is at 14.71 samples which gives the estimated distancê j ¼ 31:08 mm. The peak location is also refined using quadratic interpolation.
Once the distance j is estimated, the estimated locations of the two pickups can be calculated asd 1 ¼î þĵ and d 2 ¼î Àĵ. We first present the results for estimating the pickup and plucking position of the electric guitar from tones recorded from each single pickup. We used the single pickup subset of the dataset described in Sec. II, comprising data from three single pickup configurations: bridge, middle, and neck pickup. The electric guitar is played at eight plucking points on each open string and recorded from all three pickups simultaneously giving a total of 144 audio samples for this experiment.
Using the procedure described in Sec. V, we estimate the plucking point and pickup position for each audio sample independently. Our approach cannot distinguish between estimates belonging to the plucking point and the plucking position. To disambiguate, more information would be required, such as the expected pickup position (i.e., the known physical locations of the pickups on the electric guitar under test). We take the estimated value that is closest to To assess the accuracy of the estimates we calculate the error, e between the estimated and ground truth values. Table II shows the average absolute errors of the plucking and pickup location estimates, comparing results with and without the second stage process described in Sec. V D. The errors for ASP1 range from 2 to 13 mm for plucking point estimation e q and 2-7 mm for pickup position estimation e d . The errors for ASP2 range from 2 to 9 mm for plucking point estimation e q and 2-5 mm for pickup position estimation e d .
The average absolute errors of e q 1 and e d b reduced by 41% and 20%, respectively, when we include the second stage process of ASP2. Overall, by applying the second stage process, the average absolute error of the pickup position estimates is reduced from 3.97 to 3.53 mm and the average absolute error of the plucking point estimates is reduced from 5.90 to 5.11 mm. Figure 11 provides an illustration of the pickup location estimations on the electric guitar using method ASP2, where the real pickup locations are drawn as thick vertical lines and the estimates of the bridge, middle, and neck pickup locations are shown by triangles, circles, and crosses, respectively. Pickups further from the bridge are estimated more accurately, with almost all neck pickup estimates being confined inside a 61 cm error.

B. Mixed pickup data
The electric guitar has two in-phase mixed pickup configurations: a mix of middle pickup and neck pickup (m þ n) and a mix of bridge pickup and middle pickup (b þ m). The method for estimating the locations of the pluck and the two pickups are described in Sec. V E where the distances i and q are estimated using the ASP2 method.
The distributions of absolute errors of the estimated pickup positions e d and plucking point e q are shown in Fig. 12. The thick line inside each box is the median, the bounds of the box represent the interquartile range, and the outliers are represented by the cross symbols (þ). For mixed pickup (b þ m), the median absolute errors of pickup position and plucking point estimates are less than 7 mm. For mixed pickup (m þ n), the median absolute errors of pickup position and plucking point estimates are less than 11 mm. The main source of error for mixed pickup (m þ n) is that the initial estimates of the average pickup positionî and plucking pointq have large errors in some cases. This is caused by some unexpected troughs in the autocorrelation which are more dominant than the troughs corresponding to the ground truth locations. This might be due to the nonlinear interactions between two mixed pickups, then enhanced by the spectral flattening.

C. Comparison with previous method
In this section, we compare the absolute errors for the current method (ASP2) with our previous method (MFS). 18 Our previous method also uses a frequency domain approach where a period of the tone is selected and its Fourier series is calculated. Then, we calculate the electric guitar models for single pickup in Eq. (3) and mixed pickup Eq. (4) for plucking points and pickup positions from 27 to 180 mm. Last, we search for the model that is closest to the observed data by minimising the difference between the magnitude spectrum of the model and observed data. Table III shows the comparisons between the current method and the previous method. For single pickups, the average absolute errors of the estimated pickup position e d and plucking point e q are improved by 55% and 53%, respectively. For mixed pickups, the average absolute error  of the estimated pickup position e d and plucking point e q are improved by 10% and 5%, respectively.

D. Identification of pickup selection
The pickup position estimates can be used to identify which pickup configuration is selected. The electric guitar in this experiment has five pickup configurations, thus five regions can be allocated to distinguish between each other. Note that the mixed pickup signals yield estimatesî in between its two pickups, hence their regions are defined between the single pickup regions. For simplicity, we define the five regions to each have a width of 30 mm. The regions for bridge pickup ranges from 25 to 54 mm, middle pickup ranges from 85 to 114 mm, and neck pickup ranges from 145 to 174 mm. The regions for mixed pickup b þ m ranges from 55 to 84 mm and mixed pickup m þ n ranges from 115 to 144 mm.
The method can accurately identify which pickup configuration is selected. The neck and middle pickups are identified correctly in 97.92% of cases, the bridge pickup and mixed pickup b þ m estimates both have 91.67% correct, while the mixed pickup m þ n is correctly identified for 89.58% of the examples.

VII. RESULTS: VARYING DYNAMICS AND FRET POSITION
In this section, we examine the effects of plucking dynamics and fret positions on the estimates. Because the first dataset does not include multiple plucking dynamics or fret positions, we use the second dataset. We use the ASP2 method to estimate the pickup and plucking locations.

A. The effects of plucking dynamics
The strength with which a string is plucked not only determines the dynamic level of the produced tone, but also has an effect on its timbre. The relative level of high harmonics reduces when the string is plucked softly. Figure 13 shows three magnitude spectra of electric guitar tones played forte (loud), mezzo-forte (moderately loud), and piano (soft) on the open second string. We can see that the level resulting from mezzo-forte and piano plucks at the eighth harmonic are 3 and 8 dB lower, respectively, than for a forte pluck.
In this section, we examine the effects of different plucking dynamics on the estimates when the electric guitar is played on the open strings which in total is 486 audio samples (6 strings Â 3 pickups Â 3 plucking points Â 3 plucking dynamics Â 3 instances). Figure 14 shows the absolute errors of plucking point e q and pickup position e d estimates for each plucking dynamic. For each plucking dynamic, the median absolute errors of pickup estimates are less than 4 mm. The median plucking point estimation error is up to 9 mm and is largest when the electric guitar is played loudly. Also, the number of outliers for both pickup position and plucking point estimation errors increased for louder tones, and to a lesser extent for softer tones, compared with the very robust results for mezzoforte tones. This might be due to the nonlinear behaviour of the string when plucked at a higher force. For softer tones, the outliers are due to the grid search failing to find the troughs of the autocorrelation even though the troughs are around the expected time lag. Nevertheless, 94% and 98% of forte and piano results, respectively, have less than 30 mm absolute error.  and plucking points if different fret positions are played. We test using the electric guitar played moderately loud which totals to 486 audio samples (6 strings Â 3 pickups Â 3 plucking points Â 3 fret positions Â 3 instances). If the electric guitar is fretted, the length of the string is shortened by a factor of 2 F/12 , where F is the fret number. The length of the string when fretted, L F can be computed from the scale length, L as Therefore, a pickup at a fixed location suppresses different harmonics when the string is fretted than when it is open. Figure 15 compares the absolute error of the estimates when the electric guitar is played on open strings, at the fifth fret and the twelfth fret. The median errors for all cases are less than 4 mm. The twelfth fret has the highest number of outliers compared to others, nonetheless, 95% of the results are less than 30 mm. The outliers for the fifth fret are due to unwanted troughs near zero lag. For the twelfth fret, the length of the string is halved (L 12 ¼ L/2), which causes problems for the detection of pickup and pluck positions. Due to symmetry, it is not possible to distinguish a distance x from distance L Fx from the bridge. For open strings and low fret positions, the pickup and pluck can safely be assumed to be located in the half of the vibrating string nearest the bridge, but for higher fret positions, it is possible that the pickup or pluck are nearer to the stopped end of the string than the bridge. Thus any pickup or pluck more than L F /2 from the bridge will not be estimated correctly, which explains most of the outliers observed for the twelfth fret data.

VIII. CONCLUSIONS
We describe a technique to estimate the plucking point and pickup position of an electric guitar based on the autocorrelation of the spectral peaks. Furthermore, we introduce a method to flatten the spectrum that reveals the troughs in the autocorrelation in order to estimate the pickup and plucking locations more accurately. The system is tested on single and mixed pickup configurations. For single pickups, the system is able to accurately estimate the locations of the pickup and the pluck, giving average absolute errors of 3.53 and 5.11 mm, respectively. For mixed pickups, the average absolute errors of the estimated pickup position and plucking point are 8.47 and 9.95 mm, respectively. The pickup position estimates are sufficiently accurate to distinguish which pickup configuration is selected. Also, this method could be used to distinguish between typical guitar models based on the pickup positions. Moreover, we compare our technique with a previous method and show that our current method improves on the accuracy of the estimates.
Last, we examine the effect on the estimates when the electric guitar is played at various fret positions or with various dynamic levels, in order to move closer to real-world situations where any musicians have control over these parameters. Our model works well across a range of dynamics, showing median absolute errors of less than 9 mm in all cases, although the number of outliers increases at both extremes of the dynamic range. The notches in the comb filter produced by the plucking point effect are less sharp due to the nonlinear coupling between vibrating modes, 30 where this effect can be more prominent when the string is plucked very hard. 31 This will depress the expected troughs in the autocorrelation which makes the grid search fail to recognise the troughs. The outliers caused by softer tones are due to the grid search not finding the expected troughs in the autocorrelation.
Likewise, the median error for different fret positions is less than 4 mm in each case, with an increasing number of outliers appearing as the fret number increases. For the fifth fret, the outliers are caused by an unwanted trough near zero lag which is falsely detected by the grid search. The outliers for the twelfth fret are due to the limitation of the procedure for finding the trough in the autocorrelation. Any pickup or pluck outside of this limit cannot be estimated correctly.
Further work can be done to test other techniques to flatten the spectrum, which could help avoid unwanted troughs near zero lag. These experiments use direct input recordings, so another direction of future work is to look into real-world signals (i.e., electric guitar tones recorded through a full production chain, including effects, amplification, mixing, and mastering). The method only finds the pickup positions of in-phase mixed pickups, so further investigation will be done on out-of-phase pickups. For out-of-phase pickups, the trough at lag s i and the peak at lag s j are swapped. Thus, identifying in or out-of-phase mixed pickups might be possible by searching for peaks at a certain range. Finally, our current model is not able to distinguish pluck from pickup estimates; mathematically their effects are identical, but the pluck position varies continuously while the pickup selection is discrete and rarely changes, so combining estimates over sequences of tones could facilitate the separation of these two effects.
Our plucking point and pickup position estimation could lead to several possible applications. The pickup positions and angles of popular guitars are distinct. Thus, accurate pickup position estimates could help musicologists and guitar enthusiasts to determine which guitar model and pickup selection are used in historical recordings where there is limited information about the original instrument. Conversely, the knowledge of musicologists can be used to distinguish pluck from pickup position estimates, e.g., it is known that a player has a tendency of playing near the bridge, thus, the other estimate could be the pickup position. Moreover, the pluck and pickup position estimates could be used as parameters for electric guitar sound synthesis (to use in MIDI guitars or guitar synthesisers with hexaphonic pickups), which opens the possibility of replicating the sound of popular guitarists by extracting relevant parameters from their recordings.