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 325<br />

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

holeMatrix = tubeMatrix(f, hole->c, hole->rho, t, b, 1);<br />

/* calculate the load (radiation) impedance <strong>of</strong> the hole */<br />

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

Z_L = (hole->key == NULL) ?<br />

closedFingerHoleLoadZ(f, hole) :<br />

closedKeyedHoleLoadZ(f, hole);<br />

else<br />

Z_L = (hole->key == NULL) ?<br />

openFingerHoleLoadZ(f, hole) :<br />

openKeyedHoleLoadZ(f, hole);<br />

}<br />

return calcZin(holeMatrix, Z_L);<br />

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

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

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

double delta = b / a;<br />

double t_finger;<br />

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

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

t_finger = CORR_CLOSED_FINGER_HOLE_LENGTH * delta * b;<br />

}<br />

return imaginary(-Z0 / tan(k * t_finger));<br />

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

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

double t_keypad;<br />

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

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

t_keypad = CORR_CLOSED_KEYED_HOLE_LENGTH * b;<br />

if (t_keypad == 0) return inf;<br />

return imaginary(-Z0 / tan(k * t_keypad));<br />

}<br />

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

double a, b, k;<br />

complex Z_flanged, Z0, d_flanged, d_cyl, Z;<br />

/* a is the radius <strong>of</strong> the hole */<br />

a = hole->radius;<br />

/* b is the radius <strong>of</strong> the (cylindrical) flange */<br />

b = hole->boreRadius + hole->length;<br />

/* calculate the wavenumber */<br />

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

/* calculate the characteristic impedance */<br />

Z0 = charZ(hole->c, hole->rho, a);<br />

/* calculate the impedance <strong>of</strong> the (infinitely) flanged hole */<br />

Z_flanged = flangedZ(f, hole->c, hole->rho, a);

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

Saved successfully!

Ooh no, something went wrong!