MATLAB Based PCM Modeling and Simulation
MATLAB Based PCM Modeling and Simulation
5973 ~ 5979
e-ISSN: 2087-278X
5973
Abstract
PCM is the key technology of digital communication, and has especially been widely used in the
optical fiber communication, digital microwave communication, satellite communication. Modeling PCM
communication systems with the pulse code system by programming, and conduct computer simulation by
MATLAB, to analysis performance of the linear PCM and logarithmic PCM.
1. Introduction
Pulse Code Modulation, referred to as PCM. It is a kind of encoding that changes
analog voice signal into digital signal [1]. In the late 1970 s, with the appearance of pulse code
modulation encoder and decoder for super-large-scale integrated circuit as well as the
development of optical fiber communication, digital microwave communications, satellite
communications, PCM has been gradually widely used. At present, the PCM has become a key
technology in digital communication [2-6].
2. Research Method
PCM modulation mainly includes sampling, quantization and encoding process.
Sampling changes the continuous analog signals into the discrete time continuous amplitude
sampling signals; Quantification changes the discrete time continuous amplitude sampling
signals into the discrete time discrete amplitude digital signals; Coding makes the quantified
signals into the output binary code groups. International standard PCM code groups (telephone
voice) adopt eight-level codes represents a sampling value [1]. From the view of modulation
concept in communication, it can be considered that, the PCM encoding process is analog
signal modulating a binary pulse sequence, the carrier is pulse sequence, and modulation
changes pulse sequence as none or "1", "0", therefore PCM is made into pulse code
modulation. Pulse code modulation process as shown in Figure 1.
Encoded PCM code groups, via digital channels, can be directly transmitted by
baseband or microwave, light wave carrier modulated pass band. At the receiving end, the
binary code group inversely transforms into the reconstruction analog signal xˆ ( t ) . In the
demodulation process, generally uses the sampling hold circuit, so the low pass filter adopts
x sin x
sin type frequency to response to compensate for frequency distortion x introduced by
x
sampling hold circuit is.
Pre-filtering is to limit the original speech signal frequency band within 300-3400 Hz
standard long-distance analog telephone frequency band. Due to the original speech band is
around 40-10000 Hz, so pre-filter can made out certain band distortion.
In the entire PCM system, the distortion of reconstruction signal xˆ ( t ) mainly results
from quantification as well as the channel transmission error, generally denotes as the signal
and the quantization noise power ratio, namely is signal-to-noise ratio S/N.
Received February 24, 2013; Revised July 9, 2013; Accepted July 20, 2013
5974 e-ISSN: 2087-278X
Waveform encoder
analog signal source pre-filter sampler Quantification, coding
Transmitting end
digital channel
receiving end
reconstruction filter
virtual terminal sample hold, x/sinx low pass waveform decoder
1 1 (aA) 2
q2 2 2 2 {[ 2 (aA) 2 ] sin 1 ( ) a 2 A 2 1},1 / A a 1
3C A L aA 2
C 1 /(1 InA) , A 87 .6
a2
S
And Sinusoidal instantaneous power 2
Based three formulas above, it can develop programs below, and come out the input
arrays sample values x and SNR. And draw out the SNR curve.
x=0:0.01:20;
a=sin(0.1*pi*x);
a2=max(a); % for the maximum amplitude
b=length(a);
Figure 2 is the result of the program running. The straight line in Figure is the uniform
quantization when n = 8 sinusoidal signal input, two curves respectively represents non-uniform
quantization SNR when n = 8 sinusoidal signal input, and n = 6 sinusoidal signal input.
S S
N
Q dB
q dB N q dB
S
N
q dB is the non-uniform quantization SNR
S
N q dB is the uniform quantization SNR
QdB is the SNR improvement quantities.
In the above formula, there is no consideration with over loaded noise, because the
calculation of overloaded noise, either by uniform quantization or non-uniform quantization, the
calculation methods and formulas are all the same, the SNR improvement quantities in the
formula should be
QdB 10 log(1 / )
In this formula,
1 1
2
p (a )da
1
dy
da
is the 13 line Approximation method improvement factors
y —Quantitative output signal;
a —Input signal;
p ( a ) —Probability density of normalized signal amplitude;
dy
da —Segment of the slope of corresponding line.
If taking the audio signal as the input signal, then the SNP can be
S
6n 4.77 20 log a Q dB
N u
q dB
Because the sinusoidal signal’s probability density is
1 1
P(a)
u a2
2
In this formula,
a —Instantaneous value of sinusoidal signal;
u —Peak value of sinusoidal signal.
Then the improvement factor is
2 1 1 1
2
da
0
dy u a2
2
da
For the reason that there are differences in slope at each paragraphs of the 13 line, in
the specific calculation, it is should according to the amount of the instantaneous value of input
signal to integrate with each paragraphs, improvement factor and at each paragraphs calculated
as:
1
1 2
The 1st, 2nd paragraph: 256
1 3 1
3 (1 arcsin )
The 3rd paragraph: 64 2 2
1 3 1
4 4 3
(1 arcsin )
The fourth paragraph: 64 2 4
1 3 1
5 4 4 (1 arcsin )
The fifth paragraph: 64 2 8
1 3 1
6 4 5
(1 arcsin )
The sixth paragraph: 64 2 16
1 3 1
7 4 6 (1 arcsin )
The seventh paragraph: 64 2 32
1 3 1
8 4 7 (1 arcsin )
The eighth paragraph: 64 2 64
According to the above method, it can be designed into the following program and
figured out the 13 line encoding SNR curve when the input is the sinusoidal signal:
x=0:0.01:20;
a=sin(0.1*pi*x);
a2=max(a); % for the maximum amplitude
b=length(a);
a1=abs(a); % for the absolute value of the input signal
X=20*log10(a1/a2);
n=8;
SNR11=6.02*n+4.77+X; % Uniform quantization SNR
plot(X,SNR11)
axis([-80 0 0 60]);
ylabel('SNR(dB)');xlabel('20logD (Instantaneous value/peak value)');
grid on
text ('Position',[-35,15],'String', 'linear quantizing n=8');
hold on
B(1)=1/256;
B(2)=1/256;
B(3)=1/64*(1-3/(2*pi)*asin(1/2)); % for improvement factors
B(4)=B(3)*4-1/64*3/(2*pi)*asin(1/4);
B(5)=B(4)*4-1/64*3/(2*pi)*asin(1/8);
B(6)=B(5)*4-1/64*3/(2*pi)*asin(1/16);
B(7)=B(6)*4-1/64*3/(2*pi)*asin(1/32);
B(8)=B(7)*4-1/64*3/(2*pi)*asin(1/64);
n=8;
A=87.6;
for i=1:b
a1=a(i)*(2^11-1);
C=pcmad(8,a1); % 13 line encoding
C1=C(2:4); % take the 2nd and fourth number of the code
S=exdac(3,C1); % for paragraph
s=B(S+1); % for improvement factors with the corresponding paragraph
Figure 3 is the result of the program running. Through the Figure can be seen that with
the 13 line approximation of Alaw compression feature, SNR curve will appear fluctuations, and
it is no longer the smooth curve, there are 6 troughs, 7peaks in total.
linear quantizing:
n=8
20logD (peaks)
4. Conclusion
PCM has been as the key technology in the modern digital communications, which
occupies an important position in the communication engineering. In this paper PCM system
simulation was established based on the Matlab and comparative analysis on the performance
of the linear PCM and logarithmic PCM, and the given specific examples can provide reference
for other communication system simulation analysis.
References
[1] Zhigang Cao, Yasheng Qian. Modern Communication Principles. Beijing: tsinghua university press.
1992.
[2] Huaicheng Cheng, Dazheng Wu, Gaixi Quan. MATLAB and Its Application in Electronic and
Information Courses. Beijing: Electronic Industry Press. 2002.
[3] Lijun Zheng,Qiheng Ying,Weili Yang. Signals and Systems (second edition). Beijing: Higher Education
Press. 2000.
[4] Hua Deng. MATLAB Simulation and Communication Application Example Explanation. Beijing:
People's Posts and Telecommunications Press. 2003.
[5] Hong Liang, Yuanyuan Pu, Jieliang. Signal and linear System Analysis: Method Based on MATLAB
and Implementation. Beijing: Higher Education Press. 2006.
[6] Liang Jia-Hai, Jin Yong-Chao, Jia Jin-Ning. Research of Modeling and Simulation of Shrimp Farming
Process Based on Agent. Journal of yunnan agricultural university: natural science edition. 2011;
26(6): 866-871.