PCM 1
PCM 1
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.3New Concepts:
a. PCM
b. Math functions
5.4 Theory
5.4.1 PCM: Pulse Code Modulation
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.
5.4.3 Quantization:
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
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.