11.07.2014 Views

Flute acoustics: measurement, modelling and design - School of ...

Flute acoustics: measurement, modelling and design - School of ...

Flute acoustics: measurement, modelling and design - School of ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

APPENDIX B. PROGRAM LISTINGS 327<br />

}<br />

return Z;<br />

complex holeInnerRadiationImpedance(double f, Hole hole) {<br />

double t_i;<br />

double Z0 = charZ(hole->c, hole->rho, hole->radius).Re;<br />

double k = (2*M_PI*f)/hole->c;<br />

t_i = innerRadiationLengthCorrection(hole->boreRadius,<br />

hole->radius);<br />

return imaginary(t_i * k * Z0);<br />

}<br />

complex holeSeriesImpedance(double f, Hole hole) {<br />

double a = hole->boreRadius;<br />

double b = hole->radius;<br />

double delta = b / a;<br />

double t = hole->length, t_0 = 0, t_a;<br />

double Z0 = charZ(hole->c, hole->rho, hole->boreRadius).Re;<br />

double k = (2*M_PI*f)/hole->c;<br />

if (strcmp(hole->fingering, "CLOSED") == 0) {<br />

if (hole->key == NULL)<br />

t_0 = b * (0.55 - 0.15 / cosh(9 * t / a) + 0.4<br />

/ cosh(6.5 * t / a) * (delta - 1));<br />

t_a = closedHoleSeriesLengthCorrection(a, b, t - t_0);<br />

}<br />

else<br />

t_a = openHoleSeriesLengthCorrection(a, b);<br />

}<br />

return imaginary(t_a * k * Z0);<br />

TransferMatrix embouchureMatrix(double f, EmbouchureHole h,<br />

double entryratio, complex branchZ) {<br />

TransferMatrix m, riserMatrix, cornerMatrix, innerRadMatrix;<br />

double t_m, t_i, t_a;<br />

double radiusin, radiusout;<br />

complex Z_i, Z_a;<br />

double Z0_hole = charZ(h->c, h->rho, h->radiusin).Re;<br />

double Z0_bore = charZ(h->c, h->rho, h->boreRadius).Re;<br />

double k = (2*M_PI*f)/h->c;<br />

/* calculate the matching length correction */<br />

t_m = matchingLengthCorrection(h->boreRadius, h->radiusin);<br />

/* introduce lossy elements to account for the discontinuity */<br />

m = identitym();<br />

m->B = embouchureSeriesResistance(f, h, entryratio);<br />

m->C = embouchureShuntConductance(f, h, entryratio);<br />

/* calculate the matrix (with losses) for the tube section<br />

comprising the hole <strong>and</strong> matching length */<br />

radiusin = h->radiusin;<br />

radiusout = entryratio * h->radiusout;<br />

riserMatrix = (radiusin == radiusout) ?<br />

tubeMatrix(f, h->c, h->rho, h->length + t_m, radiusin, 1) :

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!