|
DSP Implementation of SOLA
As the samples arrive from the AIC,
they are resampled using multirate signal processing. Upsampling and
interpolation can occur as soon as two samples are present. The new upsampled
part is written into memory after they have been through an antialiasing filter
to prevent frequency folding from the downsampling process. When there are
enough samples, downsampling takes place and the data is ready for grain
processing. If the resampling process results in sample reduction (higher
pitch), then downsampling cannot take place immediately after an upsample. It
must wait until there are more upsampled points available than the downsampling
factor. This leads to requiring a small buffer of length that depends on the
difference between upsampling and downsampling factors. At +5 semitone scaling,
this results in a delay of 42ms. If resampling is decreasing the pitch, then
there are always enough samples to downsample immediately after an upsample.
After the signal has been resampled,
it is split up into four parts. Each of these parts is processed by the same
code, but each as a separate grain. Therefore, four grains are continually being
processed, each with its own index position in the grain. This allows for a 75%
overlap of grains. This means that each sample is multiplied by four different
gain factors for the triangular windowing process. These gain factors are
incremented or decremented by 33 for every new sample that arrives. If the grain
position is less than 2040 (half way) then the gain factor is incremented.
Otherwise, it is decremented and this forms the triangular windowing function.
Once a new grain has begun, and 100
samples have been processed, cross correlation is performed between the current
and preceding grains. This requires that as a grain is passing over its 25% mark
(where the next grain will be overlapped and added), it records 100 samples for
this purpose. The best alignment for the grains is used to instruct where the
current grain starts. This whole process adds a 4ms delay to the system.
The processed data from the grains
is constantly being added together and scaled to achieve an output data stream
that is sent to the AIC. Figure 25 shows the implementation method in block
diagram form.

Figure 25: DSP implementation of SOLA algorithm
Previous
| Next
|