Sampling & Quantization

84
Training material 2007 NHK-CTI Digital Engineering Digital Engineering Training material of NHK-CTI 1 2007.7.24 NHK Communications Training Institute Hideo Tsuji [email protected]

Transcript of Sampling & Quantization

Page 1: Sampling & Quantization

Training material

2007 NHK-CTI

Digital EngineeringDigital EngineeringTraining material of NHK-CTI

1

2007.7.24

NHK Communications Training Institute

Hideo Tsuji [email protected]

Page 2: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Table of contentsTable of contents

• Overview of Digital System

• Binary and Hexadecimal Notation

• A/D Conversion

– Sampling

2

– Sampling

– Quantization

• Source Coding

• D/A Conversion

Page 3: Sampling & Quantization

Training material

2007 NHK-CTI

Overview of digital Overview of digital Training material of NHK-CTI

3

systemsystem

Page 4: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

What is “Digital” ?What is “Digital” ?

• Definition of “analog” in a dictionary

– of, relating to, or being a mechanism in which

data is represented by continuously variable

physical quantities

• Definition of “digital” in a dictionary

4

• Definition of “digital” in a dictionary

– of, relating to, or using calculation by

numerical methods or by discrete units

– of or relating to data in the form of numerical

digits

Page 5: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

“Analog” and “Digital”“Analog” and “Digital”

• Analog

– Represents a level or a

state with continuously

variable physical

quantities time

level

5

• Digital

– Represents a level or a

state with discrete

numerical unitstime

0 1 1 10 0level

Page 6: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Analog clock v.s. Digital clockAnalog clock v.s. Digital clock

• Analog Clock

– Hands turn continuously

– Always shows actual

time

• Digital Clock

– Digits change

every minutes

– Both ’12:34.00’ and

’12:34.59’ turn into ’12:34’

(Quantization error)

6

quantization error

(Quantization error)

Actual Time

Represen

ted Time

analog

digital

12:34.00 12:35.00

Page 7: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Why “Digital”?Why “Digital”?

~ Advantage of digital system~ Advantage of digital system• Easy processing with computers

– Digital equipment is much smaller and energy-saving than

analog equipment

– Fusion of broadcast and communication

• Easy integration(multiplexing) of several media

7

• Easy integration(multiplexing) of several media

– Able to deal with audio/video/data in the same way

• Efficient data compression

– Bandwidth requirement for ONE analog TV program and

THREE digital TV programs are equivalent

• Error-proof performance

– Never degrade with duplication or relaying

Page 8: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Disadvantage of digital systemDisadvantage of digital system

• Minor trouble may cause absolute failure

– Analog system: noise increases gradually

– Digital system: no influence with low error rate (owe to error correction), but suddenly fails absolutely at certain point

• Increase of delay

– Example: delay of HDTV satellite broadcasting

8

– Example: delay of HDTV satellite broadcasting

�Analog… 0.3 second (roundtrip time to the satellite)

�Digital… 1.0 second (roundtrip + encode/decode delay)

• Easy to create pirated copy

– How can we protect copyrighted material?

�Copy management system: copyright holders can define the generation of duplication (none, child only, no limit…)

�Watermark: implant invisible identification

Page 9: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Overview of digital systemOverview of digital system

Source

Coding

A/D

ConversionModulation

Sender (broadcaster)

9

D/A

ConversionDecoding

De-

modulation

Receiver (audience)

Channel

Page 10: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

MultiMulti--media multiplexingmedia multiplexing

A/D

Conversion

Source

Coding

Multiplexing

Modulation

Video

10Multiplexing

A/D

Conversion

Source

Coding

Source

CodingData

Audio

Page 11: Sampling & Quantization

Training material

2007 NHK-CTI

Binary and Binary and Training material of NHK-CTI

11

Hexadecimal Hexadecimal

NotationNotation

Page 12: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Binary, Decimal, HexadecimalBinary, Decimal, Hexadecimal

• Binary number

– Computers can distinguish

only two states; high and

low voltage

• Hexadecimal number

Decimal BinaryHexa-

decimal

0 0 0

1 1 1

2 10 2

3 11 3

4 100 4

5 101 5

12

• Hexadecimal number

– Integrate every 4 digits of a

binary number to shorten

the length(easy to understand for us)

5 101 5

6 110 6

7 111 7

8 1000 8

9 1001 9

10 1010 A

11 1011 B

12 1100 C

13 1101 D

14 1110 E

15 1111 F

16 10000 10

Page 13: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Convert decimal into binaryConvert decimal into binary

• What is (567)d in binary number?2)5672)283 …12)141 …12)70 …1

• What is (1,234)d in binary number?2)1,2342)617 …02)308 …12)154 …0

13

2)70 …12)35 …02)17 …12)8 …12)4 …02)2 …01

�(100110111)b

2)154 …02)77 …02)38 …12)19 …02)9 …12)4 …12)2 …01 …0

�(10011010010)b

Page 14: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Convert binary into decimalConvert binary into decimal

• What is (10011010010)b in decimal number?

1 0 0 1 1 0 1 0 0 1 0

210+ 29+ 28+ 27+ 26+ 25+ 24+ 23+ 22+ 21+ 20

=1,024+128+64+16+2 = (1,234)d

14

• What is (1000101011)b in decimal number?

1 0 0 0 1 0 1 0 1 1

29 + 25 + 23 + 21 + 20

=512+32+8+2+1 = (555)d

Page 15: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Convert decimal into hexadecimalConvert decimal into hexadecimal

• What is (1,234)d in

hexadecimal number?

– (1,234)d= (10011010010)b

– 100 1101 0010

• What is (573)d in

hexadecimal number?

16)573

16)35 …13=D

2 … 3

15

– 100 1101 0010

4 D 2

�(4D2)h

• Another solution16)1,234

16)77 …2

4 …13 �(4D2)h

(Note that (13)d=(D)h)

2 … 3

�(23D)h

Page 16: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Convert hexadecimal into decimalConvert hexadecimal into decimal

• What is (4D2)h in decimal number?

4 x 162 +D x 161+2 x 160

= 4x256+13x16+2x1 = (1,234)d

16

• What is (1ABC)h in decimal number?

1x163+Ax162+B x161+Cx160

= 1x4,096 +10x256 +11x16+12x1= (6,844)d

Page 17: Sampling & Quantization

Training material

2007 NHK-CTI

Analog to Digital Analog to Digital Training material of NHK-CTI

17

ConversionConversion

Page 18: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Analog to Digital Conversion (ADC)Analog to Digital Conversion (ADC)

• Video and audio are ANALOG signal

�Convert them to DIGITAL signal

SourceA/DModulation

18

CodingConversionModulation

�Sampling

�Quantization

Page 19: Sampling & Quantization

Training material

2007 NHK-CTI

SamplingSamplingTraining material of NHK-CTI

19

Page 20: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

What is sampling?What is sampling?

• Measure the level of input analog signal

at every certain temporal (or spatial) intervals

Switch on/off periodically

20

time (or position)

level

level

input signal series of samples

time (or position)

Switch on/off periodically

Page 21: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Sampling interval and sampling frequencySampling interval and sampling frequency

• Pick out samples from a

continuous signal at every

temporal interval Ts– Sampling interval Ts– Sampling frequency fs

time

level

level

input signal

sampling pulseTs

21

– Sampling frequency fs

• Amplitude of samples is

analog value � PAM(Pulse Amplitude Modulation)

time

time

level

sampling pulseTs

series of samples

fs=1/Ts

Page 22: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

How much is the better sampling frequency?How much is the better sampling frequency?

• High sampling freq. • Low sampling freq.

level

level

22

– Able to reproduceoriginal waveform

– Increase the number of samples

– Impossible to restore original

input signal

timetime

time

level

D/A conversion

time

level

D/A conversion

Page 23: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Effect of sampling frequency for imagesEffect of sampling frequency for images

• Resolution is equivalent to sampling freq.

– Sampling freq.: No. of samples per unit time

– Resolution: No. of samples per unit length

23

x4 resolution

Page 24: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Sampling theorem (Nyquist theorem)Sampling theorem (Nyquist theorem)

• To reproduce original waveform from a series of

samples, sampling frequency fs must be at least

TWICE as much as the highest frequency fh of input analog signal

– Sampling theorem: fs ≥ 2fh (2fh: Nyquist freq.)

24

Sampling frequency: 4kHz

input signal:

2kHz sine wave

– Sampling theorem: fs ≥ 2fh (2fh: Nyquist freq.)

Sampling point

Page 25: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

AliasingAliasing

• If the sampling frequency is less than 2fh, distortion will appear when these samples

are D/A converted

– Reproduced waveform is lower frequency than

original signal

25

original signal

Sampling freq.: 4kHz

time

level

:6kHz

:2kHz

Page 26: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Why aliasing occurs?Why aliasing occurs?

Mathematical analysisMathematical analysis• Temporal waveform: • Frequency waveform:

level

level

∫∞

∞−−= dt)ft2jexp()t(x)f(X π∫

∞−= dfftjfXtx )2exp()()( π

26

time

level

� x(t) and X(f) are convertible each other

� x(t)� X(f): Fourier Transformation

� x(t) X(f): Inverted Fourier Transformation

frequencylevel

fh

Page 27: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Frequency waveform of samplesFrequency waveform of samples

• Temporal Waveform • Frequency Waveform

time

level x(t): input signal

fhfrequency

level fh : highest frequency

of input signal

X(f)

27

time

time

level y(t): sampling pulse

Ts

frequency

frequency

level

fs 2fs

fs : sampling frequency

(fs=1/Ts)Y(f)

frequency

level Z(f)

time

level z(t): series of samples

Page 28: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

• fs > 2fh

Nyquist frequency and aliasingNyquist frequency and aliasing

fs

frequency

level

fs

frequency

level

• fs < 2fh

28

frequency2fhfhfrequency2fhfh

frequency

level

fhfs/2

�Original waveform is

reproducible with LPF

fs/2frequency

level

fh

�Original waveform is NOT

reproducible because of

aliasing

Page 29: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Example of aliasingExample of aliasing distortiondistortion

29

Original image Image with aliasing distortion

Page 30: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Avoid aliasingAvoid aliasing

• Low Pass Filter (LPF) can limit the highest frequency of input analog signal

Source

Coding

A/D

ConversionLPF

30

– Sampling frequency is usually higher than Nyquist frequency

�Compact Disk (fh=20kHz) � fs=44.1kHz

�Telephone (fh=3.6kHz) � fs=8kHz

Coding

frequency

level

frequency

level

Page 31: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Summary: SamplingSummary: Sampling

• Measure the level of input analog signalat every certain temporal (or spatial) intervals

• If sampling frequency is not high enough, the original signal is not reproducible because of

31

original signal is not reproducible because of aliasing

• Sampling theorem: To avoid aliasing, sampling frequency must be at least twice as much as the higher frequency of input signal

Page 32: Sampling & Quantization

Training material

2007 NHK-CTI

QuantizationQuantizationTraining material of NHK-CTI

32

Page 33: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

What is quantization?What is quantization?

• PAM signal is not digital

– Temporally (or spatially) quantized

– Level of the signal is still analog quantity

• Approximate the signal level to a quantized value �PCM (Pulse Coded Modulation)

33

time (or position)

level PAM

111 111 110 011 010 010 100 101 100 …

7 7 6 3 2 2 4 5 4 ...

level76543210

time (or position)

PCM

Page 34: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

• Difference between the analog signal and the digital

representation

• A quantization error causes quantization noise when

the signal is D/A converted

Quantization errorQuantization error

34

time

level

PAM

timelevel

PCM

level

time

D/A converted

Page 35: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

How much is the better quantization level?How much is the better quantization level?

• 4-bit quantization(16 levels: 0~15)

• 2-bit quantization(4 levels: 0~3)

level

level

35

– Less quantization error

– More amount of data

– More quantization error

– Less amount of data

time time

14 15 12 5 3 4 8 9 7 ...

1110 1111 1100 0101 0011 0100 1000 1001 0111...

3 3 3 1 1 1 2 2 2...

11 11 11 01 01 01 10 10 10...

Page 36: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Effect of quantization levelEffect of quantization level

• 4-bit (16 levels)

• Contouring appears in roughly

quantized pictures

• Size of picture data is proportional to

the quantization level

(only if no compression applied)

36

• 8-bit (256 levels)(only if no compression applied)

Page 37: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Effect of quantization levelEffect of quantization level

• 24-bit quantization

– R/G/B 8-bit each

– 16,777,216 levels

• 6-bit quantization

– R/G/B 2-bit each

– 64 levels

37

Page 38: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

How to relieve the effect of quantization errorHow to relieve the effect of quantization error

• Non-linear quantization

• Scale factor

• Dithering

38

Page 39: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

• Linear quantization

NonNon--linear quantizationlinear quantization

• Non-linear quantizationlevel

level

39

– Quantization error is larger

in low level signals

�6.5�”7” … 8%

�1.5�”2” … 33%

(Quantity of error is same,

but ratio or error is different)

– Solution of an affection of

quantization error

�High level signal

� Coarse quantization

�Low level signal

� Fine quantization

71

Page 40: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Quantization with scale factorQuantization with scale factor

• Quantization of consecutive low level samples

time time

level Scale factor

40

– High quantization error

– Waste of higher bits– Quantize signals based on

maximum level in certain

interval

– Need to transmit scale

factor value

time time

Page 41: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

• Add a random (or certain patterned) noise to

input signal before quantization

– Without dithering

DitheringDithering

level

level

level

41

– With ditheringtime

level

time

level

time

level

time

level

time

level

time

level

Sampling Quantize

Page 42: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Example of ditheringExample of dithering

• Without dithering • With dithering

42

– Contouring appears

at quantizing thresholds

– Represent pseudo

gradations

Page 43: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Example of ditheringExample of dithering

• Convert to 64 colors

without dithering

• Convert to 64 colors

with dithering

43without dithering original with dithering

Page 44: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Summary: QuantizationSummary: Quantization

• Convert analog signal quantity into quantized

value (convert PAM to PCM)

• Increasing the quantization level will reduce

quantization error, but increase the amount of

44

quantization error, but increase the amount of

data

• Non-linear quantization and scale factor may

improve low level signals suffering

quantization error

Page 45: Sampling & Quantization

Training material

2007 NHK-CTI

Source Coding Source Coding Training material of NHK-CTI

45

Source Coding Source Coding

(or Encoding)(or Encoding)

Page 46: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

What is Coding?What is Coding?

• Process the sequence of binary data (PCM

data)

Source

Coding

A/D

ConversionModulation

46

CodingConversionModulation

�Data compression

Page 47: Sampling & Quantization

Training material

2007 NHK-CTI

Data compressionData compressionTraining material of NHK-CTI

47

Page 48: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

What is data compression?What is data compression?

• Eliminate redundancy of the data

• What is redundancy? (example of a video)

– Spatial redundancy

�Neighbor pixels are similar

– Temporal redundancy

48

– Temporal redundancy

�Neighbor frames are similar

– Psychological redundancy

�Details are not significant

– Statistical redundancy

�Data have certain trends

Page 49: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

How huge is a data without compression?How huge is a data without compression?

• Example of 60 minutes HDTV-quality video

– A picture with 1,920x1,080 pixels, 8 bit quantized

for each color (RGB)

�1,920 x 1,080 x (8+8+8) = 49,766,400 bits (50Mbits)

– Video with 30 frames per second

49

– Video with 30 frames per second

�49,766,400 x 30 = 1,492,992,000 bits/sec. (1.5Gbps)

– If this video continues for 60 minutes…

�1,492,992,000 x 3,600 = 5,374,771,200,000 bits

(5.3Tb ≈ 670GByte)

Page 50: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Categories of compression techniquesCategories of compression techniques

DPCM

DM Prediction

Entropy Encoding

Run-length Coding

Huffman Coding

Arithmetic Coding

50

DM

FFT

DCT

Hybrid Coding

JPEG

MPEG

H.261

DVI RTV, DVI PLV

Source Coding Transformation

Vector Quantization

Page 51: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Reversible compression and Reversible compression and

NonNon--reversible compressionreversible compression• Reversible compression

(loss-less compression)

– Decoded data is the same as original

– Applied for computer, medical data

51

– Applied for computer, medical data

• Non-reversible compression

(lossy compression)

– Decoded data is not the same as original

– Compression ratio is better than reversible

compression

– Applied for audio and video

Page 52: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

• Run-length Encoding (RLE)

– 000ppppppXXXXaaa �3(0), 6(p), 4(X), 3(a) Ratio:16/8

– Easy to implement

– Do not fit for data alternating 0 and 1 frequently

• Huffman coding

Example of reversible compressionExample of reversible compression

52

• Huffman coding

– Assign shorter words for frequently appearing patterns

– Efficient if the trend of appearing pattern is well-known

• Arithmetic coding

– Adaptively assign words according to the statistics of object

data

Page 53: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Word

1

011

010

Example of Huffman codingExample of Huffman coding

0.301.00

0.500.500.50

0.15

0.15

0.50

0.15

0.15

0.50

0.15

0.15

Symbol Probability

A

B

C

0.50

0.15

0.15

1

1

1

53

010

001

0001

00001

000000.03

0.11

0.20

0.50

0.20

0.150.15

0.09

0.15

0.09

0.08

C

D

E

F

G

0.15

0.09

0.08

0.02

0.01

01

0

0

1

0

1

0

1

0

Page 54: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Example of Huffman codingExample of Huffman coding

• Original data

• Fixed length code

A GA A A A A A AB C A ABCE BD EFA AB D A A AC C D

111001 010011101 100 110001011 101100001011 100011001 010001 001 001001 010001 001 001001 010 001 001 001

A B C D E F G011001 010 100 101 110 111

90bits

54

• Huffman code

00000

111

1

001

011

010

010

011

0001

101

001

100

00001

110

1

001

010

011

0001

101

001

100

1

001

010

011

001

100

010

011

1

001

011

010

1

001

1

001

1

001

1

001

011

010

1

001

1

001

1

001

1

001

011

010

1

001

1

001

1

001

A B C D E F G1 010 001011 0001 00001 00000

90bits

66bits

Page 55: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

• Scan pixels horizontally and compress data with run

length coding and modified Huffman coding

– Terminating code

Coding in FacsimilesCoding in Facsimiles

– Make up code(For more than 64 pixels in a row)

white black

1 000111 010

white black

64 11011 0000001111

1000 111100 11 196 white pixels192 whites + 4 whites010111 + 1011 0101111011

55

�Example

Continuous 196 pixels of white

�192 whites + 4 whites

�word is “0101111011”

1 000111 010

2 0111 11

3 1000 10

4 1011 011

5 1100 0011

62 00110011 000001100110

63 10100 000001100111

64 11011 0000001111

128 10010 000011001000

192 010111 000011001001

256 0110111 000001011011

1728 010011011 0000001100101

0 00110101 0000110111

6 1110 0010

Page 56: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

• Aural masking effect– the presence of a strong audio signal makes a temporal

or spectral neighborhood of weaker audio signals

imperceptible

Audio compression considering audibilityAudio compression considering audibility

�Perceptual coding81

56

frequency (Hz)

level (d

B)

1k 10k 20k

Threshold of audibility

Aural masking

�Threshold of audibility� Signals are inaudible if its level is lower than certain

threshold

� Discard inaudible data to

compress

Page 57: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Summary: Data compressionSummary: Data compression

• Eliminate redundancy of data to reduce the

size of a data

• Two category of compression:

– Reversible compression

�Restorable

57

�Restorable

– Non-reversible compression

�Higher compression ratio

�Non-restorable, but difference is insignificant

because of human audio/visual characteristics

Page 58: Sampling & Quantization

Training material

2007 NHK-CTI

Digital to Analog Digital to Analog Training material of NHK-CTI

58

ConversionConversion

Page 59: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Digital to Analog Conversion (DAC)Digital to Analog Conversion (DAC)

• Output signal of audio/video must be analog

� Convert digital to analog

59

DecodingD/A

Conversion

De-

modulation

Page 60: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

A/D

Comparison of DAC and ADCComparison of DAC and ADC

time

level

PAM76543210

level

time

7 7 6 3 2 2 4 5 4 ...

PCMQuantization error

60

A/D

conversion111 111 110 011 010 010 100 101 100 …

7 7 6 3 2 2 4 5 4 ...

level76543210

time

PCM

7 7 6 3 2 2 4 5 4 ...

=time

level

not same!D/A

conversion

Page 61: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Convert PCM to analog signalConvert PCM to analog signal

• Analog signal will be obtained filtering a PCM

signal with a low pass filter

– Cutoff frequency of the LPF should be as same as

LPF for A/D converter

61

time

level

Ts 2Ts time

level

Ts 2Ts

freq.

level

LPF

Page 62: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

LPF (interpolation)LPF (interpolation)

• Principal of interpolation– When the pulse signal passes through LPF, it becomes a

sampling function (sinc function)

– Assumed that cutoff frequency of LPF is same as the

sampling frequency, it is theoretically completely

restorable (However, ideal LPF cannot be produced)

62

restorable (However, ideal LPF cannot be produced)

0

1

time T 2T‐T

‐2T 0

1

time

T=1/2f

sinc = sin(x)/xLPF

0

1

frequency

Page 63: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

LPF (interpolation)LPF (interpolation)

• Interpolation

– Interpolate by passing the PAM signal through

LPF and reproduce the original shape of waves

– Ideal LPF cannot be produced, therefore the

interpolation error is inevitable

63

interpolation error is inevitable

T 2T 4T3T0 timeT 2T 4T3T0 time

PAM signal Analog signal

LPF

0

1

frequency

Page 64: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Summary: D/A ConversionSummary: D/A Conversion

• Convert PCM to analog signal using LPF

• Reproduced waveform is not same as the

original signal

– Quantization error in A/D conversion

64

– Quantization error in A/D conversion

– Distortion of filtered signal in D/A conversion

freq.

level

ideal filter

freq.

level

actual filter

Page 65: Sampling & Quantization

Training material

2007 NHK-CTI

Informative Informative Training material of NHK-CTI

65

referencereference

Page 66: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Type of pulse code conversionType of pulse code conversion

�Example of linear quantization

1 2 3-3 -2 -1

3

2

1

OutputOutput

66

No output in a small level A small signal is not suppressed

-1

-2

-3

0 Input

Mid tread type Mid riser type

Input

Page 67: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Example of quantizationExample of quantization

0.5

1

1.5

2

67

0 0.01 0.02 0.03 0.04 0.05 0.06-2

-1.5

-1

-0.5

0

Time [sec]

V

2-bit midriser

Page 68: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Quantization noiseQuantization noise

0.5

1

1.5

2

Quantization

error

68

0 0.01 0.02 0.03 0.04 0.05 0.06-2

-1.5

-1

-0.5

0

Time [sec]

V

2-bit midriser

Page 69: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Linear quantization of sine waveLinear quantization of sine wave

t

Level

V

69

t

∆Vapproximated by stairs

The difference between true value and quantized value

becomes like a saw-toothed wave

∆V

Page 70: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Quantization noiseQuantization noise

• Quantization error becomes quantization noise

• It is thought that the sample value can take the given value

within one quantization step (equal probability), therefore

quantization noise is treated as variance,

Nq =1∆V

x2dx–∆V / 2

∆V / 2

=∆V2

12

70

8.16)2*2/3log(10)(/ 2 +== bdBNS b

8)22

(2

2 VVS ==

Where number of quantization step:

Signal power is

Therefore 6dB is improved by increasing one bit of b

b

qV

V

V

VNS 2

2

2

2

2

22

3

2

3

12/

8// =

∆=

∆=

2

222

V

Vb

∆=

Page 71: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

NonNon--linearlinear quantization (µquantization (µ--low)low)

0.2

0.4

0.6

0.8

1

QUANTIZER CHARACTERISTICOUTPUT

<− )0(1

:

x

≤≤ 10 x

y is quantized output

Where、x is normalized input

+

+=

)1(log

)1(log

)sign(

x

xy

e

e

µ

µ

71

-1 -0.5 0 0.5 1-1

-0.8

-0.6

-0.4

-0.2

0

INPUT

OUTPUT

255

128

32

>

=

<−

=

)0(1

)0(0

)0(1

)sign(

x

x

x

x

ITU standard :µ=255

(Japan, USA)

In Europe: A-Low

G.711 A-LAW/µ-LAW(8 bits/sample)

Page 72: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Compression and extension of signalCompression and extension of signal

• Even if a small signal level, compression and

extension is performed to maintain S/N ratio.

Output Output

72

Compression Extension

0 0

Input Input

Transmission side Reception side

Page 73: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Secret to reduce bit errorSecret to reduce bit error

1.75

1.25

0.75

0.25

-0.25

-0.75

-1.25

VoltageReceived signal(Wave is distorted)Error! Transmitting signal

73

1.75V = 000

1.25V = 001

0.75V = 010

0.25V = 011

-0.25V = 100

-0.75V = 101

-1.25V = 110

-1.75V = 111

Two bits or

three bits

error occurs

by the noise

1.75V = 100

1.25V = 101

0.75V = 111

0.25V = 110

-0.25V = 010

-0.75V = 011

-1.25V = 001

-1.75V = 000

Changing the relation of data and the voltage makes bit error minimum

This allocation

allows error stay

only one bit

-1.25

-1.75

T

Page 74: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Type of codeType of code

Quantization level Natural Gray Reflected

0 000 000 000

1 001 001 001

�Example of binary code: 8 steps quantization

74

2 010 011 010

3 011 010 011

4 100 110 111

5 101 111 110

6 110 101 101

7 111 100 100

Page 75: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Symbol allocationSymbol allocation

0010

11 10

I

Q

Q

0000

00100011

000101010100

0110 0111

3

1

75

QPSK

8PSK

000

011

111

110

001010

100

101

I

QI

1010

10001001

10111110 1111

11011100

1

1 3-1-3

-3

-1

16 QAM

Page 76: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Type of pulse codeType of pulse code

+1

0

+1

0-1

0 1 0 0 1 1 1 0 1 0NRZ

((((Uni-polar))))

NRZ

((((Bi-polar))))

� Video/audio signal can be express by the change in

voltage by a/d conversion

76

-1

+1

((((Bi-polar))))

0

+1

0-1

RZ

((((Uni-polar))))

RZ

((((Bi-polar))))

0NRZI+1

+1

0-1

Manchester

Page 77: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Secret of digital transmission Secret of digital transmission

(limitation of frequency band)(limitation of frequency band)• When one symbol is transmitted by a rectangular pulse, the frequency element is shown in figure below. Since the high frequency element infinitely remains, and it is not possible to use in a severe band limiting channel

• If the pulse is rolled off, the high frequency element decreases, however, interfering between symbols occurs (the error occurs in decoding the symbol)

• Required both frequency band-limitation and no interference between symbols

77

symbols

-1 -0.5 0.5 1

0.25

0.5

0.75

1

1.25

1.5

t

f(t)

One pulseAfter Fourier transformation of one pulse

Higher frequency element remains

(It might influence other signals)

Fourier transformation

-10 -5 5 10

0.25

0.5

0.75

1F(f)

f

Fourier transformation

Page 78: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Nyquist pulseNyquist pulse

-1 -0.5 0.5 1

0.25

0.5

0.75

1

1.25

1.5

f

F(f)

-10 -5 5 10

0.25

0.5

0.75

1

f(t)

t

Inverse Fourier transformation

Signal continues from the infinite past to

Every T cycle amplitude

becomes zero

…..

-W/2 W/2T=1/W

78

Frequency characteristic

of band-limited signal

Signal continues from the infinite past to

the infinite future ("Sampling function" in

the sampling theorem. )

-10 -5 5 10

0.25

0.5

0.75

1When each pulse is overlapped, the

Nyquist pulse is convenient because

every T cycle amplitude becomes 0,

although it has the disadvantage that

the vibration of around the main pulse

lasts long.

Page 79: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Nyquist pulseNyquist pulse

Wa

fWa

Wa

f

Wf

aW

Wa

f

fF2

)1(

2

)1(

2

)1(,1

))),2

(1

sin(1(2

12

)1(,0

)(−

>>+

−>

−−

+>

= π

The Nyquist pulse becomes zero every T cycle, and has the feature with a small

amplitude in the part of the tail of the vibration. The occupied frequency band

becomes (1+a) W. When a roll off rate (a) is small, although the amplitude in the

a: Roll off rate

F: Nyquist function

79

becomes (1+a) W. When a roll off rate (a) is small, although the amplitude in the

part of the tail becomes large, the occupied frequency band narrows. When a roll off

rate (a) is large, although the amplitude in the part of the tail is small, the occupied

frequency band extends. Usually it is used 0.1.. ..<.. a<0.8.

-1.5 -1 -0.5 0.5 1 1.5

0.2

0.4

0.6

0.8

1

-1.5 -1 -0.5 0.5 1 1.5

0.2

0.4

0.6

0.8

1

-1.5 -1 -0.5 0.5 1 1.5

0.2

0.4

0.6

0.8

1

-1.5 -1 -0.5 0.5 1 1.5

0.2

0.4

0.6

0.8

1

a = 0.1 a = 0.3 a = 0.5 a = 0.8

F(f)

f

F(f)

f

F(f)

f

F(f)

f

Occupied

bandwidth

Page 80: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

IFT of Nyquist pulseIFT of Nyquist pulse

-10 -5 5 10

0.25

0.5

0.75

1

-10 -5 5 10

0.25

0.5

0.75

1

a=0.0 a=0.1

80

-10 -5 5 10

0.2

0.4

0.6

0.8

1

-10 -5 5 10

0.25

0.5

0.75

1

-10 -5 5 10

0.2

0.4

0.6

0.8

1

a=0.0

a=0.3 a=0.5 a=0.8

Waveform of Nyquist pulse

Page 81: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Frequency maskingFrequency masking

60

40

SPL Sound Pressure Level (in dB)

A (threshold in quiet)

B (masking threshold)

C (masker)

D (masked sound)

81

0.02 0.05 0.1 0.2 0.5 1 2 5 10 20

20

0

Frequency(kHz)

SPL Sound Pressure Level (in dB)

A Normal threshold of hearing

B Modified threshold due to tone C

D Band of noise rendered inaudible by the presence of tone C

Page 82: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

Temporal maskingTemporal masking

Pre-masking

Masker on

SPL

(in db)

82

~200ms ~150ms~20ms

Time

Pre-maskingPost-masking

Simultaneous

Masking

Page 83: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

ScramblerScrambler

� Even if data 1 and data 0 is consecutive in NRZ code, it

is possible to regenerate clock easily due to scrambler

� Scrambler/Descrambler block diagram

Exclusive Or (Modulo 2)

Scrambler

83

Transmitter side

Reception side

Shift register

Pulse sequence

To Channel

Same as original pulse sequence

From channel pulse sequence

Scrambler

Descrambler

Page 84: Sampling & Quantization

Training material of NHK-CTI

Training material of NHK-CTI

MaximalMaximal--length sequences code generatorlength sequences code generator

• Maximal-length sequences

– Longest cyclic code generated by using shift register and

feedback

The most random code can be generated (period:2n -1)

84

Clock

Scrambled output

D D DInput data

The most random code can be generated (period:2 -1)

n: number of shift register