Simulink
Simulink
The analog signal is sampled at the rising edge of the pulse and held for about 45 ms
duration. The pulse period is 50 ms, and the pulse width is 5 ms. So the S/H block
holds the sample value for approximately 45 ms. Since there are 20 pulses in 1 s,
there are 20 samples in that duration, as seen in Fig. 2.23.
Simulation of A/D Converter Using Simulink An A/D converter as shown in
Fig. 2.13 first samples the input continuous-time signal and holds until the
conversion is completed. We have simulated this sample and hold process as
described above. Next, we will expand on this and include a quantizer to
complete the A/D conversion process. Figure 2.24 shows the block diagram of
an A/D converter using Simulink. As can be seen from the figure, we have
included two input signal sources: a sine wave signal generator and a random
signal generator. The sine wave function generates a continuous-time signal with
an amplitude unity and a frequency of 5 Hz as shown in Fig. 2.25. The random
signal generator produces a uniformly distributed random signal with amplitudes
between 1 and +1 and is also a continuous function of time as seen in Fig. 2.26,
which lists the parameters of the random signal generator. A manual switch is
used to switch the input source between sine wave and random signal. Before
starting the simulation, we have to double-click the switch to change the input
58 2 Discrete-Time Signals and Systems
source. The S/H block has the same parameters as that used in the S/H example.
The quantizer has 6 bits of quantization, and its parameters are shown in
Fig. 2.27. Three outputs are generated in the simulation, namely, the output of
S/H, the output of the quantizer, and the difference between these two signals.
They are stored as vectors in the workspace with names as indicated in Fig. 2.24.
The time scope displays the chosen input signal on the top plot, the pulse
generator output on the middle plot, and the quantization error on the bottom
plot, as shown in Fig. 2.28a. In this figure the input source is the sine wave. In
Fig. 2.28b the random input signal is shown. With 1 min of simulation, the SNR
due to quantization is found to be 36.36 dB for the sine wave and 36.11 dB for the
random signal. These numbers agree with the SNRs obtained from analysis when
the A/D bit width is 6 bits.
2.9 Summary
described how an LTI system is characterized in terms of its impulse response and
how its response to any given input discrete-time signal is computed via convolution
sum. We then established the condition that the impulse response must satisfy for the
LTI system to be stable. Next we introduced an alternative method of describing an
LTI discrete-time system, namely, the linear difference equation with constant
coefficients. We showed how the response of an LTI discrete-time system to a
specified input sequence could be obtained in closed-form solution. Several exam-
ples were included to nail the concept. Since discrete-time signals are mostly
obtained from continuous-time or analog signals, we stated the sampling theorem
also called Nyquist’s theorem and showed how the analog signals can be recovered
or reconstructed from their discrete-time counterparts. If the Nyquist sampling
criterion is not satisfied, aliasing distortion will occur, and it cannot be removed.
We exemplified this notion using a few examples. The sampling theorem that we
talked about pertains to lowpass signals. Often, bandpass signals are encountered,
especially in the field of communications. These signals are centered at a very high
frequency with a narrow bandwidth. The sampling rate of these bandpass signals
will be very high if Nyquist’s condition is used. Instead, one can sample a bandpass
signal at a much lower rate without incurring aliasing distortion. We verified this
statement using an example. The next logical thing to do is to describe the process of
converting an analog signal to digital signal. We described the A/D converter
function by function with plots to illustrate the results. Since A/D conversion
involves the approximation of analog samples using fixed number bits of represen-
tation, errors occur between the analog and digital values. These errors propagate
through the discrete-time system and manifest as noise in the output. We, therefore,
derived mathematical formula to measure the performance of an A/D converter. This
formula expresses the signal-to-noise ratio of an A/D converter in terms of the
number of bits used in the A/D converter. Finally we simulated the S/H operation