Mathematical Fundamentals
117
0
1
2
3
4
0
50
100
150
200
Pitch of note as a function of string length
l [m]
h [Hz]
Figure 2: Pitch of a note as a function of string length
h=1./(2*l)*sqrt(t/r); % expression for pitch
plot(l,h);
grid; title('Pitch of note as a function of string length');
xlabel('l [m]');
ylabel('h [Hz]');
% replot; % Octave only
In order to visualize functions of two variables, we can also use three-
dimensional representations. For example, the function (5) can be visualized
as in fig. 3 if the variables length and tension are defined over intervals and the
density is set to a constant. In such a representation, the function of two depen-
dent variables becomes a surface in 3D. The Octave/Matlab script for fig. 3 is
0
2
4
800
1000
1200
0
100
200
l [m]
Pitch of note as a function of string length and tension
t [N]
h [Hz]
Figure 3: Pitch of a note as a function of string length and tension
the following:
r=0.0367;
% definition of density
l=[0.5:0.1:4.0]; % domain for the string length
t=[800:10:1200]; % domain for the string tension
h=(1./(2*l')*sqrt(t./r))'; % expression for pitch
mesh(l,t,h);
grid; title('Pitch of note as a function of string length and tension');
Next Page >>
<< Previous Page