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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

APPENDIX B. PROGRAM LISTINGS 244<br />

/*<br />

Minima.h<br />

By Andrew Botros, 2001-2004.<br />

Modified by Paul Dickens, 2006-2007.<br />

Listing B.13: Minima.h<br />

Characterises the minima <strong>of</strong> acoustic impedance spectra.<br />

IMPORTANT: Calculations are optimised for a spectrum resolution <strong>of</strong><br />

2Hz.<br />

NOTE: The weighting <strong>of</strong> the frequency <strong>of</strong> an impedance extremum fit to<br />

favour the absolute emtremum has been changed to an option in the<br />

function 'parabolaExt' with a default <strong>of</strong> 0 (no weighting). A block<br />

has also been added to the function 'extrema' to h<strong>and</strong>le the case<br />

when the next point to be considered is equal to the previous one<br />

(this fixed a bug in the code).<br />

*/<br />

#ifndef MINIMA_H_PROTECTOR<br />

#define MINIMA_H_PROTECTOR<br />

#include "Vector.h"<br />

#include "Note.h"<br />

/* minmax: a minimum/maximum flag type */<br />

typedef enum {MINIMUM, MAXIMUM} minmax;<br />

/*<br />

Minimum: {<br />

musical note struct, frequency, impedance, b<strong>and</strong>width,<br />

number <strong>of</strong> harmonics, weighted average harmonic impedance,<br />

distance to left minimum in Hz,<br />

difference in impedance <strong>of</strong> left minimum in dB,<br />

distance to right minimum in Hz,<br />

difference in impedance <strong>of</strong> right minimum in dB,<br />

distance to left maximum in Hz,<br />

difference in impedance <strong>of</strong> left maximum in dB,<br />

distance to right maximum in Hz,<br />

difference in impedance <strong>of</strong> right maximum in dB<br />

}<br />

*/<br />

typedef struct minimum_str {<br />

Note note;<br />

double f;<br />

double Z;<br />

double B;<br />

double numharm;<br />

double meanharmZ;<br />

double L_min_df;<br />

double L_min_dZ;<br />

double R_min_df;<br />

double R_min_dZ;<br />

double L_max_df;

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

Saved successfully!

Ooh no, something went wrong!