5. Design & Implementation

It was decided to use C++ as the implementation language, in order that the Neural Net training algorithms should run as fast as possible. The software was developed in a PC environment in order to work closely with the input data provided by Recycle.


5.1. Overview of software structure

The overall design of the software can be divided into three main sections, which are:

  1. Pre-processing, which has been implemented in procedural code using global functions. The function main() resides within this body of code and it is from here that all the pre-processing functions are called, and that the network objects are instantiated.

  1. The Multi-Layer Perceptron. This has been implemented as two classes, the MLP class containing all functions concerning the operation of the network, and the Node class, from which each node in the network is instantiated.

  1. The Self Organising Map, implemented as the class SOM.


5.2. Pre-processing

5.2.1. Design of the data structure, TrainingVects

All relevant data relating to each .rcy file read (each sampled break), is stored in the structure TrainingVects, which can be seen in appendix A
. This structure includes (for each drum within the break) the quantised FFT vectors, neural net target values, the amplitude value and the frequency of peak magnitude. Each one of these structs is then placed in an array, in order that the complete training data or test data can be passed to each neural net object.

5.2.2. Description of the major functionalities of the pre-processing code

A list of all of the pre-processing functions is given in appendix A
. Rather than explain each function individually, the main pre-processing tasks that use these functions are described below.

5.2.2.1. .rcy data reading problems

The layout of data within the .rcy files can be seen in appendix B
, only relevant data has been indicated. ReCycle was originally developed for the Mac, therefore data stored in .rcy files is in Mac format. This causes two slight problems in that all integer variables are stored in the reverse to PC format, and floating point variables are not stored in IEEE format. The former problem was solvable by reading all data a byte at a time, then placing the bytes into each relevant variable in correct order. The latter required splitting the Mac stored float variables into mantissa, exponent and sign bits, then repositioning these pieces of data into a float variable in IEEE format (performed by the function floatConvert()).