Digital Signal Processing Reference
In-Depth Information
Figure 10.40 shows the core of the C source program IIR _ ctrl.c that implements
the four IIR filters as well as the scrambling scheme. The code section of the
program that implements the four IIR filters can be found in the program example
IIR.c in Chapter 5. The complete code section for the scrambling scheme is included
in IIR _ ctrl.c. From Figure 10.40, if DIP _ Mask is 3 or 5, a 3-kHz IIR lowpass filter
or a voice-scrambling scheme is selected and implemented.
Scrambling/Unscrambling
By setting the sample rate to 16 kHz and taking every other input sample in the
voice scrambler scheme, input samples are effectively acquired at 8 kHz and output
samples intermittently at 16 kHz. The input samples are stored in a buffer. The
samples from the buffer are output in quick bursts, independently of the input. When
it is nearly full, the buffer is emptied by outputting a sample every sampling period.
The buffer is then refilled and the process is repeated. This results in an output that
sounds as if the signal frequency had doubled. Table 10.9 illustrates the input and
output scheme for a buffer size of 4. This is neither an up-sampling (interpolating)
nor a down-sampling (decimating) scheme, since no data are added or ignored by
the program. After period 8, the buffer is emptied and the cycle restarts at period
1. For a buffer size of 4, there is no pronounced difference between the input and
output voice signals. However, for a buffer size of 512 or greater, the output voice
signal is quite unrecognizable.
The scrambled output signal can be recovered. The complete unscrambling C
source program IIR _ recov.c is on the CD. The output of the voice scrambler
becomes the input to the second DSK running the program IIR _ recov.c. (Chapter
4 includes an example using modulation and FIR filtering to scramble and unscram-
ble a voice signal.) The unscrambling program assumes that DIP _ Mask is equal to
5 in the scrambler program. The buffer size of 512 used by the scrambler must be
known in order to recover the original input voice signal. The samples are lowpass
filtered by 4 kHz in order to reduce some high-frequency noise incurred with the
scrambling process before being outputted. There is still a small amount of high-
frequency noise in the output. Note that the scrambling scheme uses bit manipula-
tion that requires no external synchronization between the scrambling transmitter
and the unscrambling receiver.
The (complete) executable file for the IIR and scrambling implementations is on
the CD as minimicro.out , and the unscrambling executable file is on the CD as
minimicrob.out . These executable files can be used first to test the different
implementations for IIR filtering and the scrambling/unscrambling scheme. The
appropriate support files are included in the folder IIR _ ctrl .
DIP switch values 6 to 15 yield no output, and can be used for expanding this
project to implement additional IIR or FIR filters and/or another scrambling
scheme. RTDX can be used to pass the designed coefficients (see the FIR project
incorporating RTDX and Chapter 9).
Search WWH ::




Custom Search