Matlab Simulation of Delta Mod
Matlab Simulation of Delta Mod
1.1 Objectives
1 To understand the operation theory of Delta modulation
2 To simulate Delta Modulation using Matlab
1.2 Basic Theory
Give a brief explanation about:
1. Analog to Digital Converter
2. Delta Modulation – Demodulation basic principle
1.3 Experiment Apparatus
1. Matlab software
1.4 Procedures
1. Type the following script onto your M-File
1. clc;
2. clear all
3. close all
4. f=27;%freq in kHz
5. fs=100*f; %sampling frequency
6. t=0:1/fs:2/f;
7. A=1; %amplitude in Volt
8. m=A*sin(2*pi*f*t); %information signal
9. plot(t,m,'k-');
10. hold all;
11. d=1/f; %step size
12. %% start delta mod
13. for n=1:length(m)
14. if n==1
15. e(n)=m(n);
16. eq(n)=d*sign(e(n));
17. mq(n)=eq(n);
18. else
19. e(n)=m(n)-mq(n-1);
20. eq(n)=d*sign(e(n));
21. mq(n)=mq(n-1)+eq(n);
22. end
23. end
24. stairs(t,mq,'r-'); %plot staircase approximation of
information signal m
25.
26. %% start binary representation of staircase signal
27. diff=m-mq;
28. comp=zeros(1, size(diff,2));
29. for i=1:numel(diff)
1.6 Conclusion