598 Guns DSP Implementation Figure 53.3 Shell chirp.
An efficient chirp impulse generator is shown in fig-
ure 53.3. This is used for the shell detonation. It can be
scaled in time and frequency from shorter high impulses
to longer lower ones by passing a different number to
the inlet. Typically 30ms to 60ms is appropriate. Sub-
stituting this value in the decay time of a short line
produces a burst of constant amplitude decaying in fre-
quency. The values of 64 and 1
. 05 in the power function
create a sweep over 10kHz, down to a few hundred Hz
in about 50ms. An offset of
− 0
. 25 to the cosine func-
tion gives us a sinewave burst starting and ending on
zero.
Figure 53.4 Barrel wave.
For the muzzle bang emitted at the end of the
barrel a similar arrangement is used. This time we
want a burst at about 150Hz with a smaller decay
in frequency. You will notice in figure 53.4 that we
also envelope the burst with the decaying line so it
fades away unlike the detonation pulse which has con-
stant amplitude. From the coefficients given there will
be 2
2
= 4 cycles of waveform. A typical duration
is 20ms to 40ms, so in this period we will obtain a
burst between 100Hz and 200Hz maximum frequency.
Again, starting at
− 0
. 25 produces a sine wave begin-
ning on zero, so we can mix this into the previous
burst without clicking. In fact there is a short delay
of perhaps 1ms or 2ms between detonation and muz-
zle signature in some examples analysed. This is the
time it takes for the bullet to travel down a 1m barrel
at a velocity of about 700m
/ s.
Figure 53.5 Excitation noise.
To excite a filterbank representing the weapon body and
bullet sound we need to produce a short burst of noise. The
decay time of this is rapid, so we use a decay made up of
three cascaded squaring operations. The decay time, substi-
tuted from the inlet into the last message value for the line,
will be about 200ms. At 100ms it will be virtually inaudi-
ble at 0
. 003906 of its initial amplitude. White noise is used
because the filter will represent the combined resonance of
the gun housing, barrel, and bullet crack, and we will need
a broad range of bands. A set of parallel bandpass filters
shown in figure 53.6 makes up the weapon body resonance.
This is patched as an abstraction so we can fix the resonance
as the first argument, although a value at the third inlet can be used to override
any creation argument. A list of eight centre frequencies is given at the second