Está en la página 1de 13

M PHONG MAY PHAT VI BA S BNG MATLAB

MUC LUC:

I. LI GII THIU: II. Tng quan v vi ba s III. M phong qua trinh iu ch 8-psk va trn nng tn A. iu ch 8psk ( s khi b s/p, s khi iu ch, gian vecto 8 trang thai pha). B. iu ch 8-psk bng m-file cua matlab, giai thich cac dong lnh. C. Kt qua m phong.

GVHD: Th.s Vo Trng Sn SVTH: Nguyn Vn Sn

M PHONG MAY PHAT VI BA S BNG MATLAB

Li gii thiu:
Nh chung ta a bit v mt h thng thng tin s bng gc, trong o tin hiu c truyn trc tip khng co dich tn cua tin hiu. Do tin hiu bng gc co cng sut kha ln tn thp, chung thich hp cho vic truyn qua mt cp dy ng hay cap ng truc. Tin hiu bng gc khng th truyn qua ng v tuyn vi khng co anten u ln phat tin hiu tn thp. Vi vy, vi nhng muc ich o ph cua tin hiu phai c dich ln dai tn cao. Vic dich ln dai tn cao la cn thit truyn ng thi nhiu ban tin bng cach chia rng dai cua mi trng truyn(FDM). Ph cua tin hiu co th dich chuyn ln cao bng phng phap iu ch s, sau o c trn nng tn ri a ln anten phat. Va trong qua trinh hoc mn vi ba s thi em a c thy Vo Trng Sn gii thiu mt cng cu rt ph bin c s dung trong nganh ky thut noi chung va nganh vin thng noi ring m phong qua trinh iu ch s, trn nng tn trong nguyn ly hoat ng cua may phat vi ba s. Va o cung chinh la ni dung chinh cua bai thit k: M phong may phat vi ba s bng matlab, mn hoc ma em c giao. Trong qua trinh thc hin bai thit k em cung xin chn thanh cam n s giup cua thy giao Vo Trng Sn a giup em hoan thanh bai thit k mt cach tt nht.!.

GVHD: Th.s Vo Trng Sn SVTH: Nguyn Vn Sn

M PHONG MAY PHAT VI BA S BNG MATLAB

II. TNG QUAN V VI BA S:


1)

Khai nim: vi ba s la h thng thng tin chuyn tip mt t s dung song in

t tn s GHZ truyn dn thng tin s. Lng thng tin c truyn dn bi h thng vi ba la kha ln ( vi du: cac lung E1, E3, E4, STM1) Vi ba s thuc nhom cac h thng thng tin nhiu knh. H thng vi ba s la h thng thng tin v tuyn s c s dung trong cac ng truyn dn s gia cac phn t khac nhau cua mang v tuyn. H thng vi ba s co th c s dung lam: o Cac ng trung k s ni gia cac tng ai s. o Cac ng truyn dn ni tng ai chinh n cac tng ai v tinh. o Cac ng truyn dn ni cac thu bao vi cac tng ai chinh hoc cac tng ai v tinh. o Cac b tp trung thu bao v tuyn. o Cac ng truyn dn trong cac h thng thng tin di ng kt ni cac may di dng vi mang vin thng. o Cac h thng truyn dn vi ba s la cac phn t quan trong cua mang vin thng, tm quan trong nay ngay cang c khng inh khi cac cng ngh thng tin c s dung rng rai trong mang vin thng. 2) Cu truc mt tuyn vi ba s:

3)

iu ch s:
o co th truyn dn cac thng tin s bng song in t cn phai tin hanh iu ch s o iu ch s la ky thut gn thng tin s vao dao ng hinh sine( song mang) lam cho song mang co th mang thng tin cn truyn i. o Song mang hinh sine co dang: x(t) = Acos(2*pi*fc*t + phi). o Co 3 thng s ma song mang co th mang i o la A : Bin , fc : tn s, phi : goc pha. o Do o ta co th tac ng ln 1 trong 3 thng s trn thi ta se co cac phng phap iu ch s tng ng nh sau : Amplitude- shift keying(ASK) :iu ch khoa - dich bin

GVHD: Th.s Vo Trng Sn SVTH: Nguyn Vn Sn

M PHONG MAY PHAT VI BA S BNG MATLAB Frequency shift keying(FSK) : iu ch khoa - dich tn Phase shift keying (PSK): iu ch khoa dich pha Quadrature amplitude modulation (QAM): y la iu ch bin cu phng. y la phng phap kt hp gia ASK va PSK.

III. M phong qua trinh iu ch 8-psk va trn nng tn

Ni dung m phong may phat vi ba s bng

matlab:
M phong bng matlab m-file mt may phat vi ba s bao gm hai c cu: iu ch s va trn nng tn. D liu vao ngu nhin vi s lng bit: 24, tc bit la lung E2, iu ch 8psk, tn s IF 220(Mhz), tn s RF 1.5(Ghz).

Ni dung chinh:
A. iu ch 8psk ( s khi b s/p, s khi iu ch, gian vecto 8 trang thai pha). B. iu ch 8-psk bng m-file cua matlab, giai thich cac dong lnh C. Kt qua m phong

A.

iu ch 8-psk: 1) s khi b s/p:


giam bng thng cua thit bi, xu hng ngi ta tng trang thai pha. Sau iu ch 4psk la 8psk. Trong phng thc iu ch nay, mt lung Fb c chia thanh 3 lung a, b, c b bin i ni tip sang song song. Tc bit cac lung s u ra giam i 3 ln. S khi b bin i S/P nh sau: a b c 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1

S/P

/8

3/8

5/8

7/8

9/8 11/8 13/8 15/8

GVHD: Th.s Vo Trng Sn SVTH: Nguyn Vn Sn

M PHONG MAY PHAT VI BA S BNG MATLAB Hinh 1.0: S khi b S/P

2) S khi iu ch 8psk nh sau:


Fb/3 a Bin i mc 2 4 I

Fb

B chia 3

c(t) 900 Bin i mc 2 4 Q

8psk Trn tn loc

Fb/3

Hinh 2.0: S khi iu ch 8psk

3) Gian pha 8psk

GVHD: Th.s Vo Trng Sn SVTH: Nguyn Vn Sn

M PHONG MAY PHAT VI BA S BNG MATLAB

lung s u vao Fb c a vao b chia 3, u ra co 3 lung tin hiu tc bit giam 1/3 o la: Fb/3 a; Fb/3 b; Fb/3 c; sau o no c a qua b chuyn i 2 mc thanh 4 mc, cac mc tin hiu nay c a qua b chuyn i 2 mc thanh 4 mc, cac mc tin hiu nay c a vao b nhn vi song mang chun. u ra chung c cng lai c tin hiu 8-psk sau o a qua b trn tn s cao RF, tip theo cho qua b loc thng bng ta thu c tin hiu sau khi trn nng tn sau o a ln anten phat. Nhn xet: u im: Khi s trang thai pha tng cao, tc bit giam xung. iu nay co mt y nghia quan trong, no se lam giam bng thng cua h thng, tit kim c ng truyn dn cho phep thc hin thng tin nhiu knh. Nhc im: Tuy nhin, bn canh nhng u im trn thi khi s trang thai pha tng, cac t hp bit ngay cang gn nhau hn, kha nng mc li se tng.Nu c tip tuc tng s trang thai pha ln na thi kha nng mc li se tng ln nhanh hn. Vi ly do nay, khi truyn thng tin co tc cao, s trang thai pha nhiu, giam kha nng nay khi s trang thai pha la 16, 32 thi ngi ta s dung phng thc khac, o la ky thut iu ch bin cu phng QAM.

Phn 2: iu ch 8-psk bng m-file cua matlab


B.

1. Tb=1000 %thoi gian cua bit ,moi bit dai dien 1000 diem 2. sb=24 %so bit 3. b=ones(1,Tb)%tao ra 1 ma tran 1 hang 1000 cot 4. data=[]% tap rong 5. dataI=[]% tap rong 6. data=[]% tap rong 7. bit1=[]% tap rong 8. bit2=[]% tap rong 9. bit3=[]% tap rong 10. dataQ=[]% tap rong

GVHD: Th.s Vo Trng Sn SVTH: Nguyn Vn Sn

M PHONG MAY PHAT VI BA S BNG MATLAB

%******************************** 11. for k=1:1:sb 12. bit=randint(1,1,2) %tao ra bit nhi phan ngau nhien 0 hoac 1 13. data=[data b*bit] % tao ra ma tran data chua ma tran b nhan bit nhi phan ngau nhien % DUNG CAU TRUC switch-case 14. switch mod(k,3) %bieu thuc dieu kien la phep chia lay du. 15. case 1 %neu ket qua bieu thuc dieu kien la 1 thi thuc hien khoi lenh sau 16. bit1=[bit1 bit]%gan ma tran bit1 chua day bit nhi phan thu nhat 17. case 2 %neu ket qua bieu thuc dieu kien la 2 thi thuc hien khoi lenh sau 18. bit2=[bit2 bit]%gan ma tran bit2 chua day bit nhi phan thu hai 19. case 0 %neu ket qua bieu thuc dieu kien la 0 thi thuc hien khoi lenh sau bit3=[bit3 bit]%gan ma tran bit3 chua day bit nhi phan thu ba 20. end %ket thuc cau truc switch-case 21. end %ket thuc vong lap for %************************************ 22. for k=1:sb/3 %vong lap for chay trong tung ma tran bit1;bit2;bit3 23. if bit1(k)==0 && bit2(k)==0&& bit3(k)==0 %kiem tra phan tu nhi phan thu k trong tung nhanh 24. dataI=[dataI 1*ones(1,3*Tb)];%gan ma tran dataI khi thoa man dieu kien if 25. dataQ=[dataQ 0*ones(1,3*Tb)];%gan ma tran dataQ khi thoa man dieu kien if 26. end %ket thuc leh if dau tien
GVHD: Th.s Vo Trng Sn SVTH: Nguyn Vn Sn

M PHONG MAY PHAT VI BA S BNG MATLAB

27. if bit1(k)==0&& bit2(k)==0&&bit3(k)==1;%kiem tra phan tu nhi phan thu k trong tung nhanh 28. dataI=[dataI 1*sqrt(2)/2*ones(1,3*Tb)];%gan ma tran dataI khi thoa man dieu kien if 29. dataQ=[dataQ 1*sqrt(2)/2*ones(1,3*Tb)];%gan ma tran dataQ khi thoa man dieu kien if 30. end %ket thuc leh if thu 2 31. if bit1(k)==0&& bit2(k)==1&& bit3(k)==0 %kiem tra phan tu nhi phan thu k trong tung nhanh 32. dataI=[dataI 0*ones(1,3*Tb)];%gan ma tran dataI khi thoa man dieu kien if 33. dataQ=[dataQ 1*ones(1,3*Tb)];%gan ma tran dataQ khi thoa man dieu kien if 34. end%ket thuc leh if thu 3 35. if bit1(k)==0&&bit2(k)==1&&bit3(k)==1%kiem tra phan tu nhi phan thu k trong tung nhanh 36. dataI=[dataI -1*sqrt(2)/2*ones(1,3*Tb)]%gan ma tran dataI khi thoa man dieu kien if 37. dataQ=[dataQ 1*sqrt(2)/2*ones(1,3*Tb)];%gan ma tran dataQ khi thoa man dieu kien if 38. end%ket thuc leh if thu 4 39. if bit1(k)==1&&bit2(k)==0&&bit3(k)==0%kiem tra phan tu nhi phan thu k trong tung nhanh 40. dataI=[dataI -1*ones(1,3*Tb)]%gan ma tran dataI khi thoa man dieu kien if 41. dataQ=[dataQ 0*ones(1,3*Tb)];%gan ma tran dataQ khi thoa man dieu kien if 42. end%ket thuc leh if thu 5 43. if bit1(k)==1&&bit2(k)==0&&bit3(k)==1%kiem tra phan tu nhi phan thu k trong tung nhanh 44. dataI=[dataI -1*sqrt(2)/2*ones(1,3*Tb)];%gan ma tran dataI khi thoa man dieu kien if 45. dataQ=[dataQ -1*sqrt(2)/2*ones(1,3*Tb)];%gan ma tran dataQ khi thoa man dieu kien if 46. end%ket thuc leh if thu 6 47. if bit1(k)==1 && bit2(k)==1&&bit3(k)==0%kiem tra phan tu nhi phan thu k trong tung nhanh 48. dataI=[dataI 0*ones(1,3*Tb)];%gan ma tran dataI khi thoa man dieu kien if
GVHD: Th.s Vo Trng Sn SVTH: Nguyn Vn Sn

M PHONG MAY PHAT VI BA S BNG MATLAB

49. dataQ=[dataQ -1*ones(1,3*Tb)];%gan ma tran dataQ khi thoa man dieu kien if 50. end%ket thuc leh if thu 7 51. if bit1(k)==1&& bit2(k)==1&&bit3(k)==1%kiem tra phan tu nhi phan thu k trong tung nhanh 52. dataI=[dataI 1*sqrt(2)/2*ones(1,3*Tb)];%gan ma tran dataI khi thoa man dieu kien if 53. dataQ=[dataQ -1*sqrt(2)/2*ones(1,3*Tb)];%gan ma tran dataQ khi thoa man dieu kien if 54. end%ket thuc leh if thu 8 55.

%****************************************

end%ket thuc vong lap for

56. fb=8.48*10^6;% toc do luong E2 57. fc=220*10^6; %tan so IF 58. fc1=1.5*10^9;% tan so RF 59. T=24/fb; %Quang thoi gian tinh 60. somau=length(data);%do dai cua data 61. Tm=T/somau;% buoc nhay 62. t=[0:Tm:T-Tm];%ma tran thoi gian(tao xung nhi phan) 63. A=1;%bien do 64. sm1=A*cos(2*pi*fc*t);%song mang nhanh I 65. sm2=A*sin(2*pi*fc*t);%song mang nhanh Q 66. sm3=A*sin(2*pi*fc1*t);%song tin hieu tan so RF tron voi song tin hieu 8-psk 67. pskI=dataI.*sm1;% tin hieu dieu che nhanh I 68. pskQ=dataQ.*sm2;% tin hieu dieu che nhanh Q 69. ydc=pskI+pskQ%tin hieu dieu che 8-psk 70. ydc1= ydc.*sm3% tin hieu sau khi tron tan %*******************************************

GVHD: Th.s Vo Trng Sn SVTH: Nguyn Vn Sn

M PHONG MAY PHAT VI BA S BNG MATLAB

% QUA TRINH BIEU DIEN CHUOI NHI PHAN NGAU NHIEN, TIN HIEU DIEU CHE 8-PSK; % TIN HIEU TRON TAN 71. subplot(3,1,1);% cua so do hoa 3 hang, 1 cot, man hinh 1 72. plot(t,data);%ve do thi chuoi nhi phan ngau nhien 73. title(' CHUOI NHI PHAN NGAU NHIEN');%tieu de cho hinh chuoi nhi phan 74. grid on;%hien thi dang luoi cho do thi 1, chuoi nhi phan 75. ylim([-2 4]);% gioi han truc y cua trong do thi 1 76. subplot(3,1,2);% cua so do hoa 3 hang, 1 cot, man hinh 2 77. plot(t,ydc,'g');% lenh ve tin hieu dieu che 8psk 78. title(' TIN HIEU DIEU CHE 8-PSK');% tieu de cho do thi 2 79. grid on;% hien thi dang luoi cho do thi 2 80. ylim([-2 4]);% gioi han truc y o do thi 2 81. subplot(3,1,3);% cua so do hoa 3 hang, 1 cot, man hinh 3 82. plot(t,ydc1,'g');% lenh ve tin hieu tron tan 83. title(' TIN HIEU TRON TAN');% tieu de cho do thi tin hieu tron tan 84. grid on;% hien thi dang luoi cho do thi 3

C. 1)

phn 3: kt qua m phong nh sau:

Tin hiu u vao bao gm: Chui nhi phn ngu nhin 24 bit data Chui nhi phn ngu nhin nhanh I Chui nhi phn ngu nhin nhanh Q

GVHD: Th.s Vo Trng Sn SVTH: Nguyn Vn Sn

M PHONG MAY PHAT VI BA S BNG MATLAB

GVHD: Th.s Vo Trng Sn SVTH: Nguyn Vn Sn

M PHONG MAY PHAT VI BA S BNG MATLAB

2) Tin hiu trung tn bao gm: Tin hiu iu ch IPSk Tin hiu iu ch QPSK Tin hiu iu ch 8-psk Tn s song mang IF= 220(MHZ) 3) Tin hiu cao tn RF = 1.5 (GHZ)

GVHD: Th.s Vo Trng Sn SVTH: Nguyn Vn Sn

M PHONG MAY PHAT VI BA S BNG MATLAB

GVHD: Th.s Vo Trng Sn SVTH: Nguyn Vn Sn