instructor for Delta Sigma ADC's Simulation With Matlab

42
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

description

This presentation i try to train for simulation Delta-Sigma Modulator with code and block library in matlab software for Discrete - time and Continuous - time as low pass and band pass.finally i simulated SNR for various OSR and ploted it. i hope this presentation is useful for you.

Transcript of instructor for Delta Sigma ADC's Simulation With Matlab

Page 1: 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

Page 2: instructor for  Delta Sigma ADC's Simulation With Matlab

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].

Page 3: instructor for  Delta Sigma ADC's Simulation With Matlab

Two possible way to simulate a DSM in

Matlab CAD-tool

• By Simulink block library1

• By code2

3

Page 4: instructor for  Delta Sigma ADC's Simulation With Matlab

Block diagram of a discrete-time(DT) DSM:

4

Page 5: instructor for  Delta Sigma ADC's Simulation With Matlab

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

Page 6: instructor for  Delta Sigma ADC's Simulation With Matlab

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

Page 7: instructor for  Delta Sigma ADC's Simulation With Matlab

Low pass DT-DSM, order 1:

Gain paths (FB1=1)

7

Page 8: instructor for  Delta Sigma ADC's Simulation With Matlab

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

Page 9: instructor for  Delta Sigma ADC's Simulation With Matlab

Used of the “plotsp” to plot the spectrum as: plotsp(vo,vi,k);k=1.5~4

9

Page 10: instructor for  Delta Sigma ADC's Simulation With Matlab

Low pass DT-DSM, order 2:

Gain paths (FB1=1 FB2=1)

10

Page 11: instructor for  Delta Sigma ADC's Simulation With Matlab

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')

Page 12: instructor for  Delta Sigma ADC's Simulation With Matlab

Used of the “plotsp” to plot the spectrum as: plotsp(vo,vi,k);k=1.5~4

12

Page 13: instructor for  Delta Sigma ADC's Simulation With Matlab

Low pass DT-DSM, order 3:

Gain paths (FB1=0.44 FB2=0.2881 FB3=0.7997)

13

Page 14: instructor for  Delta Sigma ADC's Simulation With Matlab

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:

Page 15: instructor for  Delta Sigma ADC's Simulation With Matlab

15

Used of the “plotsp” to plot the spectrum as: plotsp(vo,vi,k);k=1.5~4

Page 16: instructor for  Delta Sigma ADC's Simulation With Matlab

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

Page 17: instructor for  Delta Sigma ADC's Simulation With Matlab

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:

Page 18: instructor for  Delta Sigma ADC's Simulation With Matlab

18

Used of the “plotsp” to plot the spectrum as: plotsp(vo,vi,k);k=1.5~4

Page 19: instructor for  Delta Sigma ADC's Simulation With Matlab

Low pass to band pass conversion mechanism is as follow

19

Page 20: instructor for  Delta Sigma ADC's Simulation With Matlab

Band pass DT-DSM, order 1:

20

Page 21: instructor for  Delta Sigma ADC's Simulation With Matlab

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:

Page 22: instructor for  Delta Sigma ADC's Simulation With Matlab

22

Used of the “plotsp” to plot the spectrum as: plotsp(vo,vi,k);k=1.5~4

Page 23: instructor for  Delta Sigma ADC's Simulation With Matlab

23

Band pass DT-DSM, order 2:

Page 24: instructor for  Delta Sigma ADC's Simulation With Matlab

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:

Page 25: instructor for  Delta Sigma ADC's Simulation With Matlab

25

Used of the “plotsp” to plot the spectrum as: plotsp(vo,vi,k);k=1.5~4

Page 26: instructor for  Delta Sigma ADC's Simulation With Matlab

26

Band pass DT-DSM, order 3:

Page 27: instructor for  Delta Sigma ADC's Simulation With Matlab

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:

Page 28: instructor for  Delta Sigma ADC's Simulation With Matlab

28

Used of the “plotsp” to plot the spectrum as: plotsp(vo,vi,k);k=1.5~4

Page 29: instructor for  Delta Sigma ADC's Simulation With Matlab

29

Band pass DT-DSM, order 4:

Page 30: instructor for  Delta Sigma ADC's Simulation With Matlab

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:

Page 31: instructor for  Delta Sigma ADC's Simulation With Matlab

31

Used of the “plotsp” to plot the spectrum as: plotsp(vo,vi,k);k=1.5~4

Page 32: instructor for  Delta Sigma ADC's Simulation With Matlab

32

Block diagram of a continues-time (CT) DSM:

Page 33: instructor for  Delta Sigma ADC's Simulation With Matlab

33

Low pass CT-DSM, order 1:

Page 34: instructor for  Delta Sigma ADC's Simulation With Matlab

34

Used of the “plotsp” to plot the spectrum as: plotsp(vo,vi,k);k=1.5~4

Page 35: instructor for  Delta Sigma ADC's Simulation With Matlab

Low pass CT-DSM, order 2:

Gain paths (FB1=1 FB2=1.5)

35

Page 36: instructor for  Delta Sigma ADC's Simulation With Matlab

36

Used of the “plotsp” to plot the spectrum as: plotsp(vo,vi,k);k=1.5~4

Page 37: instructor for  Delta Sigma ADC's Simulation With Matlab

Low pass CT-DSM, order 3:

Gain paths (FB1=0.2316 FB2=0.7868 FB3=2.4154 // Fg=1/650)

37

Page 38: instructor for  Delta Sigma ADC's Simulation With Matlab

38

Used of the “plotsp” to plot the spectrum as: plotsp(vo,vi,k);k=1.5~4

Page 39: instructor for  Delta Sigma ADC's Simulation With Matlab

Low pass CT-DSM, order 4:

Gain paths (FB1=0.0889 FB2=0.1379 FB3=.2039 FB4=0.3184 // Fg=0.0168)

39

Page 40: instructor for  Delta Sigma ADC's Simulation With Matlab

40

Used of the “plotsp” to plot the spectrum as: plotsp(vo,vi,k);k=1.5~4

Page 41: instructor for  Delta Sigma ADC's Simulation With Matlab

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.

Page 42: instructor for  Delta Sigma ADC's Simulation With Matlab

42

If you have any questions feel free to contact me.

Email: [email protected][email protected]