06.06.2022 Views

B. P. Lathi, Zhi Ding - Modern Digital and Analog Communication Systems-Oxford University Press (2009)

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

6.9 MATLAB Exercises 313

Figure 6.40

Reconstructed

signal spectrum

and waveform

from applying

the ideal impulse

sampling and

ideal low-pass

filter reconstruction.

Spectrum of ideal filtering (reconstruction)

300 .--------,,------., -------., ------,------,.--------,

250

200

1 50

100

50

0 ----'-----'------/ -----' -----'----

-150 -100 -50 0

50 100 150

Frequency, Hz

-

-

Original signal versus ideally reconstructed signal

2.-----.----,---,_._,--,---.-- ----.--- -.- -- -. --- -,- -- ---, --- -,

Original signal

Reconstructed signal

0

- 1

-2 '- -- .J____ __t____ ,___ -1....__ _1___ ..,_____ _L-:......JL.___ .J____ _j

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9

Time, second

recovered signal is still very close to the original signal g(t). This is because we have chosen

a high sampling rate such that T p

= T s is so small that the approximation of Eq. ( 6.17) holds.

Certainly, based on our analysis, by applying the low-pass equalization filter of Eq. (6.16), the

reconstruction error can be greatly reduced.

PCM Illustration

The uniform quantization of an analog signal using L quantization levels can be implemented

by the MATLAB function uniquan . m.

% (uniquan .m)

function [q__out ,Delta , SQNR] =uniquan (sig_in,L)

% Usage

% [q__out ,Delta , SQNR] =uniquan (sig_in,L)

% L number of uniform quantization levels

% sig_in - input signal vector

% Function outputs:

% q__out - quantized output

% Delta - quantization interval

% SQNR actual signal to quantization noise ratio

sig_pmax=max (sig_in) ; % finding the positive peak

sig_nmax=min (sig_in) ; % finding the negative peak

Delta= (sig_pmax-sig_nmax) /L; % quantization interval

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!