0% found this document useful (0 votes)
76 views

PCM 1

1) The document describes an assignment on implementing Pulse Code Modulation (PCM) technique in C++. PCM is a source coding technique that converts analog signals to digital signals for easier processing. 2) It explains the key steps in PCM - sampling the analog signal, quantizing the sample values, and encoding the quantized samples as binary digits. Mathematical formulas for quantization levels and the sine wave are also provided. 3) The assignment requires students to write a C++ program that draws a sine wave, applies quantization and encoding to obtain a binary output from the analog input signal. Evaluation will include written and oral questions on PCM concepts and applications.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views

PCM 1

1) The document describes an assignment on implementing Pulse Code Modulation (PCM) technique in C++. PCM is a source coding technique that converts analog signals to digital signals for easier processing. 2) It explains the key steps in PCM - sampling the analog signal, quantizing the sample values, and encoding the quantized samples as binary digits. Mathematical formulas for quantization levels and the sine wave are also provided. 3) The assignment requires students to write a C++ program that draws a sine wave, applies quantization and encoding to obtain a binary output from the analog input signal. Evaluation will include written and oral questions on PCM concepts and applications.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Programming Laboratory-II Third Year Computer Engineering

R N Oral Total Dated Sign


(2) (5) (3) (10)

Assignment 5

Problem
Definition:
Write a program to implement Pulse Code Modulation Technique to
transfer the data to other computer.

5.1 Prerequisite:
a) Concept of A/D Convertor.
b) Math Functions in Cpp.

5.2 Learning Objectives:


 Understand the working of PCM
 Implementation of PCM using Sine wave.

5.3New Concepts:
a. PCM
b. Math functions

5.4 Theory
5.4.1 PCM: Pulse Code Modulation

 PCM modulation is a kind of source coding.

 The meaning of source coding is the conversion from analog signal to digital signal. After
converted to digital signal, it is easy for us to process the signal such as encoding, filtering
the unwanted signal and so on. Besides, the quality of digital signal is better than analog
signal. This is because the digital signal can be easily recovered by using comparator.
 Pulse-code modulation (PCM) is a method used to digitally represent sampled
analog signals.

SNJB’s Late Sau.KB Jain CoE , Chandwad


Programming Laboratory-II Third Year Computer Engineering

Fig 1. Block Diagram of PCM


5.4.2 Sampling:
 In signal processing, sampling is the reduction of a continuous signal to a discrete
signal. A common example is the conversion of a sound wave (a continuous signal) to a
sequence of samples (a discrete-time signal).
 A sample refers to a value or set of values at a point in time and/or space.
 The sampling frequency or sampling rate, fs, is defined as the number of samples
obtained in one second (samples per second), thus
fs = 1/T.
 In the diagram, a sine wave (red curve) is sampled and quantized for PCM. The sine
wave is sampled at regular intervals, shown as vertical lines. For each sample, one of the
available values (on the y-axis) is chosen by some algorithm.

5.4.3 Quantization:

SNJB’s Late Sau.KB Jain CoE , Chandwad


Programming Laboratory-II Third Year Computer Engineering
 The process of quantizing a signal is the first part of converting an sequence of analog
samples to a PCM code.
 In quantization, an analog sample with an amplitude that may take value in a specific
range is converted to a digital sample with an amplitude that takes one of a specific pre–
defined set of quantization values.
 This is performed by dividing the range of possible values of the analog samples into L
different levels, and assigning the center value of each level to any sample that falls in
that quantization interval.
 The problem with this process is that it approximates the value of an analog sample with
the nearest of the quantization values. So, for almost all samples, the quantized samples
will differ from the original samples by a small amount.
 This amount is called the quantization error.
 To decide the number of quantizing levels use formula L=2n
Where n is the code.
E.g.:- n=3 then 23 =8
5.4.4 Encoding:
 Encoding is the process of representing the sampled values as a binary number in the
range 0 to n.
 The value of n is chosen as a power of 2, depending on the accuracy required.
 Increasing n reduces the step size between adjacent quantization levels and hence reduces
the quantization noise.
 The down side of this is that the amount of digital data required representing the analogue
signal increases.

SNJB’s Late Sau.KB Jain CoE , Chandwad


Programming Laboratory-II Third Year Computer Engineering

5.5 Algorithm:
1. Start
2. Enter Amplitude, Frequency and time values
3. Draw sine wave using sine formula.
4. Use Quantization levels code formula.
5. Convert the values into binary code.
6. End

5.6 Mathematical Model:

Problem Statement: Writing a program using C++ to implement Pulse Code Modulation.
Mathematical Model:
Let S be the system set for obtaining binary bits as output.
S={s, e, X, Y, Fme, Scr, DD, NDD,Fs, memsh, success cases, failure cases,—φs }
Where s = start i.e. start states = {f 1}
e = end state
X = input set such that X = {A, F, T, C}
A = {Amplitude of analog signal}
F = {Frequency of analog signal}
T = {time period of signal}
C= {Quantization code}
DD = Deterministic Data, here amplitude, frequency, time of analog signal.
NDD = Non-Deterministic Data, here Levels of analog signal must be uncertain initially.
Scr = Screen
Operations= {DrawSinewave (A, F, T), Draw Levels(C), Quantization(C, W)}
DrawSinewave(A,F,T) – Takes input as Amplitude, Frequency and time period and draws analog
signal. Sampling is done using for loop
Sine wave Formula= A*sin(2*3,14*F*T)
DrawLevels(c) – c is code for quantization. Using formula 2c Number of levels are decided.
Each level is associated with digit.
Quantization(C,W) – c is code and W is sine wave. Digits are converted into Binary digits.

SNJB’s Late Sau.KB Jain CoE , Chandwad


Programming Laboratory-II Third Year Computer Engineering

Y=output set such that


Y={Y1,Y2,...Yn—Y is the outcome of Encoding}
Success Case: We can get binary bits as output.
Failure Case: Invalid digits as output.

5.7 Assignment Questions:


1. What is PCM?
2. Draw block diagram of PCM and explain each block?
3. What is Modulation? Applications of PCM.
4. List and explain different Encoding schemes.

5.8 Oral Questions:


1. Explain different Modulation techniques?
2. Definition of PCM.
3. Advantages of PCM.
4. Difference between Analog and Digital Signal.

SNJB’s Late Sau.KB Jain CoE , Chandwad

You might also like