Pulse Code Modulation (PCM), Theory and Matlab code
Pulse Code Modulation (PCM) is a method of digitally representing an analog signal. In PCM, the analog signal is sampled at regular intervals, and the amplitude of the signal at each sample point is quantized to a digital value. The resulting digital values are then encoded and transmitted.
PCM implementation typically involves the following steps:
- Sampling: The analog signal is sampled at regular intervals, typically at a rate of 8,000 to 44,100 samples per second.
- Quantization: The amplitude of each sample is quantized to a digital value, typically using 8 to 16 bits per sample.
- Encoding: The quantized digital values are encoded into a digital format, such as pulse code modulation (PCM) or pulse density modulation (PDM).
- Transmission: The encoded digital signal is transmitted over a communication channel, such as a wired or wireless link.
- Decoding: The received digital signal is decoded into quantized digital values.
- Reconstruction: The quantized digital values are used to reconstruct the original analog signal by playing back the samples in the correct order and at the correct sampling rate.
It’s worth noting that PCM is the most common method for digitizing analog audio signals, also it is widely used in other fields such as telecommunications and video. However, PCM has some limitations, such as the need for a high sampling rate and a large number of bits per sample to accurately represent the original signal.
Matlab Code
P=5;
t = [0:0.1:1*pi];
sig = 4*sin(t);
Vh=max(sig);
V1=min(sig);
N=3;M=2^N;
S=(Vh-V1)/M;
partition = [V1+S:S:Vh-S];
codebook = [V1+S/2:S:Vh-S/2];
[index,quantized_sig,distor] = quantiz(sig,partition,codebook);
codedsig=de2bi(index,'left-msb');
codedsig=codedsig;
txbits=codedsig(:);
errvec=randsrc(length(txbits),1,[0 1;(1-P/100) P/100]);
rxbits=rem(txbits+errvec,2);
rxbits=reshape(rxbits,N,length(sig));
rxbits=rxbits';
index1=bi2de(rxbits,'left-msb');
reconstructedsig=codebook(index1+1);
figure,
subplot(2,2,1);
stem(t,sig);
xlabel('Time');
title('original signal');
subplot(2,2,2);
stem(t,quantized_sig);
xlabel('time)');
title('quantized signal');
tt=[0:N*length(t)-1];
subplot(2,2,3);
stairs(tt,txbits);
xlabel('time');
title('PCM Waveform');
subplot(2,2,4);
stem(t,reconstructedsig);
xlabel('time');
title('received signal');
Output
More Matlab Projects
- Microwave and Antenna Various Matlab CodesMicrowave and Antenna Various Matlab Codes. Some of the Projects are below. Polar form for a Symmetrical Dipole of Finite… Read more: Microwave and Antenna Various Matlab Codes
- Multiple Input Multiple Output(MIMO) using MatlabIntroduction Multiple Input Multiple Output(MIMO) using Matlab. Multiple Input Multiple Output (MIMO) is a technology used in wireless communication systems… Read more: Multiple Input Multiple Output(MIMO) using Matlab
- Pulse Width Modulation(PWM) working Principal using MatlabIntroduction Pulse Width Modulation(PWM) working Principal using Matlab. PWM stands for Pulse Width Modulation. It is a type of digital… Read more: Pulse Width Modulation(PWM) working Principal using Matlab
- Quadrature Amplitude Modulation(QAM): Theory and MatlabIntroduction Quadrature Amplitude Modulation(QAM): Theory and Matlab QAM stands for Quadrature Amplitude Modulation. It is a method of combining two… Read more: Quadrature Amplitude Modulation(QAM): Theory and Matlab
- Polar form for a Symmetrical Dipole of Finite Length: Matlab ScriptPolar form for a Symmetrical Dipole of Finite Length: Matlab Script. This Experiment include finding of: Introduction The polar form… Read more: Polar form for a Symmetrical Dipole of Finite Length: Matlab Script
- Radiated Power and Maximum Directivity of any Antenna: Theory and Matlab codeRadiated Power and Maximum Directivity of any Antenna: Theory and Matlab code. Introduction The radiated power of an antenna refers… Read more: Radiated Power and Maximum Directivity of any Antenna: Theory and Matlab code
- Polar form for a Loop Antenna with Uniform Current: Theory and Matlab codeIntroduction The polar form for a loop antenna with uniform current can be determined using the far-field approximation and the… Read more: Polar form for a Loop Antenna with Uniform Current: Theory and Matlab code
- Two Dimensional(2-D) Polar and Semi-Polar Patters using Matlab codeIntroduction Two Dimensional(2-D) Polar and Semi-Polar Patters using Matlab code. Two-dimensional (2-D) polar and semi-polar patterns are graphical representations of… Read more: Two Dimensional(2-D) Polar and Semi-Polar Patters using Matlab code
Learn how to get ready for placement and crack interviews trick
- How to study for College Placements | How to get into Product Based Companies?
- Placement Roadmap for Top Companies
- Placement Strategies- A plan of Succeed-Interview
- For Placement Preparation. Placement Cell
- FOR MORE COURSES. FREE COURSES
- FOR Job Updates. JOB AND INTERNSHIP UPADTES
- For Latest Trends in Technology. Technology Blog
- For Quotes and Poems. Quotes-Poems
About Connect Kreations
We the team Connect Kreations have started a Blog page which is eminently beneficial to all the students those who are seeking jobs and are eager to develop themselves in a related area. As the world is quick on uptake, our website also focuses on latest trends in recent technologies. We are continuously putting our efforts to provide you with accurate, best quality, and genuine information. Here we also have complete set of details on how to prepare aptitude, interview and more of such placement/ off campus placement preparation.
Connect Kreations is excited to announce the expansion of our services into the realm of content creation! We are now offering a wide range of creative writing services, including poetry, articles, and stories.
Whether you need a heartfelt poem for a special occasion, a thought-provoking article for your blog or website, or an engaging story to captivate your audience, our team of talented writers is here to help. We have a passion for language and a commitment to creating high-quality content that is both original and engaging.
Our services are perfect for individuals, businesses, and organizations looking to add a touch of creativity and personality to their content. We are confident that our unique perspectives and diverse backgrounds will bring a fresh and exciting voice to your project.
Thank you for choosing Connect Kreations for your content creation needs. We look forward to working with you and helping you to bring your vision to life!
The website is open to all and we want all of you to make the best use of this opportunity and get benefit from it..🤓
- Our Websites: Connect Kreations
- Our Websites: StudentsDev Connect Kreations