Saturday 20 February 2016

MATLAB PROGRAM FOR Delta Modulation Sine Wave

 Delta Modulation Sine Wave


 The operation of a delta modulator is to periodically sample the input message, to make a comparison of the current sample with that preceding it, and to output a single bit which indicates the sign of the difference between the two samples.


Matlab program for Delta Modulation
subplot(212)
hold on
m1=sin(2*pi*t)
plot(m1,'black')
title('sin wave')
xlabel('time')
ylabel('amplitude')
d=2*pi/100
for n=1:1:100
    if n==1
        e1(n)=m1(n)
        eq1(n)=d*sign(e1(n))
        mq1(n)=eq1(n)
    else
        e1(n)=m1(n)-mq1(n-1)
        eq1(n)=d*sign(e1(n))
        mq1(n)=mq1(n-1)+eq1(n)
    end
end
stairs(mq1,'black')
hleg=legend('original signal','stair case approximated signal')
hold off

 

No comments:

Post a Comment