+ All Categories
Home > Documents > Sahand University of Technology Electrical Engineering Department Microelectronic Research Center...

Sahand University of Technology Electrical Engineering Department Microelectronic Research Center...

Date post: 17-Dec-2015
Category:
Upload: dana-lucas
View: 214 times
Download: 1 times
Share this document with a friend
92
Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa azadbakht Advisor:Dr.E.Najafi aghdam 1
Transcript
Page 1: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

1

Sahand University of TechnologyElectrical Engineering DepartmentMicroelectronic Research Center

Simulink and code DSM D-T and C-TWith matlab

By:mostafa azadbakhtAdvisor:Dr.E.Najafi aghdam

Page 2: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

2

Tow way for simulink DSM:

• Simulink block library1

• code2m.azadbakht

Page 3: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

3

Totality algorithm for build discrete _ time DSM with sumulink block library:

H(Z) QUNTIZRESAMPLE AND HOLD

U V+

Y

1

m.azadbakht

Page 4: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

4

Totality algorithm for build discrete _ time DSM with sumulink code:2

Step 3

Give FFT of output simulink and plot…

Step 2Simulink DSM with command schreier

Step 1Read the input & Read the transfusion NTF

m.azadbakht

Page 5: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

5

STEP1:Read the NTF functionNTF=synthesizeNTF(order,osr,opt)

STEP 2:Read the gain feedback:FB=realizeNTF(NTF,’CIFB’)

STEP 3:Read the gain forward:FF=realizeNTF(NTF,’CIFF’)

All step for build discrete _ time Low pass DSM with simulink block library:

m.azadbakht

Page 6: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

6

Parameters for all simulinks:Amplitude max vin=0.5 voltFin=0.0008*2*pi~0.005*piOSR=64Opt=1

constant:

m.azadbakht

Page 7: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

7

Order 1:FB1=1

m.azadbakht

Page 8: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

8

Command for draw spectrum:Plotsp(vo,vi,k);k=1.5~4

m.azadbakht

Page 9: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

9

View analog in put and digital out put

Analog in

Digital out

m.azadbakht

Page 10: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

10

Simulink DSM 1’s order Low pass with simulink code:

close all,clear all,clcosr=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 ff=linspace(0,0.5,n/3);figure,plot(f,dbv(spec(1:n/3)),'b'),grid on

m.azadbakht

Page 11: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

11

Order 2:FB1=1 FB2=1

m.azadbakht

Page 12: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

12

View spectrum :

m.azadbakht

Page 13: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

13

View analog in put and digital out put

Analog in

Digital out

m.azadbakht

Page 14: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

14

Simulink DSM 2’s order Low pass with simulink code:

close all,clear all,clcosr=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 ff=linspace(0,0.5,n/3);figure,plot(f,dbv(spec(1:n/3)),'b')

m.azadbakht

Page 15: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

15

Order 3:FB1=0.44 FB2=0.2881 FB3=0.7997

m.azadbakht

Page 16: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

16

View spectrum :

m.azadbakht

Page 17: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

17

View analog in put and digital out put

Analog in

Digital out

m.azadbakht

Page 18: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

18

Simulink DSM 3’s order Low pass with simulink code:

close all,clear all,clcosr=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 ff=linspace(0,0.5,n/3);figure,plot(f,dbv(spec(1:n/3)),'b')

m.azadbakht

Page 19: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

19

Order 4:FB1=0.2923 FB2=1.4212 FB3=2.7446 FB4=2.5536FF1=2.5536 FF2=2.7446 FF3=1.4212 FF4=0.2923

m.azadbakht

Page 20: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

20

View spectrum :

m.azadbakht

Page 21: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

21

View analog in put and digital out put

Analog in

Digital out

m.azadbakht

Page 22: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

22

Simulink DSM 4’s order Low pass with simulink code:

close all,clear all,clcosr=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 ff=linspace(0,0.5,n/3);figure,plot(f,dbv(spec(1:n/3)),'b')

m.azadbakht

Page 23: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

23

Order 5:FB1=0.1086 FB2=0.7247 FB3=2.0551 FB4=3.1432 FB5=2.6416FF1=2.6416 FF2=3.1432 FF3=2.0551 FF4=0.7247 FF5=0.1086

m.azadbakht

Page 24: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

24

View spectrum :

m.azadbakht

Page 25: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

25

View analog in put and digital out put

Analog in

Digital out

m.azadbakht

Page 26: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

26

Simulink DSM 5’s order Low pass with simulink code:

close all,clear all,clcosr=64;N=1;Nlev=2^N;n=2^13;z=57;t=[0:n-1];H=synthesizeNTF(5,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 ff=linspace(0,0.5,n/3);figure,plot(f,dbv(spec(1:n/3)),'b')

m.azadbakht

Page 27: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

27

Order 6:FB1=0.0325 FB2=0.2855 FB3=1.1098 FB4=2.4712 FB5=3.3619 FB6=2.6850FF1=2.6850 FF2=3.3619 FF3=2.4712 FF4=1.1098 FF5=0.2855 FF6=0.0325

m.azadbakht

Page 28: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

28

View spectrum :

m.azadbakht

Page 29: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

29

View analog in put and digital out put

Analog in

Digital out

m.azadbakht

Page 30: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

30

Simulink DSM 6’s order Low pass with simulink code:

close all,clear all,clcosr=64;N=1;Nlev=2^N;n=2^13;z=57;t=[0:n-1];H=synthesizeNTF(6,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 ff=linspace(0,0.5,n/3);figure,plot(f,dbv(spec(1:n/3)),'b')

m.azadbakht

Page 31: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

31

Order 7:FB1=0.0082 FB2=0.0913 FB3=0.4664 FB4=1.4036 FB5=2.7423 FB6=3.4921 FB7=2.7096FF1=2.7093 FF2=3.4921 FF3=2.7423 FF4=1.4036 FF5=0.4664 FF6=0.0913 FF7=0.0082

m.azadbakht

Page 32: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

32

View spectrum :

m.azadbakht

Page 33: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

33

View analog in put and digital out put

Analog in

Digital out

m.azadbakht

Page 34: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

34

Simulink DSM 7’s order Low pass with simulink code:

close all,clear all,clcosr=64;N=1;Nlev=2^N;n=2^13;z=57;t=[0:n-1];H=synthesizeNTF(7,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 ff=linspace(0,0.5,n/3);figure,plot(f,dbv(spec(1:n/3)),'b')

m.azadbakht

Page 35: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

35

Simulink DSM Band pass for all order with block library :

(Z) (Z)Z -

m.azadbakht

CONVERT

Page 36: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

36

Simulink DSM band pass 1’s order with block library :

m.azadbakht

Page 37: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

37

View spectrum :

m.azadbakht

Page 38: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

38

View analog in put and digital out put

Analog in

Digital out

m.azadbakht

Page 39: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

39

Simulink DSM 1’s order Band pass with analysis code:

close all;clear all;clcamp=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; endendfigure(100),plotsp(u,v,2);figure(200),plot(v)

m.azadbakht

Page 40: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

40

View spectrum :

m.azadbakht

Page 41: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

41

Digital output:

m.azadbakht

Page 42: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

42

Simulink DSM band pass 2’s order with block library :

m.azadbakht

Page 43: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

43

View spectrum :

m.azadbakht

Page 44: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

44

View analog in put and digital out put

Analog in

Digital out

m.azadbakht

Page 45: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

45

Simulink DSM 2’s order Band pass with analysis code:

close all;clear all;clcamp=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; endendfigure(100),plotsp(u,v,2);figure(200),plot(v)

m.azadbakht

Page 46: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

46

View spectrum :

m.azadbakht

Page 47: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

47

Digital output:

m.azadbakht

Page 48: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

48

Simulink DSM band pass 3’s order with block library :

m.azadbakht

Page 49: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

49

View spectrum :

m.azadbakht

Page 50: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

50

View analog in put and digital out put

Analog in

Digital out

m.azadbakht

Page 51: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

51

Simulink DSM 3’s order Band pass with analysis code:

close all;clear all;clcamp=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; endendfigure(100),plotsp(u,v,2);figure(200),plot(v)

m.azadbakht

Page 52: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

52

View spectrum :

m.azadbakht

Page 53: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

53

Digital output:

m.azadbakht

Page 54: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

54

Simulink DSM band pass 4’s order with block library :

m.azadbakht

Page 55: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

55

View spectrum :

m.azadbakht

Page 56: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

56

View analog in put and digital out put

Analog in

Digital out

m.azadbakht

Page 57: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

57

Simulink DSM 4’s order Band pass with analysis code:

close all;clear all;clcamp=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; endendfigure(100),plotsp(u,v,2);figure(200),plot(v)

m.azadbakht

Page 58: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

58

View spectrum :

m.azadbakht

Page 59: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

59

Digital output:

m.azadbakht

Page 60: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

60

Simulink DSM band pass 5’s order with block library :

m.azadbakht

Page 61: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

61

View spectrum :

m.azadbakht

Page 62: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

62

View analog in put and digital out put

Analog in

Digital out

m.azadbakht

Page 63: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

63

Simulink DSM 5’s order Band pass with analysis code:

close all;clear all;clcn=2^15;t=[0:n];fin=0.25;amp=0.455;u=amp*sin(2*pi*fin*t);y=zeros(1,n);v=y;for i=11:n; y(i)=-4.998*y(i-2)-9.996*y(i-4)-9.998*y(i-6)-4.99*y(i-8)-y(i-10)-0.80769*u(i-2)-2.9141*u(i-4)-3.97*u(i-6)-2.4186*u(i-8)-0.555*u(i-10)+0.80769*v(i-2)+2.9141*v(i-4)+3.97*v(i-6)+2.4186*v(i-8)+0.555*v(i-10); if y(i)>0 v(i)=1; else v(i)=-1; endendfigure(100),plotsp(u,v,2);figure(200),plot(v)

m.azadbakht

Page 64: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

64

View spectrum :

m.azadbakht

Page 65: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

65

Digital output:

m.azadbakht

Page 66: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

66

Totality algorithm for build continuous _ time DSM with sumulink block library:1

H(Z) QUNTIZREU V+

Y

SAMPLE AND HOLD

m.azadbakht

Page 67: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

67

Order 1:

m.azadbakht

Page 68: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

68

View spectrum :

m.azadbakht

Page 69: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

69

View analog in put and digital out put

Analog in

Digital out

m.azadbakht

Page 70: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

70

Order 2:FB1=1 FB2=1.5

m.azadbakht

Page 71: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

71

View spectrum :

m.azadbakht

Page 72: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

72

View analog in put and digital out put

Analog in

Digital out

m.azadbakht

Page 73: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

73

Order 3:FB1=0.2316 FB2=0.7868 FB3=2.4154

Fg=1/650

m.azadbakht

Page 74: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

74

View spectrum :

m.azadbakht

Page 75: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

75

View analog in put and digital out put

Analog in

Digital out

m.azadbakht

Page 76: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

76

Order 4:FB1=0.0889 FB2=0.1379 FB3=.2039 FB4=0.3184

Fg=0.0168

m.azadbakht

Page 77: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

77

View spectrum :

m.azadbakht

Page 78: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

78

View analog in put and digital out put

Analog in

Digital out

m.azadbakht

Page 79: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

79

Calculate SNRmax

• Analytical code just for 1;s order and 2’s order1

• Simulink code for all order’s2

m.azadbakht

Page 80: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

80

close allclear allclcSNRmax=zeros(1,256);x=100;for N=1:4; %degree quantizer for osr=4:4:1024; SNRmax(osr)=6.02*N+1.76-5.17+30*log10(osr); end figure(x);plot(SNRmax); x=x+100;end

Analytical code 1’s order:

SNRmax=6.02N+1.76db-5.17db+30log(osr)

m.azadbakht

Page 81: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

81

N=1Figure 100:

SNRmax=92.92db

m.azadbakht

Page 82: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

82

N=2Figure 200:

SNRmax=98.94db

m.azadbakht

Page 83: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

83

N=3Figure 300:

SNRmax=105db

m.azadbakht

Page 84: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

84

N=4Figure 400:

SNRmax=111db

m.azadbakht

Page 85: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

85

Analytical code 2’s order:

SNRmax=6.02N+1.76db-12.9db+50log(osr)

close allclear allclcx=100;SNRmax=zeros(1,256);for N=1:4; for osr=4:4:1024; SNRmax(osr)=6.02*N+1.76-12.9+50*log10(osr); end figure(x);plot(SNRmax); x=x+100;end

m.azadbakht

Page 86: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

86

N=1Figure 100:

SNRmax=145.4db

m.azadbakht

Page 87: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

87

N=2Figure 200:

SNRmax=151.4db

m.azadbakht

Page 88: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

88

N=3Figure 300:

SNRmax=157.4db

m.azadbakht

Page 89: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

89

N=4Figure 400:

SNRmax=163.5db

m.azadbakht

Page 90: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

90

Simulink code for all order

m.azadbakht

Page 91: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

91

close all,clear all,clcformat longn=2^18;z=57;t=[0:n-1];u=0.452*sin(2*pi*z/n*t);SNRmax=zeros(1,256);x=100;for order=1:4;for N=1:4; NLEV=2^N;for osr=4:4:1024; h=synthesizeNTF(order,osr,1); v=simulateDSM(u,h,3); spec=fft(v)/(n*(NLEV-1)/2); SNRmax(osr)=calculateSNR(spec(1:ceil(n/(2*osr))+1),z); end figure(x);plot(SNRmax); x=x+100;endend

m.azadbakht

Page 92: Sahand University of Technology Electrical Engineering Department Microelectronic Research Center Simulink and code DSM D-T and C-T With matlab By:mostafa.

92

THANK’S

m.azadbakht


Recommended