|
Methodology
This chapter
describes how an initial idea for an effect / process is developed to the stage
of implementation in real time on a DSP development board. Two software packages
are used in this process, Matlab and Code Explorer. The general development
stages can be seen in Figure 2.

Figure 2:
Development stages
Matlab
Matlab provides
an integrated development environment that allows for the creation and testing
of DSP algorithms. Therefore, this software package has been extensively used to
design the various effects, as well as the pitch scaling process. Figure 3 shows
the various components of Matlab.

Figure 3: Matlab
development environment
Section 1 above is the command driven workspace. Section 2
shows what variables are currently in memory. Section 3 is where M-files are
created and edited. These can be script based or function based and allow a
series of commands to be executed. Section 4 is a graphical display of a guitar
signal that has previously been loaded into memory.
In the case of
effects development, the first stage was to investigate how the effects are
generated in a digital environment. This information was found in books such as
Mitra, as well as helpful websites that are listed in the bibliography. However,
not all of the effect designs were from other sources. The distortion effect
was designed from scratch.
From the initial description / block diagram, a Matlab M-file
was created to perform the effect on a wave file. These wave files were recorded
from a guitar signal plugged in to the microphone connection on the PC
soundcard. The sampling rate used to record is the same as the sampling rate of
the ADC on the DSP development board (24kHz). Wherever possible, calculations
were performed using entire vectors, rather than stepping through the vector
sample by sample. While this makes the Matlab and DSP implementations radically
different in many cases, it is a necessity to reduce computation time in Matlab.
This is because Matlab is optimised to perform vector / matrix calculations and
the alternative can be prohibitively slow.
Once an effect is
in the stage of coding, variables are identified that have a significant effect
on the output signal. For example, the tremolo effect has a frequency variable
associated with the modulating sine wave. A higher frequency gives a faster
vibrato effect. Such variables will be modified by the guitarist to give a wide
variety of alternative sounds.
The Matlab stage is an iterative one. Modifications are made
to the algorithm until suitable results are achieved.
Conversion to
Algebraic Instruction Set (AIS)
Many Matlab
functions are at a very high level of abstraction. For example, the function
XCORR performs correlation between two vectors in one command. To be able to
implement such functions on a DSP, they need to be broken down into AIS, which
is what is used to program the DSP development board. AIS is an improvement over
mnemonic assembler, as you can write the code with mathematical equations,
rather than specific operations. However, it is still at a low level of
abstraction compared with Matlab. The conversion process from Matlab M-file
script to AIS needed to take into account that the DSP only has 10kB of
available memory. The speed efficiency of an algorithm at times had to be
reduced to ensure that less memory was required.
Once the AIS code
was developed, it was compiled into an object file that can be uploaded into the
DSP development board.
Development Board
Debugging
The development
board is designed to allow for a wide range of applications to be tested on a
real DSP, rather than using an emulator that runs on a PC, that might not be
able to achieve real time testing. The board has an Analogue Interface Chip
(AIC), and serial port connection to the host PC. Figure 4 on the following page
shows the typical workspace of the software program Code Explorer. This program
allows a developer access to all of the DSP’s memory (Figure 4, section 2) and
registers (section 4), and enables debugging of a program through instruction
stepping and breakpoints (section 1, program disassembly). It is also possible
to graph areas of the memory as shown in section 3.
An electric
guitar is connected to the input of the AIC, and a speaker to the output. The
effects and pitch scaling processes were tested in real time to ensure that
conversion process worked correctly. The delay was also examined to make sure
that it was not audible. As with the Matlab section, an iterative approach was
taken to code, test, and modify until a suitable result was achieved.

Figure 4: Code
Explorer interface with DSP development board
Previous |
Next
|