Home | Trees | Indices | Help |
|
---|
|
Inst.py - This file contains the class defining an Instrument and the functions CalculateImpedance and CalculateMaxima.
The CalculateImpedance returns the impedance of an instrument for each requested frequency.
The CalculateMaxima seach for the exact location of the maxima of the instrument and return a list of (frequency,magnitude) tuples.
|
|||
Instrument Class used to descibed the geometry of a musical instrument. |
|
|||
|
|||
|
|||
|
|||
|
|
Multiplication of two arrays of 2X2 matrices. Example: >>> TM1 = create_identity_matrix_array(10) >>> TM2 = multiply_matrix_arrays(TM1,TM1) >>> TM1 == TM2 array([[[ True, True, True, True, True, True, True, True, True, True], [ True, True, True, True, True, True, True, True, True, True]], <BLANKLINE> [[ True, True, True, True, True, True, True, True, True, True], [ True, True, True, True, True, True, True, True, True, True]]], dtype=bool) >>> |
Calculate the input impedance of the instrument. This function performs the transfer matrix multiplication. The frequency vector f must be sufficiently fine for the impedance to be well represented, otherwise, the CalculateMaxima functions won't be able to find the maxima. A good vector is:
>>> freqs = numpy.arange(50,5000,5,dtype=float)
|
Calculate the exact location of the impedance maxima of an Instrument. It uses an impedance vector Z, previously calculated with the CalculateImpedance function, to determine the approximate location of the maxima and then, uses an optimization algorithm to find their exact location.
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Jun 18 14:33:28 2008 | http://epydoc.sourceforge.net |