instructor for Delta Sigma ADC's Simulation With Matlab
-
Upload
mostafa-azadbakht -
Category
Engineering
-
view
1.228 -
download
16
description
Transcript of instructor for Delta Sigma ADC's Simulation With Matlab
Sahand University of Technology
Electrical Engineering Department
Microelectronic Research Center
A Simulation Training for Sigma-Delta Modulators by Matlab CAD-Tool
By: Mostafa azadbakht
Advisor: Dr.E.Najafi aghdam
1
2
These simulations are performed by Matlab CAD-tool.
It’s need that the ‘delsig’ toolbox attached with your CAD-tool before you want to start
simulation .
‘delsig’ toolbox is a dataset codes that was written by Shreier in [1].
Two possible way to simulate a DSM in
Matlab CAD-tool
• By Simulink block library1
• By code2
3
Block diagram of a discrete-time(DT) DSM:
4
Step-by-step simulation codes for a discrete - time DSM by Schreier code’s:
Step 3
Taking the Fast Fourier Transform (FFT) of the output signal and calculating the SNR
Step 2
Used of the simulation command’s of Schreier code’s to run and simulate the DSM
Step 1
Define a input and a desired transfer function (NTF)
5
STEP1:
Define a desired NTF as:
NTF = synthesizeNTF(order,osr,opt)
STEP 2:
Generating the feed-back paths gain as follow:
FB = realizeNTF(NTF,’CIFB’)
STEP 3:
Generating the feed-forward paths gain as follow:
FF = realizeNTF(NTF,’CIFF’)
Step-by-step code simulations for a discrete - time DSM by Schreier code’s:
6
Low pass DT-DSM, order 1:
Gain paths (FB1=1)
7
Low pass DT-DSM, order 1:
8
close all,clear all,clc
osr=64;
N=1;
Nlev=2^N;
n=2^13;
z=57;
t=[0:n-1];
H=synthesizeNTF(1,osr,1);
u=0.5*(Nlev-1)*sin(2*pi*z/n*t);
v=simulateDSM(u,H,Nlev);
spec=fft(v)/(n*(Nlev-1)/2);
snr=calculateSNR(spec(1:ceil(n/(2*osr))+1),z);
clear f
f=linspace(0,0.5,n/3);
figure,plot(f,dbv(spec(1:n/3)),'b'),grid on
Used of the “plotsp” to plot the spectrum as: plotsp(vo,vi,k);k=1.5~4
9
Low pass DT-DSM, order 2:
Gain paths (FB1=1 FB2=1)
10
Low pass DT-DSM, order 2:
11
close all,clear all,clc
osr=64;
N=1;
Nlev=2^N;
n=2^13;
z=57;
t=[0:n-1];
H=synthesizeNTF(2,osr,1);
u=0.5*(Nlev-1)*sin(2*pi*z/n*t);
v=simulateDSM(u,H,Nlev);
spec=fft(v)/(n*(Nlev-1)/2);
snr=calculateSNR(spec(1:ceil(n/(2*osr))+1),z);
clear f
f=linspace(0,0.5,n/3);
figure,plot(f,dbv(spec(1:n/3)),'b')
Used of the “plotsp” to plot the spectrum as: plotsp(vo,vi,k);k=1.5~4
12
Low pass DT-DSM, order 3:
Gain paths (FB1=0.44 FB2=0.2881 FB3=0.7997)
13
14
close all,clear all,clc
osr=64;
N=1;
Nlev=2^N;
n=2^13;
z=57;
t=[0:n-1];
H=synthesizeNTF(3,osr,1);
u=0.5*(Nlev-1)*sin(2*pi*z/n*t);
v=simulateDSM(u,H,Nlev);
spec=fft(v)/(n*(Nlev-1)/2);
snr=calculateSNR(spec(1:ceil(n/(2*osr))+1),z);
clear f
f=linspace(0,0.5,n/3);
figure,plot(f,dbv(spec(1:n/3)),'b')
Low pass DT-DSM, order 3:
15
Used of the “plotsp” to plot the spectrum as: plotsp(vo,vi,k);k=1.5~4
Low pass DT-DSM, order 4:
Gain paths (FB1=0.2923 FB2=1.4212 FB3=2.7446 FB4=2.5536 // FF1=2.5536 FF2=2.7446 FF3=1.4212
FF4=0.2923)
16
17
close all,clear all,clc
osr=64;
N=1;
Nlev=2^N;
n=2^13;
z=57;
t=[0:n-1];
H=synthesizeNTF(4,osr,1);
u=0.5*(Nlev-1)*sin(2*pi*z/n*t);
v=simulateDSM(u,H,Nlev);
spec=fft(v)/(n*(Nlev-1)/2);
snr=calculateSNR(spec(1:ceil(n/(2*osr))+1),z);
clear f
f=linspace(0,0.5,n/3);
figure,plot(f,dbv(spec(1:n/3)),'b')
Low pass DT-DSM, order 4:
18
Used of the “plotsp” to plot the spectrum as: plotsp(vo,vi,k);k=1.5~4
Low pass to band pass conversion mechanism is as follow
19
Band pass DT-DSM, order 1:
20
21
close all;clear all;clc
amp=0.452;
n=2^15;
t=[0:n];
fin=0.24589746;
u=amp*sin(2*pi*fin*t);
y=zeros(1,n);
v=y;
for i=3:n;
y(i)=-y(i-2)-u(i-2)+v(i-2);
if y(i)>0
v(i)=1;
else
v(i)=-1;
end
end
figure(100),plotsp(u,v,2);figure(200),plot(v)
Band pass DT-DSM, order 1:
22
Used of the “plotsp” to plot the spectrum as: plotsp(vo,vi,k);k=1.5~4
23
Band pass DT-DSM, order 2:
24
close all;clear all;clc
amp=0.452;
n=2^15;
t=[0:n];
fin=0.24985;
u=amp*sin(2*pi*fin*t);
y=zeros(1,n);
v=y;
for i=5:n;
y(i)=-2*y(i-2)-y(i-4)-2*u(i-2)-u(i-4)+2*v(i-2)+v(i-4);
if y(i)>0
v(i)=1;
else
v(i)=-1;
end
end
figure(100),plotsp(u,v,2);figure(200),plot(v)
Band pass DT-DSM, order 2:
25
Used of the “plotsp” to plot the spectrum as: plotsp(vo,vi,k);k=1.5~4
26
Band pass DT-DSM, order 3:
27
close all;clear all;clc
amp=0.452;
n=2^15;t=[0:n];fin=0.24898789;
u=amp*sin(2*pi*fin*t);
y=zeros(1,n);
v=y;
for i=7:n;
y(i)=-3*y(i-2)-3*y(i-4)-y(i-6)-0.8*u(i-2)-1.32*u(i-4)-
0.56*u(i-6)+0.8*v(i-2)+1.32*v(i-4)+0.56*v(i-6);
if y(i)>0
v(i)=1;
else
v(i)=-1;
end
end
figure(100),plotsp(u,v,2);figure(200),plot(v)
Band pass DT-DSM, order 3:
28
Used of the “plotsp” to plot the spectrum as: plotsp(vo,vi,k);k=1.5~4
29
Band pass DT-DSM, order 4:
30
close all;clear all;clc
amp=0.452;
n=2^15;t=[0:n];fin=0.24898789;
u=amp*sin(2*pi*fin*t);
y=zeros(1,n);
v=y;
for i=7:n;
y(i)=-3*y(i-2)-3*y(i-4)-y(i-6)-0.8*u(i-2)-1.32*u(i-4)-
0.56*u(i-6)+0.8*v(i-2)+1.32*v(i-4)+0.56*v(i-6);
if y(i)>0
v(i)=1;
else
v(i)=-1;
end
end
figure(100),plotsp(u,v,2);figure(200),plot(v)
Band pass DT-DSM, order 4:
31
Used of the “plotsp” to plot the spectrum as: plotsp(vo,vi,k);k=1.5~4
32
Block diagram of a continues-time (CT) DSM:
33
Low pass CT-DSM, order 1:
34
Used of the “plotsp” to plot the spectrum as: plotsp(vo,vi,k);k=1.5~4
Low pass CT-DSM, order 2:
Gain paths (FB1=1 FB2=1.5)
35
36
Used of the “plotsp” to plot the spectrum as: plotsp(vo,vi,k);k=1.5~4
Low pass CT-DSM, order 3:
Gain paths (FB1=0.2316 FB2=0.7868 FB3=2.4154 // Fg=1/650)
37
38
Used of the “plotsp” to plot the spectrum as: plotsp(vo,vi,k);k=1.5~4
Low pass CT-DSM, order 4:
Gain paths (FB1=0.0889 FB2=0.1379 FB3=.2039 FB4=0.3184 // Fg=0.0168)
39
40
Used of the “plotsp” to plot the spectrum as: plotsp(vo,vi,k);k=1.5~4
41
Bibliography
1-Undrestanding Delta-Sigma Data Converter ,Richard Schreier & Gabor C.Temes ,WILEY Publication.
2-Delta-Sigma Modulators Modeling, Design and Applications ,George I bourdopouls , Imperial college Press
Publication.
42
If you have any questions feel free to contact me.