118
D. Rocchesso: Sound Processing
multivariable function
contour plot
polynomials
coefficients
xlabel('l [m]');
ylabel('t [N]');
zlabel('h [Hz]');
% replot; % Octave only
Of a multivariable function we can also give the contour plot, i.e., the plot of
curves obtained for constant values of the dependent variable. For example, in
the function (5), if we let the dependent variable to take only seven prescribed
values, the cartesian plane of length and tension displays seven curves (see fig. 4).
Each curve corresponds to an horizontal cut of the surface of fig. 3.
1
2
3
4
800
900
1000
1100
1200
38.8
59
79.3
99.6
120
140
161
Pitch of note as a function of string length and tension
l [m]
t [N]
Figure 4: Contour plot of pitch as a function of string length and tension
The Octave/Matlab script producing fig. 4 is 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
% contour(h', 7, l, t); % Octave only
co=contour(l, t, h, 7); % Matlab only
clabel(co);
% Matlab only
title('Pitch of note as a function of string length and tension');
xlabel('l [m]');
ylabel('t [N]');
zlabel('h [Hz]');
A.3
Polynomials
An important class of one-variable functions is the class of polynomials, which
are weighted sums of non-negative powers of the independent variable. Each
power with its coefficient is called a monomial. A polynomial has the form
y = f (x) = a
0
+ a
1
x + a
2
x
2
+ . . . + a
n
x
n
,
(6)
where the numbers a
i
are called coefficients and, for the moment, they can be
considered as real numbers. The highest power that appears in (6) is called the
order of the polynomial.