Content uploaded by Maarten Van Walstijn

Author content

All content in this area was uploaded by Maarten Van Walstijn on Sep 08, 2020

Content may be subject to copyright.

Proceedings of the 22nd International Conference on Digital Audio Effects (DAFx-19), Birmingham, UK, September 2–6, 2019

POTENTIOMETER LAW MODELLING AND IDENTIFICATION FOR APPLICATION IN

PHYSICS-BASED VIRTUAL ANALOGUE CIRCUITS

Ben Holmes and Maarten van Walstijn

Sonic Arts Research Centre,

School of Electronics, Electrical Engineering, and Computer Science,

Queen’s University Belfast,

Belfast, UK

{bholmes02@qub.ac.uk,m.vanwalstijn@qub.ac.uk }

ABSTRACT

Physical circuit models have an inherent ability to simulate the be-

haviour of user controls as exhibited by, for example, potentiome-

ters. Working to accurately model the user interface of musical

circuits, this work provides potentiometer ‘laws’ that ﬁt to the un-

derlying characteristics of linear and logarithmic potentiometers.

A strategy of identifying these characteristics is presented, exclu-

sively using input/output measurements and as such avoiding de-

vice disassembly. By breaking down the identiﬁcation problem

into one dimensional, search spaces characteristics are success-

fully identiﬁed. The proposed strategy is exempliﬁed through a

case study on the tone stack of the Big Muff Pi.

1. INTRODUCTION

Virtual Analogue (VA) modelling is largely motivated by the her-

itage aim of recreating analogue effects in functional digital form.

A core component of an analogue effect is its user interface, i.e.

the controls available to the musician to design and ﬁne-tune the

timbral qualities of the effect. To create a complete VA model of a

device, its user interface must therefore also be carefully recreated.

A ubiquitous element of the user interface is found in poten-

tiometers, which are present in countless guitar effects, synthesis-

ers, etc. These devices map a change in rotation (or other move-

ment) to a change in a speciﬁed phenomenon. Often, available

schematics omit potentiometer laws, requiring a method of deter-

mining them from the circuit. Further, ideal laws that are com-

monly used may not truly reﬂect the behaviour of real potentiome-

ters.

The aim of this paper is to investigate, identify, and model

such mappings with a view of incorporating the resulting poten-

tiometer laws into VA circuit models. Physical modelling is a good

match for the overall simulation in this case, as it preserves the cir-

cuit topology, meaning that potentiometer changes result in local

rather than global system changes. This does not hold for black-

and grey-box models [1, 2], which focus on deriving a model for

a single setting. A solution would require interpolation across a

large number of coefﬁcient data sets to facilitate such potentiome-

ter control, equivalent to the strategy used to model a systems’

response to changes in input signal amplitude [3].

The main advantage of black box models is that they are de-

rived entirely from input/output (I/O) measurements, preventing

the need to disassemble a device and so avoiding any risk of dam-

age to the device under test. Previously it was found that for phys-

ical models, values of the components in a circuit can be identiﬁed

using only I/O measurements and positioning potentiometers at the

extreme ends of their travel [4]. The objective of this work is to

1

RT

3

2: Wiper

(a)

(b)

1

yRT(1 −y)RT

3

2

Figure 1: (a) Annotated potentiometer schematic symbol. (b) Sep-

aration of the potentiometer symbol into the inter-terminal resis-

tances as used to model its behaviour. (c) Rotary potentiometer di-

agram with labelled terminals, and the rotating shaft highlighted

and range of rotation indicated, the shaft shown at 0 ◦.

complete a VA circuit model by identifying the underlying char-

acteristic of a potentiometer, again only using I/O measurements.

A key aspect of this challenge is to determine suitable ﬁtting func-

tions.

The rest of this paper is organised as follows: §2 investigates a

variety of potentiometer laws and ﬁts them to characteristics both

from literature and also measurements of individual devices. §3

presents the identiﬁcation strategy used to estimate potentiometer

characterstics from I/O measurements, utilising the Big Muff Pi

tone stack as a case study. §4 then presents the results of the char-

acteristic identiﬁcation from real I/O measurements, and ﬁnally §5

concludes the research and notes lines of future research. Compan-

ion material including MATLAB code and data sets are available

online.1

2. MODELLING POTENTIOMETER

CHARACTERISTICS

Potentiometers are a common component in musical circuits, used

to provide a direct user interface. Some of the most common

applications are for ‘volume’, ‘tone’, ‘gain’, etc. Illustrated in

Figure 1, the potentiometer implements control over such quan-

tities/phenomena by changing two resistances between three ter-

minals relative to the position of its wiper which is actuated by the

user.

The focus of this work is on how those resistances change with

respect to a change in position of the wiper, referred to as its ‘law’.

1https://bholmesqub.github.io/DAFx19/

DAFX-1

Proceedings of the 22nd International Conference on Digital Audio Effects (DAFx-19), Birmingham, UK, September 2–6, 2019

0 0.2 0.4 0.6 0.8 1

0

0.5

1Linear Log ALog

Figure 2: Linear, logarithmic, and anti-logarithmic potentiometer

tapers, ∆dB = 40 dB.

This law effectively maps the user’s control to a change in the be-

haviour of the circuit, and is an essential feature of the user inter-

face. Within the ﬁeld of audio the most commonly encountered

laws are linear and logarithmic, and will be the focus of the pre-

sented modelling and identiﬁcation. Out of these two, it could be

said that the logarithmic law is the most widely used, applied to

map a linear control to logarithmic quantities such as loudness and

frequency for application to volume controls and ﬁlter circuits.

2.1. Ideal laws

This section addresses ‘ideal’ potentiometer laws that are suitable

for musical expression, but may not correspond exactly with how

a physical potentiometer behaves electronically. An ideal poten-

tiometer law is deﬁned having a maximum total resistance RT

which is the sum of resistance between terminals 1 and 3 as il-

lustrated in Figure 1. Each terminal and wiper are assumed to

be perfect conductors i.e. have no resistance. Wiper position is

deﬁned here by the variable xwhich notes the rotation between

terminals, and can be normalised such that 0≤x≤1which

maps to a degree of total rotation usually between 0 and 300 de-

grees. The potentiometer law is deﬁned as a function of the ro-

tation, y=f(x)which dictates the proportion of RTthat each

resistor represents: R1,2=yRTand R2,3= (1 −y)RT, where

subscript indicates terminal index. To reverse the orientation of

the potentiometer the resistors change position between terminals,

modelled as y= 1 −f(x).

Ideal laws are shown in Figure 2, including an antilogarithmic

law in addition to the previously mentioned linear and logarithmic

laws. An ideal linear law can be deﬁned as flin(x) = x. A deci-

bel ranged logarithmic function can be found by placing xin the

exponent,

flog(x) = 10

∆dB

20 (x−1),(1)

where ∆dB is the desired range in decibels. This effectively maps

linear rotation to a logarithmic law, a mapping which is used in

other contexts for example in envelope design [5]. This law never

reaches 0, which corresponds to −inf dB. Should a zero-value be

desired the law can be translated and scaled, though it would then

no longer be truly logarithmic.

The exponent operation can be computationally expensive de-

pending on the system, and often approximations are offered such

as a power law, e.g. f(x) = x4in [5]. Modern audio plug-in

frameworks typically offer a variety of options to suit the needs of

the developer [6].

An anti-logarithmic law is found by reﬂecting the logarithmic

curve around x= 0.5and y= 0.5, i.e. fAlog(x) = ˆ

flog(x)where

ˆ

f(x) = 1 −f(1 −x).

2.2. Laws from speciﬁcations

Though the ideal laws discussed in §2.1 may provide suitable con-

trol in software, these laws are unlikely to be encountered in real

devices. In this section speciﬁcations are ﬁrst investigated from

a modelling perspective to determine which functions are suitable

for capturing the behaviour of a real potentiometer law. Two func-

tions are proposed to model the characteristics encountered in real

devices, a tanh based function for broadly capturing multiple laws

with a single function, and a piecewise function that aims to match

the manufactured composition of the studied devices. The piece-

wise functions are then used to model measurements from real po-

tentiometers that will then be used in the case study of the Big

Muff Pi tone stack in §3.

To utilise data of potentiometer mapping characteristics shown

in ﬁgures in the literature, online software for extracting data from

images was used [7].

2.2.1. An analytic multi-law function

An authoritative source on potentiometers, ‘The Potentiometer

Handbook’ [8] provides a reference for commonly occurring laws

as well as the underlying manufacturing techniques behind them.

The text refers to the Military Speciﬁcation MIL-R-94B (now at

revision G though characteristics are unaltered [9]), reproduced

here in Figure 3. Each of these characteristics deviates from the

ideal law, shown with gentle transitions towards the extreme ends

of the functions. For the laws shown in Figure 3, a suitable non-

piecewise function is found in tanh(), parameterised with 4 free

parameters,

ftanh(x) = t1tanh(t2x+t3) + t4.(2)

By introducing lower and higher limits on the potentiometer func-

tion yland yh, this function can be constrained by requiring

ftanh(0) = yland ftanh (1) = yhresulting in

t4=yl−t1tanh(t3), t1=yh

tanh(t2+t3)−tanh(t3),(3)

leaving free parameters t2and t3. For a full-range law yl= 0

and yh= 1, though due to inherent terminal and wiper resistances

these values will never be found from measurements of a real de-

vice.

The solid lines in Figure 3 show the ﬁt of the tanh law to

those from [8]. The tanh function with 2 free parameters in (2 -

3) were ﬁt using the fit function from MATLAB 2018a’s Curve

Fitting toolbox, with initial parameters t2= 1 and t3=−0.5. For

the anti-log characteristic the function was deﬁned as fAlog

tanh (x) =

ˆ

ftanh(x). The resultant function coefﬁcients are shown in Table 1.

A maximum error of 4% is found in Figure 3 between the

speciﬁed characteristic and ﬁtted function for the logarithmic law,

though most error falls between ±2%. The larger error observed in

the log law can be attributed to it reaching the ylimits prior to the

corresponding xlimits. To mitigate this error, a piecewise function

could be employed with the tanh function only ﬁtting the central

region, and transitioning to a different sub-function in the regions

where the most error is encountered. This would however reduce

the simplicity of the implementation, and other sub-functions may

offer improved ﬁt to real potentiometer device laws. The tanh

function maintains applicability without additional sub-functions,

offering a single function that can model each of the examined

characteristics and providing this ﬂexibility with only 2 parame-

ters.

DAFX-2

Proceedings of the 22nd International Conference on Digital Audio Effects (DAFx-19), Birmingham, UK, September 2–6, 2019

0

0.5

1

0 0.2 0.4 0.6 0.8 1

-2

0

2

4

Error (%)

Linear Log Anti-Log

Figure 3: Speciﬁed linear, logarithmic, and anti-logarithmic po-

tentiometer tapers. The speciﬁed characteristic is marked by 5,

and the ﬁt using a tanh function by the solid lines. Error is shown

in the lower plot.

Table 1: Fit parameters of the general tanh function to the po-

tentiometer laws speciﬁed in [8]. Limits are given as yl= 0 and

yh= 1.

tLinear Log ALog

t10.701 0.566 0.536

t21.790 4.400 5.113

t3−0.919 −3.380 −3.787

t40.508 0.564 0.535

2.2.2. Piecewise linear/cubic functions

The speciﬁc potentiometers investigated within this work are of

the brand Alpha, a popular brand in the building of guitar effects-

pedals. Speciﬁcations for the potentiometer laws are found on

their website [10]. Again the tanh function could be employed

to model both linear and logarithmic laws for these speciﬁcations,

however after an initial study the error peaked at 8% at the same re-

gion as observed in Figure 3, though a ﬁgure of this result is omit-

ted for brevity. To reduce this error a piece-wise function would

need to be used to capture the end-regions where the function gra-

dient is zero. In the case that a piecewise function is required, it is

a logical step to test which functions can provide the optimal ﬁt.

The logarithmic characteristics from [10] are reproduced in

Figure 4. Each law is speciﬁed by the percentage of total resis-

tance between terminals 1 and 2 at 50 % rotation. Upon inspection

of this set of characteristics there appear distinct sections with con-

stant gradients, joined via smooth transitions. This property can be

exploited through the use of a piecewise function containing linear

sub-functions. Deﬁning a linear sub-function with local lower and

higher limits – yll =¯

flin(xll )and ylh =¯

flin(xlh )– results in the

expression

¯

flin(x) = ylh −yll

xlh −xll

(x−xll) + yll ,¯

f0

lin(x) = ylh −yll

xlh −xll

.(4)

The derivative of the linear sub-function is important here as there

are no apparent jumps in gradient in any of the characteristics, and

so the gradient of the sub-functions must match at the transitional

values of the piecewise function. To achieve a match in derivatives

at transitional points, 4 free parameters would be required, two for

each transitional point, matching value and derivative. One such

sub-function that offers this is found in a general cubic polynomial,

expressed as

¯

fcub(x) = c4x3+c3x2+c2x+c1,(5)

where c1–c4are the cubic coefﬁcients used to ﬁt the sub-function

¯

fcub(x). To ﬁnd values for c1–c4the following set of equations

must be solved,

¯

fcub(xll ) = c4x3

ll +c3x2

ll +c2xll +c1,(6)

¯

fcub(xlh ) = c4x3

lh +c3x2

lh +c2xlh +c1,(7)

¯

f0

cub(xll ) = 3c4x2

ll + 2c3xll +c2,(8)

¯

f0

cub(xlh ) = 3c4x2

lh + 2c3xlh +c2.(9)

An explicit solution of this set of equations is available on the sup-

porting online content, but is omitted here for brevity.

The choice of the linear-cubic piecewise function aims to build-

in the speciﬁed behaviour of the manufacturer’s characteristics. By

matching the underlying structure of potentiometer characteristics,

the ability to produce an accurate law from a reduced/incomplete

set of measurements is improved, without needing a higher num-

ber of measurements to interpolate between.

From the speciﬁed or measured potentiometer characteristics a

set of xvalues can be found at which the function transitions from

linear to cubic (either through direct visual inspection or inspection

of the gradient of the law). At these points the corresponding y

values can be found by interpolating between the available data

points of the characteristic, yielding a set of points that make up

the piecewise function transitions.

In Figure 4, logarithmic characteristics from [10] are shown

with their piecewise ﬁt. The transitional points are approximately

equal between each function, meaning that only one set of xvalues

was required to ﬁt the full set of characteristics. These values of

xand the corresponding yvalues are shown in Table 2 where they

are marked with their respective sub-function. A total of 7 piece-

wise sections were needed to match the characteristic speciﬁed by

the manufacturer. The solid line in Figure 4 shows the ﬁt of the

piecewise function to the speciﬁcation, the error between the two

shown in the plot beneath. A peak error of 2% is found for the

15A law, with most error for each law falling within ±1%.

Figure 5 shows the characteristics as given for ‘linear’ laws

from [10]. A similar level of accuracy can be achieved using only

5 piecewise sections as opposed to the 7 used for the logarithmic

characteristics. The piecewise transitional points for each of these

laws varies signiﬁcantly, necessitating an individual search for the

characteristic xvalues at which the transitions occur, found using

an optimisation algorithm.

From MATLAB’s Optimisation toolbox the Nelder-Mead al-

gorithm was selected for an easy-to-implement, derivative-free al-

gorithm to minimise the error of the function to the characteristic

by changing transitional values of x[11]. Four xvariables were

gathered into θxto use as parameters, excluding those at 0 and 1.

The corresponding estimated values of ˆ

f(x, θx)were then found

through interpolating between the available values of y, and a com-

plete piecewise function was assembled. The employed objective

function,

ξx(θx) = 1

η

Ns

X

n=0

yn−ˆ

f(xn,θx)2, η =

Ns

X

n=0

y2

n,(10)

DAFX-3

0

0.2

0.4

0.6

0.8

105A

10A

15A

20A

25A(K)

30A

0 0.2 0.4 0.6 0.8 1

-2

-1

0

1

Error (%)

Figure 4: Logarithmic Alpha characteristics (5marks), and ﬁt us-

ing linear-cubic piecewise functions (solid lines). Characteristics

are noted by the manufacturer’s code which refer to the resistance

percentage at 50% rotation. Error is shown in the lower plot. Ver-

tical dashed lines mark the points at which the piecewise function

sections change.

enumerates the sum-squared error between the measured points of

f(xn) = ynand those found using the piecewise function with

estimated transitional points ˆ

f(xn,θx). A normalisation factor η

is applied to ensure that between data sets with different numbers

of elements, the enumerated error would be comparable, allowing

comparison between the results of the optimisation using different

data sets.

Constraints are applied directly to the objective function, re-

turning ξx= 103if the constraints are not satisﬁed. These con-

straints prevent xvalues from exceeding domain limitations, i.e.

0≤θx≤1, and that they are incremental in value, i.e. for the jth

element θj

x< θj+1

x.

Convergence tolerances were set at a change in value beneath

10−8for both θxand ξx(θx). The resulting optimised xand cor-

responding yvalues are omitted here for brevity but can be found

on the companion webpage. The solid line in Figure 5 represents

the ﬁtted piecewise function for each law, with the error between

ﬁt and speciﬁcation shown in the lower plot. Peak error is approx-

imately 1.2% with most contained within ±1%.

With suitable functions that match the speciﬁed potentiometer

laws to within 2% error, the following step is to apply this function

to model the characteristic of real potentiometer devices.

2.3. Measured potentiometer characteristic

Several potentiometers were purchased from a local distributor of

components for the DIY construction of guitar effects pedals. This

source was selected to ensure that the potentiometers would be

intended for the use in guitar effects pedals, and that they could

be used to determined which laws from the presented sets in Fig-

ures 4 and 5 are used in potentiometers popular among effects-

builders. The purchased potentiometers were speciﬁed to have

RT= 100 kΩ (±20%) as this is the value of the potentiometer

used in the Big Muff Pi tone stack, further discussed in §3.

0

0.2

0.4

0.6

0.8

1

B

1B

2B

3B

4B

5B

0 0.2 0.4 0.6 0.8 1

-1

0

1

Error (%)

Figure 5: Linear Alpha characteristics from (5marks), and ﬁt us-

ing linear-cubic piecewise functions (solid lines). Characteristics

are noted by the manufacturer’s code. Error is shown in the lower

plot. Transitions are omitted for this ﬁgure as they each fall at

different values.

Table 2: Optimised transition points of the general cubic-linear

piecewise function, ﬁt to the logarithmic potentiometer character-

istic speciﬁed in [10]. Values are rounded to 3 decimal places.

‘Law’ column is offset to indicate which law corresponds to each

set of end-points.

Law x y

05A 10A 15A 20A 25KA 30A

Lin. 0.000 0.000 0.000 0.000 0.000 0.000 0.000

Cub. 0.050 0.003 0.003 0.003 0.004 0.002 0.004

Lin. 0.300 0.015 0.028 0.063 0.084 0.123 0.151

Cub. 0.510 0.057 0.111 0.162 0.210 0.259 0.311

Lin. 0.700 0.284 0.363 0.410 0.443 0.501 0.542

Cub. 0.920 0.954 0.959 0.958 0.952 0.954 0.965

Lin. 0.970 0.999 0.999 1.000 1.000 0.999 1.000

1.000 1.000 1.000 1.000 1.000 1.000 1.000

To measure the potentiometer characteristic, a measurement

jig was designed with markers at 15 degree angles around a cen-

tral hole where the potentiometer was ﬁxed. The markers were

placed using computer aided design/manufacturing, the jig made

from FR-4 with plated copper as used in circuit-board manufactur-

ing techniques.

Direct measurements presented here are only cursory to pro-

vide an approximate law with which to compare to those found

through the following identiﬁcation from I/O measurements. The

potentiometer was rotated by hand to line the knob indicator to

each marker, while the resistance between adjacent terminals was

measured continuously with an LCR meter. Measuring the resis-

tance at 15 degree increments over a total of 300 degrees of travel

yielded 21 measurements. The obtained characteristics can be con-

sidered as suitably representative test data even in the presence

of possible measurement errors, including human error when per-

forming the manual wiper rotation and heating from continuous

DAFX-4

0

0.2

0.4

0.6

0.8

1

Lin

Log

0 0.2 0.4 0.6 0.8 1

-1

0

1

Error (%)

Figure 6: Measured (5marks) and ﬁt linear-cubic (solid lines)

potentiometer laws of 1 linear and 1 logarithmic potentiometer.

Error is shown in the lower plot. The laws of the two potentiome-

ters ﬁt with that of ‘B’ from Figure 5 and ‘15A’ from Figure 4.

Table 3: Optimised transition points of the general cubic-linear

piecewise function, ﬁt to measurements taken of a linear and log-

arithmic potentiometer. Values are rounded to 3 decimal places.

‘Law’ column is offset to indicate which law corresponds to each

set of end-points.

Linear Log

Law x y x y

Lin. 0.000 0.000 0.000 0.000

Cub. 0.050 0.000 0.071 0.005

Lin. 0.093 0.041 0.239 0.045

Cub. 0.951 1.000 0.603 0.215

Lin. 0.951 1.000 0.659 0.368

Cub. 1.000 1.000 0.850 0.939

Lin. - - 0.908 0.997

- - 1.000 1.000

driving from the LCR meter. Other physical parameters exist for

the potentiometer in addition to its law, such as terminal resistance,

but these were found to be of a magnitude that was impossible to

measure with available equipment, and therefore likely insigniﬁ-

cant to the identiﬁcation.

Figure 6 shows the measured characteristics of both a lin-

ear and a logarithmic potentiometer, and the ﬁt of the piecewise

linear-cubic function to the measurements. A notable deviation

was found from the logarithmic tapers of Figure 4, with the tran-

sition to the zero-gradient section at the maximum of the function

occurring at a lower value of x. Therefore the optimisation ap-

proach used to ﬁt the linear characteristics of Figure 5 was applied,

i.e. the xpositions found by optimising them and ﬁnding the cor-

responding values of ythrough interpolation of the measurement.

The result is a good ﬁt to the measurements with a peak error just

over 1%. Final transitional values of the piecewise function are

shown in Table 3.

3. IDENTIFYING POTENTIOMETER

CHARACTERISTICS FROM I/O MEASUREMENTS

Having ﬁt laws to characteristics obtained from both linear and

logarithmic potentiometers, sufﬁcient information is available to

validate results from the law identiﬁcation strategy exclusively us-

ing input/output measurements, presented in this section. The case

study chosen to demonstrate this strategy is the tone stack from

the Big Muff Pi, informed from the description in [12], with the

schematic shown in Figure 7. In simple terms, the potentiometer

in the Big Muff Pi tone stack blends between a low pass formed

between R1and C2, and a high pass ﬁlter formed by C1and R2.

Both linear and logarithmic potentiometers will be used to demon-

strate the capability of the identiﬁcation strategy to succeed inde-

pendent of potentiometer law.

The tone stack was assembled on a breadboard to enable di-

rect measurement of each component prior to the measurement

of the circuit’s transfer function. Use of a breadboard also facili-

tates the measuring of both linear and logarithmic potentiometers

to demonstrate the identiﬁcation procedure for the two most com-

mon laws. Speciﬁed and directly measured component values can

be found in Table 4.

Only one potentiometer is present in the circuit. The presented

method should allow for independent identiﬁcation of multiple po-

tentiometers by setting all but the potentiometer of interest at a

known position, at 0 or 300 degrees rotation, resulting in N×M

independent identiﬁcations where Nis the number of positions per

potentiometer and Mthe number of potentiometers. This prop-

erty cannot be demonstrated using this circuit, but can be inferred

as only one variable, a single potentiometer position, would be

changed in between each measurement.

To begin identifying the potentiometer laws from input/output

measurements, one must start with estimates of the component

values, obtained from schematics or other identiﬁcation strategies.

Should the component values be highly accurate, the input/output

measurements should theoretically be matched when the poten-

tiometer is at either extreme of its rotational travel. At these points

the values of yare assumed known. The accuracy of the ﬁt achieved

at these limits will provide some indication of how accurately the

law can be retrieved.

The selection of a linear case study provides several desirable

traits: the circuit model can be represented using a transfer func-

tion which requires only a few data points to capture a large fre-

quency range, and issues of nonlinear behaviour such as aliasing

are avoided. The tone stack is modelled as a transfer function de-

rived using Modiﬁed Nodal Analysis [13]. The resultant function

is of the form

H(jω) = b3(jω)3+b2(jω)2+b1j ω

a4(jω)4+a3(jω)3+a2(j ω)2+a1(jω)1+a0

.

(11)

Complete coefﬁcients are omitted due to their complexity, but MAT-

LAB code for calculating the transfer function is available on the

companion webpage. Figure 8 shows the simulated amplitude re-

sponses of the Big Muff Pi’s tone stack with the potentiometer at

each end of its travel: presuming these responses to be accurate

the challenge then lies in measuring intermediate responses and

identifying the corresponding values of f(x).

DAFX-5

Table 4: Component values of the Big Muff Pi tone stack: speciﬁed

values and the values directly measured from the circuit using an

LCR meter.

Unit Speciﬁed Measured

R1kΩ 39.000 39.080

R2kΩ 22.000 21.950

RTkΩ 100.000 94.940 (lin) / 98.140 (log)

RokΩ 100.000 99.978

C1nF 4.700 4.698

C2nF 10.000 9.470

C3nF 100.000 98.010

CdpF 100.000 33.227

R1

(1 −y)RT

C1

yRT

R2

C2

C3

RoCd

+

−

Vo

+

−

Vi

Figure 7: Schematic of the Big Muff Pi tone stack with potentiome-

ter marked by red line. Cdis the input capacitance of the mea-

surement equipment used.

3.1. Identiﬁcation strategy

The identiﬁcation strategy proposed in this work identiﬁes a po-

tentiometer’s characteristic from input/output measurements of a

circuit. A series of optimisations are performed, only operating

on a single value of xat a time. Values of y=f(x)are es-

timated at each point, thus identifying the potentiometer charac-

teristic. To perform such optimisations, an objective function is

required which compares the measurements of the circuit to the

equivalent data from the model, enumerating the error between

circuit and model.

Considering the linear case exhibited by the Big Muff Pi tone

stack, the input/output measurements can be condensed into the

form of a transfer function. Due to the limitations of the measure-

ment equipment (further discussed in Section 3.2) only the ampli-

tude response of the transfer function is used, with phase informa-

tion discarded. From this information the objective function was

constructed, for an estimated value of y=f(x),

ξio(y) = 1

PNs−1

n=0 |H(jωn)|2

Ns−1

X

n=0

|H(jωn)| − | ˆ

H(jωn, y )|2,

(12)

where the operator |· | indicates the magnitude of a complex value.

Frequencies of the transfer function are speciﬁed using ωn, where

nindicates index of the discrete frequency selected to be included

20 200 2 k 20 k

Frequency (Hz)

-40

-20

0

Amplitude (dB)

Figure 8: Amplitude responses of the Big Muff Pi tone stack with

the potentiometer at extreme ends of its rotational travel.

in the measurement data.

The optimisation algorithm chosen to minimise the value of

ξio(y)was that of fminsearch from MATLAB’s optimisation

toolbox, speciﬁcally the Nelder-Mead simplex algorithm. Conver-

gence conditions were again set to be a change in yor ξio less

than 1×10−8. Initial experiments using simulated I/O measure-

ments demonstrated successful identiﬁcation of the potentiometer

characteristics to within 10−5%of the accurate value.

3.2. Measurement procedure

Among various possible valid measurement approaches to ﬁnd the

transfer function of the Big Muff Pi tone stack, a multi-sine exci-

tation signal was chosen, expressed as

Vi=Vp

du

X

d=dl

Adcos(2πdf0nT +φd), n = 0,...,Ns.(13)

The integer values of dare limited to contain sinusoidal compo-

nents at multiples of f0=fs/Nsbetween the lower and upper

limits dland du. Phase terms φdare speciﬁed as in [14], i.e.

φd=−2π

d−1

X

l=1

(d−l)Ad, d =dl, dl+ 1, ..., du.(14)

which requires that 1 = Pdu

d=dlAd. Individual amplitude com-

ponents allow a frequency-domain weighting to be applied which

can be used to maximise the signal-to-noise ratio, but in this case

were set to be Ad= 1/(du−dl).

Finally the value of Vpis selected such that the peak voltage of

the resultant signal is normalised to a chosen peak voltage typically

as deﬁned by the measurement equipment.

To produce a transfer function from the measured output of

the circuit, the input is deconvolved from the output signal by per-

forming an element-wise division in the frequency domain.

An excitation signal was designed with frequencies between

1 Hz −20.1 kHz, i.e. f0= 1,dl= 1 and dh= 20100. The

measured frequency range was measured outside of the anticipated

required range in case this information was important to the identi-

ﬁcation, though the range is later restricted to 20 Hz –20 kHz. The

limitations of the analogue input was 2 V which was used to ﬁnd

the value of Vp. The signal was repeated 60 times and averaged to

one period to reduce stochastic noise.

The measurement equipment used is a National Instruments

myDAQ. Previous experiments with Data Acquisition devices and

identiﬁcation have shown that any errors in the phase response can

severely effect accuracy in the identiﬁcation procedure [4]. Upon

DAFX-6

0

0.25

0.5

0.75

1Lin

Log

0 0.2 0.4 0.6 0.8 1

0

2

4

Error (%)

Figure 9: Potentiometer laws as directly measured (solid line) and

estimated from I/O measurements (5marks), and error between

the two sets presented beneath.

detection of phase error by testing the unloaded I/O response, it

was decided that the phase response should be omitted from the

identiﬁcation data.

A notable capacitance was measured across the input to the

myDAQ, noted as Cdin Table 4. This capacitance was included

in the circuit model to incorporate any effect it may have on the

measured transfer functions. The measured value of Cdwas found

by driving a series impedance of 2 MΩ with a multi-sine signal,

and measuring the cutoff frequency of resulting RC low pass ﬁlter

at approximately 2.395 kHz.

Measurements were taken from 21 positions along the rota-

tional axis of both the linear and logarithmic potentiometers (15

degree rotations from 0-300 degrees). The amplitude response of

each of the measured transfer functions was then used to estimate

the value of yat each position. To minimise computational ex-

pense during optimisation, the transfer function data was down-

sampled from 20.1×103data points to 512 points spaced loga-

rithmically between 20 Hz and 20 kHz, each point rounded to the

nearest integer such that it corresponds to a measured value, not re-

quiring interpolation. Removing duplicate entries that occur at low

frequencies results in a unique set of 469 amplitudes/frequencies.

4. RESULTS

Optimisation was applied as described in Section 3.1, using the

Nelder-Mead algorithm and the objective function described in

(12). Convergence was achieved successfully from each optimi-

sation.

The identiﬁed potentiometer laws for both linear and logarith-

mic potentiometers are shown in Figure 9, with the solid line rep-

resenting the directly measured law and the 5marking the values

estimated using the identiﬁcation strategy. Error between the sets

peak at approximately 4.5 % for the logarithmic characteristic and

3 % for the linear characteristic.

Illustrated for both potentiometer laws in Figure 10 are the

measured and identiﬁed amplitude responses of the Big Muff Pi

tone stack. This serves to provide one way of attributing error but

also as a source of validation. Inspecting the xvalues of high er-

ror in Figure 9 it is clear that there is not an anomalous amount of

error in the ﬁt to the amplitude response at corresponding values.

Consistent accuracy from identiﬁed amplitude responses but in-

creasing error in the identiﬁed potentiometer characteristic points

towards the error being introduced by device heating/human error

during measurement.

As a form of validation, the ﬁt to measurements demonstrated

in Figure 10 is accurate to within 1 dB across all measurements,

indicating that the tone stack ﬁltering effect is captured over the

the full wiper range.

5. CONCLUSION

This work has focused on the modelling and identiﬁcation of po-

tentiometer laws without device disassembly. Two functions were

proposed to model potentiometer characteristics as found in spec-

iﬁcations and from measurements, a tanh() based function and a

piecewise linear-cubic function. The latter was used to model the

laws of Alpha potentiometers as given by both speciﬁcations and

measurements within 2% error.

Identiﬁcation of the potentiometer characteristics from I/O mea-

surements of the device was tested on a linear subcircuit of the Big

Muff Pi: the tone stack. Identiﬁcation exclusively using the ampli-

tude response of the subcircuit was shown to be possible, with the

results of the identiﬁcation retrieving both linear and logarithmic

potentiometer characteristics to within 4.5% error.

It is likely that some of this 4.5% error has been introduced

by device heating and/or human error. Increasing the precision

and repeatability of the measurements could be achieved by the

design of an automated mechatronic system that would simultane-

ously rotate the potentiometer wiper and perform measurements.

One such solution might involve e.g. a stepper motor to control

the potentiometer and a pulsed measurement system to control the

variation in resistance caused by changes in temperature.

For those seeking a fast method of determining the orienta-

tion and approximate law of a potentiometer, a complete set of

21 points is not required. Assuming f(0) and f(1) are known,

from e.g. parameter estimation as in [4], only one additional mea-

surement at f(0.5) is sufﬁcient to differentiate between linear and

logarithmic/anti-logarithmic. A further measurement at e.g. f(0.25)

or f(0.75) would then enable differentiation between orientations

of the potentiometer and also logarithmic and anti-logarithmic laws.

The anticipated application of this identiﬁcation strategy is for

complete, nonlinear audio circuits. Elements that may cause is-

sues in the identiﬁcation include nonlinear behaviour, and effects

for which potentiometers control behaviour that is difﬁcult to mea-

sure, e.g. LFO rate in a phasor effect. The low-data point ampli-

tude response facilitates fast identiﬁcation, which has signiﬁcant

beneﬁts with regard to rapid design and reﬁnement of the identiﬁ-

cation process. Time-based and/or nonlinear effects would prevent

this selection and therefore demand a search for a suitable, simi-

larly efﬁcient, objective function. For example, a gain control may

use the Total Harmonic Distortion of the output waveform when

driven by a sinusoid, or for a delay length control, the time be-

tween repeats when driven by a pulse-type signal. Each control

type requires individual attention, but due to the monotonic nature

of the studied potentiometer laws, and as each potentiometer can

be identiﬁed independently, each position should yield a unique

measured value, so long as the objective function is well-chosen.

DAFX-7

-30

-20

-10

0

Amplitude (dB)

Linear law

20 200 2k 20k

Frequency (Hz)

0

0.5

1

Error (dB)

Log law

20 200 2k 20k

Frequency (Hz)

Figure 10: Estimated (dotted) and measured (solid) amplitude responses of the Big Muff tone stack, with error in decibels shown below.

Only 11 of the 21 measured amplitude responses are shown to improve clarity of the ﬁgure.

6. REFERENCES

[1] Felix Eichas and Udo Zölzer, “Gray-Box Modeling of Guitar

Ampliﬁers,” Journal of the Audio Engineering Society, vol.

66, no. 12, pp. 1006–1015, Dec. 2018.

[2] Antonin Novak, Pierrick Lotton, and Laurent Simon, “Syn-

chronized Swept-Sine: Theory, Application, and Implemen-

tation,” Journal of the Audio Engineering Society, vol. 63,

no. 10, pp. 786–798, Nov. 2015.

[3] Lamberto Tronchin and Vanna Lisa Coli, “Further Investi-

gations in the Emulation of Nonlinear Systems with Volterra

Series,” Journal of the Audio Engineering Society, vol. 63,

no. 9, pp. 671–683, Oct. 2015.

[4] Ben Holmes, Guitar Effects-Pedal Emulation and Identiﬁca-

tion, Ph.D. thesis, Queen’s University Belfast, June 2019.

[5] Miller Puckette, The Theory and Technique of Electronic

Music, World Scientiﬁc Publishing Co. Pte. Ltd., 2007.

[6] Oliver Larkin, Alex Harker, and Jari Kleimola, “iPlug 2:

Desktop Plug-in Framework Meets Web Audio Modules,” in

Proceedings of the 4th Web Audio Conference, Sept. 2018.

[7] Ankit Rohatgi, “WebPlotDigitizer,”

https://automeris.io/WebPlotDigitizer/, Apr. 2019.

[8] Carl David Todd, The Potentiometer Handbook: Users’

Guide to Cost-Effective Applications, McGraw-Hill, New

York, 1975.

[9] U.S.A. Department of Defense, “Military speciﬁcation MIL-

PRF-94G: Resistors, variable, composition general speciﬁ-

cation for,” Tech. Rep., Aug. 2011.

[10] Alpha Products, “Taper Curves for our Potentiometers,”

http://www.alphapotentiometers.net/html/taper_curves.html,

2014.

[11] Jeffrey C. Lagarias, James A. Reeds, Margaret H. Wright,

and Paul E. Wright, “Convergence properties of the

Nelder–Mead simplex method in low dimensions,” SIAM

Journal on Optimization, vol. 9, no. 1, pp. 112–147, 1998.

[12] Electrosmash, “Big Muff Pi Analysis,”

https://www.electrosmash.com/big-muff-pi-analysis.

[13] Chung-Wen Ho, Albert E. Ruehli, and Pierce A. Brennan,

“The Modiﬁed Nodal Approach to Network Analysis,” IEEE

Transactions on Circuits and Systems, vol. 22, no. 6, pp.

504–509, 1975.

[14] Manfred Schroeder, “Synthesis of low-peak-factor signals

and binary sequences with low autocorrelation (Corresp.),”

Information Theory, IEEE transactions on, vol. 16, no. 1, pp.

85–89, 1970.

DAFX-8