Monday 10 November 2014

Matlab code for Pulse Code modulation



Pulse-code modulation (PCM) is a method used to digitally represent sampled analog signals. It is the standard form of digital audio in computers, Compact Discs, digital telephony and other digital audio applications. In a PCM stream, the amplitude of the analog signal is sampled regularly at uniform intervals, and each sample is quantized to the nearest value within a range of digital steps.
PCM streams have two basic properties that determine their fidelity to the original analog signal: the sampling rate, the number of times per second that samples are taken; and the bit depth, which determines the number of possible digital values that each sample can take.

The matlab program given here is for finding pulse width modulation(PWM) and pulse position modulation (PPM). 



Pulse width modulation



Pulse position modulation

% Program for Pulse Code modulation with input signal x =  [.2 .5 .3 .6]
clc
disp('select your choice  1 - pulse width   2 - pulse position')
i = input('select your choice   - : ')
if i == 1
   
    x = input('input signal = ')
   
    [y,t ] = modulate(x,100,1000,'pwm','centered');
    subplot(2,1,1)
    plot(x)
    title('Input signal')
    subplot(2,1,2);
    plot(t,y)
      title('Pulse Width Modulation')
end
if i == 2
  
    x = input('input signal = ')
   
    [y,t ]= modulate(x,100,1000,'ppm',0.2);
    subplot(2,1,1)
    plot(x)
    title('Input signal')
    subplot(2,1,2);
    plot(t,y)
    title('Pulse Position Modulation')
end


Download Project for B.E, B.Tech, BCA, MCA, M.E, M.Tech, B.Sc, M.Sc and Polytechnic

0 comments:

Post a Comment

Total Pageviews

CONTACT US

Prof. Roshan P. Helonde
Mobile / WhatsApp: +917276355704
Email: roshanphelonde@rediffmail.com

Contact Form

Name

Email *

Message *

Archive

Notes Planet Copyright 2018. Powered by Blogger.