Digital Signal Processing Reference
In-Depth Information
FIGURE 4.27. Block diagram of a scrambler/descrambler scheme.
Figure 4.28 shows a listing of the program Scrambler.c , which implements this
project. The input signal is first lowpass-filtered and the resulting output (at point
A in Figure 4.27) is multiplied (modulated) by a 3.3-kHz sine function with data
values in a buffer (lookup table). The modulated signal (at point B) is filtered again,
and the overall output is a scrambled signal (at point C).
There are three functions in Figure 4.28 in addition to the function main . One
of the functions, filtmodfilt , calls a filter function to implement the first lowpass filter
as an antialiasing filter. The resulting output (filtered input) becomes the input to a
multiplier/modulator. The function sinemod modulates (multiplies) the filtered
input with the 3.3-kHz sine data values. This produces higher and lower sideband
components. The modulated output is again filtered, so that only the lower sideband
components are kept.
A buffer is used to store the 114 coefficients that represent the lowpass filter. The
coefficient file lp114.cof is on the CD. Two other buffers are used for the delay
samples, one for each filter. The samples are arranged in memory as
(
(
)
)
(
(
)
)
(
)
( )
xn
--
N
1
,
xn
--
N
2
,...,
xn
-
1
,
xn
with the oldest sample at the beginning of the buffer and the newest sample at the
end (bottom) of the buffer. The file sine160.h with 160 data values over 33 cycles
is on the CD. The frequency generated is f
=
F s (number of cycles)/(number of
points)
3.3 kHz.
Using the resulting output as the input to a second DSK running the same algo-
rithm, the original unscrambled input is recovered as the output of the second DSK.
Note that the program can still run on the first DSK when the USB connector cable
is removed from the DSK.
An optional up-sampling (by a factor of 2) scheme is used to obtain a 16-kHz
sampling rate. This scheme is achieved by “processing” the input data twice while
retaining only the second result. This allows for a wider input signal bandwidth to
be scrambled, resulting in a better performance.
Build and run this project as Scrambler . First, test this project using a 2-kHz
input sine wave. The resulting output is a lower sideband signal of 1.3 kHz, obtained
as (3.3 kHz
=
16,000(33)/160
=
2 kHz) is filtered out by
the second lowpass filter (actually by the antialiasing filter on the codec).
-
2 kHz). The upper sideband signal of (3.3
+
Search WWH ::




Custom Search