You are on page 1of 61

Mc lc

Chng 1 M u
X l tn hiu s (DSP) l mt trong nhng cng ngh quan trng nht trong thi i hin nay. N thay i cch thc con ngi giao tip, phc v y t, thng mi, vui chi gii tr, du lch Vi DSP vic thc thi cc php ton s hc nhanh lun l mt yu cu bc thit, do vy cc m hnh tnh ton c, tc thp s lin tc b thay th bng nhng chip in t c tc x l cao tng kh nng x l. Yu cu v cc b x l tng nhanh, cng vi s cn nhc v ti chnh, cng nh thch thc ca vic tch hp rt nh, tt c iu u hng ti vic s dng cc cng ngh c th ti cu hnh trong cc h thng DSP phc tp. K thut x l tn hiu s m rng kh nng cc h thng vin thng s bng cch cho php s dng cc k thut iu ch, gii iu ch phc tp. Ban u, mch tch hp cho nhng ng dng c bit (ASIC) c s dng thc hin iu ny, nhng ASIC phi chu mt chi ph ln l chi ph khng thay i c thit b (NRE) trong thit k v sn xut, hn na, ASIC khng th thay i c. Do , nu cn thay i ASIC li phi
1

chu mt chi ph NRE ln. Trong khi FPGA (Field Programmable Gate Array) c th d dng cu hnh li m khng phi thay th hay sn xut linh kin mi. iu ny s cho chi ph NRE ca FPGA thp hn nhiu so vi ASIC. Do vy trc khi sn xut ASIC, FPGA c s dng th nghim cu hnh thit k. Ngoi ra, vi cc ng dng s lng nh, FPGA s c s dng trc tip iu khin h thng. Mt chip FPGA bao gm cc khi logic kh trnh cho php FPGA kt ni cc linh kin khc trong mch, cc khi logic c kt ni vi nhau bi chc nng kt ni kh trnh. Bng vic kt ni cc u vo, ra ca cc khi logic, cc chn kh trnh, FPGA c th cu hnh thc thi bt k s hot ng logic s no. FPGA c cu hnh s dng mt ngn ng miu t phn cng (HDL) nh Verilog hoc VHDL[1] (Very high speed integrated circuit Hardware Description Language). Verilog v VHDL khc vi cc ngn ng lp trnh tiu biu nh C bi n trc tip hay gin tip nh ngha cch b tr mch in trong khi C nh ngha mt chui cc hot ng c thc thi. iu ny to ra s chuyn i d dng t cc khi d liu thnh cc khi logic trong FPGA. Hn na, cc khi chc nng trong mt thit k c th d dng nh x ti cc khu vc ring bit trong FPGA [2, 3]. FPGA (Field Programme Gates Array) t n nh cao ca thnh cng trong nhiu h thng x l tn hiu. c bit, trong lnh vc vin thng s. Phi hp kh nng hot ng tc cao vi cc b nh c bng thng vo ra khng l, nn tng x l tn hiu trn FPGA c th phc v nhiu cng vic phc tp trong cc b truyn thng pht v thu hin i. Ngy nay, s pht trin ca mng d liu khng dy bng rng cn tng cng s dng cc phng php iu ch c hiu qu cao trong QAM (Quandrature Amplitude Modulation) c coi nh mt cng on khng th thiu tng hiu qu knh truyn v gip cho d liu c c
2

thng lng cc i. Tuy nhin, iu ch QAM cao cp rt nhy cm vi trng thi ca knh truyn khng dy v thng lng c th gim nghim trng do t l li bit cao (BER) hay do vic truyn li thng tin. Nhng h thng ny c nhiu mt hn ch bi cc modem bn ngoi i hi h tr c nhiu chm sao khc nhau. Vt qua s tr ngi vi cc chm sao QAM bc cao, cc chun bng thng rng nh IEEE 802.16 [4, 5] s dng MQAM (Mutilevel QAM) hn ch s suy gim thng lng bng cc bc iu ch QAM thch hp duy tr mt t l li gi tin chp nhn c trong tnh trng knh truyn thay i. Cc chun v h thng mi hn ny s dng cc chm sao QAM khc nhau cho nhng cng vic khc nhau ty thuc cc trng thi knh ca n. Ngoi ra, chng cng thay i cc chm sao thy thuc vo trng thi knh truyn theo thi gian. Trong kha lun, ti xy dng mt b iu ch v gii iu ch tn hiu QAM-16. B pht c th pht QAM-16 trn cc bng tn s c th iu chnh c trong mt di nht nh. c th thit k c b iu ch, chng ti s dng ngn ng thit k phn cng VHDL lp trnh v sau nhng ln hai chip FPGA APEX II[6] v Cyclone II[7].

Chng 2
3

Kin thc c s
2.1 iu ch v l thuyt modem 2.1.1 iu ch iu ch l qu trnh m ha thng tin t tn hiu ngun ln sng mang trong mt di tn s nht nh [8]. Thng tin c th c m ha bng vic thay i bin , pha hoc c hai. Mt tn hiu thng di s(t) iu ch c th c biu din: s(t) = A(t)cos(2 fct+(t)) (2.1)

Vi A(t) l bin iu ch, (t) l pha v fc l tn s sng mang. Thng tin c truyn i bng cch thay i bin v pha ca sng mang. iu ch c th l tng t hoc s. Trong truyn thng tng t, bin v pha ca tn hiu bin i lin lc trong min thi gian ng vi s thay i ca thng tin n mang theo. Trong truyn thng s, L k hiu c nh x thnh L dng sng lin tc theo thi gian. Sau , dng sng ny s c s dng iu ch bin v pha sng mang vi mt t l k hiu nht nh Rs. Vi d liu l s nh phn th chng c nhm li thnh N bit t ri chuyn thnh L=2N dng sng. Dng iu ch s n gin nht l iu ch bin xung ri rc (PAM). Mt nhm nht nh cc dng sng c s dng chnh l cc xung vung c rng bng vi chu k ca k hiu. Bin ca cc dng sng ny c cho bi:

A = 2l - (L-1)

(2.2)

Vi A l bin xung v l = 0,1...L-1. Bin ca xung c th c m t trong gin chm sao (Hnh 2.1). Gin ny biu din bin ca cc k hiu trong "mt phng iu ch".

Hnh 2.1: Gin chm sao ca tn hiu PAM ng bao ca sng iu ch c th d dng nhn thy trong min thi gian (Hnh 2.2)

Hnh 2.2: ng bao trong min thi gian ca tn hiu PAM Tn hiu vi ng bao nh Hnh 2.2 c bng thng tn hiu rt rng bi dng vung ca xung truyn. s dng ph mt cch hiu qu, u ra ca b pht thng c lc gii hn bng thng ca tn hiu pht. Trong truyn thng khng dy, rng ca b lc pht (bng tn) phi tun theo cc quy nh nht nh c th d dng iu chnh, qun l chng trong gii hn cho php ca h thng. Ngoi ra, tn hiu thu c cng b lc ngay ti li vo loi b cc tp nhiu i theo tn hiu.

Hiu nng ph l thc o kim tra xem mt phng php iu ch c th truyn bao nhiu d liu trong mt bng thng cho trc [26]. Hiu nng ca ph s c cho bi cng thc:

s= R

(2.3)

Vi Rb l tc bit c xc nh bng s bit trong mt giy cn B l bng thng c n v l Hertz. Do , t bng thng tn hiu v hiu nng ph, ta c th xc nh c tc d liu ti a ca mt h thng cho trc. 2.1.2 iu ch QAM c c hiu nng ph cao hn (to thng lng cao hn cho d liu) iu ch QAM c s dng thay i bin v pha ca tn hiu thng di. iu ch QAM l mt k thut iu ch chuyn ti d liu bng cch tnh tng s thay i bin ca hai sng mang. Sng mang c s dng thng c dng hnh sin, lch pha nhau 90 , sng c cng pha vi tn hiu c gi l sng ng pha, v sng lch pha vi tn hiu c gi l sng vung pha. Xt tn hiu thng di trong phng trnh 2.1: s(t) = A(t)cos(2 fct+(t)) (2.1)

Tng ca hai tn hiu vung pha c th c biu din bng Phng trnh ton hc ca bin v pha tn hiu iu ch nh trong Phng trnh 2.1. u tin, Phng trnh 2.1 c vit li thnh Phng trnh 2.2 bng lng gic: s(t) = A(t)[cos((t))cos(2 fct) - sin((t))sin(2 fct)] (2.4)

Sau , Phng trnh 2.2 c bn i thnh Phng trnh 2.3:

s(t) = AI(t)cos(2 fct) - AQ(t)sin(2 fct)

(2.5)

Vi tn hiu iu ch: AI(t)=A(t)cos((t)) v AQ(t)=A(t)sin((t)) (2.6) Khi N - s lng bit trong mt t - l chn th c tn hiu ng pha v vung pha c iu ch vi mt trong s L=2N/2 bc bin . y, L bng vi cn bc hai ca tt c cc s ca k hiu trong chm sao, M [8]. Cc bc bin ca tn hiu I, Q c biu din trong gin chm sao Hnh 1. Trong trng hp ny, Gin sao biu din bin v pha ca sng mang c nh x trong mt phng phc.

Hnh 2.3: Chm sao ca mt tn hiu QAM-16 Ta nhn thy, chm sao c phn b da trn m Gray (cc im sao ln cn nhau u c t nht mt bit khc nhau). Phn b m Gray ny c ngha rt ln v hu ht cc loi li thng thng xy ra do k hiu c tm ra ging vi k hiu gn . Trong trng hp ny, s m Gray ch dn n mt bit li trong khi s m nh phn c th gy ra nhiu bit li. Khng phi mi chm sao QAM u vung. Nu N l th mt chm sao hnh ch nht c to ra, khi (N+1)/2 bit c s dng iu ch mt tn hiu v (N-1)/2 bit cn li c dng iu ch tn hiu vung pha vi tn hiu . chnh l mt chm sao QAM khng vung khi cc knh I, Q khng c iu ch c lp.

(a) Hnh 2.4a: Gin chm sao QAM-8 hnh ch nht Hnh 2.4b: Gin chm sao QAM-8 hnh trn

(b)

Trong cc loi gin chm sao th gin chm sao hnh trn c cng sut trung bnh thp nht. Tuy nhin gin vung li c s dng rng ri nht v tuy n c cng sut trung bnh ln hn nhng li c th thc hin d dng hn. Xt bn chm sao QAM-4, QAM-16, QAM-64, QAM-256 c biu din tng ng cc Hnh 2.5a,b,c,d

Hnh 2.5: Cc chm sao QAM nhy ca chm sao vi cc nhiu c biu din bi khong cch gia cc im sao. Nhn vo Hnh 2.5 ta nhn thy, im xa nht cc chm sao u c cng bin , khong cch gia cc im chm sao ln cn gim khi kch thc chm sao tng. iu ny lm chm sao c kch thc ln nh QAM-256 d b nhiu hn nhiu so vi cc chm sao c kch thc nh nh QAM-4. Hnh 2.6 ch ra kt qu l thuyt BER cho iu ch QAM [9, 10, 11]. th biu din BER tng i cho mi chm sao QAM nh mt hm ca SNR mi bit v l SNR b chia bi s bit trong mi k hiu. Bng ny chng minh nhng nhn xt v Hnh 2.6 l chnh xc v ch r ra rng t l SNR s thay i khi chm sao thay i.

Hnh 2.6: BER cho QAM S khi ca b iu ch QAM:


I I(t)

D liu Tch I,Q Dch pha 90 Q

B To Sng Sin

Tn hiu QAM

Q(t)

Hnh 2.7: B iu ch QAM D liu s a vo s c tch ra I, Q theo gin chm sao v cc knh I,Q s c nhn vi cc sng mang lch pha nhau 90 to ra cc tn hiu I(t), Q(t) tng ng vi cc tn hiu A I(t) v AQ(t) nh m t cc phng trnh ton hc trn. Hai tn hiu ny s c a vo b tnh tng to ra tn hiu QAM pht ra. 2.1.3 B pht QAM s

10

Cu trc ca mt b pht QAM s tiu biu c xy dng bng cc phn t logic s c biu din Hnh 2.15. B pht bao gm hai nhnh: mt nhnh l knh ng pha (I), mt l knh vung pha (Q). Ta s xem xt s bin i d liu ti tng khi hiu c cc chc nng ca tng thnh phn b pht.

Hnh 2.8: B pht QAM s Khi chuyn i t ni tip ra song song phn d liu ni tip thnh cc nhm N/2 bit mt k hiu. y, tc k hiu Rs bng 1/N ln tc bit Rb. Sau , nhm N/2 bit c chuyn vo khi gii m Gray sang nh phn vi tc bng tc k hiu. . Cc nhm N/2 bit c a vo cc knh I v knh Q ti cc khi gii m Gray sang nh phn ri s dng m Gray tm v tr cc knh I v Q cho mi im chm sao. Hnh 2.9 ch ra s lng m Gray hai bit c s dng biu din cc v tr knh I, Q ca im trong chm sao QAM-16. Tuy m Gray rt hiu qu trong vic hn ch li bit nhng hu ht cc h thng s hot ng bng m nh phn nn khi gii m Gray sang nh phn c s dng chuyn s m Gray sang s m nh phn.

11

Hnh 2.9: M Gray Cc khi nh x biu tng chuyn i kt qu m nh phn t cc khi gii m Gray sang nh phn sang cc cp pht m nh phn bng Phng trnh 2.7. m0 = 2mi (2N/2 - 1) (2.7)

Vi m0 l gi tr nh x, mi l u vo ca cc b nh x Nu bc to ra t cc b nh x biu tng c s dng to ra xung vung, cng sut ca tn hiu s tri rng dc theo mt vng bng thng rng ln. Do , cc gi tr nh x c lc bi b lc RRC gii hn bng thng ca tn hiu pht. Tn hiu c lc dng iu ch vi cc sng mang vung pha trong khi iu ch cu phng. S hot ng ca khi iu ch cu phng c biu din ton hc trong phng trnh 2.5. Tn hiu iu ch sau c chuyn t cc t s sang tn hiu tng t pht i. 2.1.4 B thu QAM s

12

Cu trc ca b thu QAM s tiu biu c thc hin bng cc phn t logic s nh hnh 2.10. Ta s xem xt s bin i d liu ti tng khi hiu c cc chc nng ca tng thnh phn b thu.

Hnh 2.10: B thu QAM s Khi AGC (Automatic Gain Control) cn bng tn hiu thu c b thu c th hot ng vi cc tn hiu c bin khng i. iu ny c bit quan trng i vi cc knh radio v trong mi trng khng dy, s suy gim ca knh truyn thay i lin tc theo thi gian. Khi chuyn i tng t sang s (A/D) s ly mu tn hiu thu c khi c tc ng bi khi khi phc xung nhp. Khi khi phc xung nhp iu khin b chuyn i A/D ly mt lng mu nht nh mi k hiu. S lng mu mi k hiu c xc nh bi cu trc ca b lc RRC. Hn na, cc mu u gi khong cch cn bng vi mt mu chun tm chu k k hiu. Chng 5 s miu t chi tit ca s cn thit ca vic khi phc nhp k hiu v l thuyt khi phc nhp k hiu. Khi gii iu ch cu phng tin hnh gii iu ch tn hiu nhn c s(t) to ra AI (t) v AQ (t) xp x bng AI(t) v AQ(t). Qu trnh gii iu ch gm hai bc. Bc 1 l nhn tn hiu nhn c vi cc sng
13

sin v cos c pha ph hp vi tn hiu nhn c. Bc tip theo l tin hnh b lc thng thp lc kt qu nh phng trnh 2.8 ti 2.17, vi LPF {.} biu din b lc thng thp. AI(t)=LPF{s(t)*2cos(2 fct)} AI(t)=LPF{[AI(t)cos(2 fct) - AQ(t)sin(2 fct)]*2cos(2 fct)} AI(t)=LPF{AI(t)[1+cos(4 fct)] - AQ(t)[sin(4 fct)]} AI(t)=LPF{ AI(t) + AI(t)cos(4 fct) - AQ(t)sin(4 fct)} AI(t) = AI(t) AQ(t)=LPF{s(t)*[-2sin(2 fct)]} AQ(t)=LPF{[AI(t)cos(2 fct) - AQ(t)sin(2 fct)]*[-2sin(2 fct)]} AQ(t)=LPF{-AI(t)[sin(4 fct)] + AQ(t)[1-cos(4 fct)]} AQ(t)=LPF{-AI(t)sin(4 fct) + AQ(t) - AQ(t)cos(4 fct)} AQ(t) = AQ(t) (2.8) (2.9) (2.10) (2.11) (2.12) (2.13) (2.14) (2.15) (2.16) (2.17)

Mi lin h gia sng sin v cos c s dng cho b gii iu ch vung pha c to ra nh khi khi phc sng. Chng 6 s miu t chi tit v b gii iu ch v l thuyt khi phc sng mang. Khi RRC (Raise Root Cosin) lc u ra ca b gii iu ch vung pha kh nhiu, giao thoa v ISI. Sau , cc khi gii nh x k hiu, gii m Gray v chuyn i song song sang ni tip lm ngc li cc khi nh x biu tng, m ha Gray v ni tip sang song song b pht khi phc li d liu ban u. 2.2 FPGA FPGA l mt loi thit b logic kh trnh. Vi mt chip FPGA chng ta c th tin hnh lp trnh cc kt ni cho cc ng dng c th (nh card m thanh, video, b vi x l 8 bit, 16 bit, hay l bt c mt chip kh trnh no nh 8051 chng hn) m khng phi tn hng ngn cho chi ph

14

sn xut. FPGA l chip dnh cho ngui dng pht trin cc h thng bng phn mm sau khi IC ch to. FPGA l vit tt ca Field Programmable Gate Array, vy Field Programmable y chng ta c th hiu nh th no. iu ny c th hiu l chc nng ca FPGA c quyt nh nhiu bi ngi lp trnh hn l bi nh sn xut. Cc mch tch hp thng thng th chc nng ca n c xc nh bi ngi sn xut. Ngc li, chc nng ca FPGA li c xc nh bi ngi dng bng chnh chng trnh m h vit ra. Trc khi c s pht trin ca logic kh trnh, th cc mch logic thng thng c xy dng trn mc bo mch vi cc linh kin thng thng, hoc vi mc cng cho cc ng dng m rng, FPGA l mt mch tch hp cha rt nhiu t bo logic (logic cell), c th xem nh l cc linh kin chun. Cc logic cell c lp vi nhau trong cc thit k mang tnh c nhn. Cc cell tch bit vi nhau c kt ni trong vi nhau bi ma trn dy v chuyn mch. Khi thit k cc hm logic n gin cho mi cell, ngi dng thc hin bng cch iu khin cc chuyn mch trong ma trn kt ni trong. Mt mng cc cell v cc kt ni to nn nhng khi kt ni c bn cho mch. Mt thit k phc tp l s kt ni ca cc khi trn, to nn mch mong mun. Nh nu qua trn, c th hnh dung c cu trc ca FPGA mt cch c bn nht phi cha ba thnh phn: Logic cells Interconnection I/O blocks

15

Hnh 2.11: Cu trc c bn ca FPGA

Logic cell: l ni thc hin cc tnh ton, lu tr thng tin, n l thnh phn quan trng nht trong FPGA. S logic cell thay i theo tng h linh kin. T hp logic ca cell theo quy lut t nhin c th thc hin c nh mt bng kha b nh nh LUT hoc nh l mt thit lp ca nhiu cng AND. M hnh LUT dn ti bit c th linh ng hn v cung cp nhiu li vo hn so vi m hnh kt hp nhiu cng AND trong cng iu kin v tr. I/O blocks: Cung cp cc giao tip vi bn ngoi. Interconnection: L ma trn hng v ct thc hin kt ni bn trong gia cc cell vi nhau, v gia khi I/O v Cell.

Trn th trng hin nay c rt nhiu nh cung cp linh kin FPGA nhng Altera v Xilinx l hai nh cung cp ph bin nht i vi th trng trong nc. Chng ta c th t mua trc tip qua mng hoc qua cng ty

16

i din ti Vit Nam, ngoi ra cng c th mua c mt s linh kin ti mt s ca hng trn a bn H Ni. Cc linh kin ca cc hng khc nhau c nhng cu trc khc nhau, trong mt hng cc h khc nhau cng c thit k vi cc cu trc khc nhau. Mi h u c nhng c tnh ring ca n. Trong ti ny ti la chn chp APEX EP20K200EQC208 (thuc h APEX20K) ca Altera bi tnh ph hp ca n i vi yu cu ca ti v s n nh cao trong linh kin ca hng Altera. Tnh nng S cng ti a 113000 162000 263000 263000 404000 526000 526000 728000 105200 0 105200 0 153700 0 177200 0 239200 0 S cng tiu chun 30000 60000 100000 100000 160000 200000 200000 300000 400000 400000 600000 100000 0 150000 0 LE (Logic Element ) 1200 2560 4160 4160 6400 8320 8320 11520 16640 16640 24320 38400 51840 ESB (Embedde d System Block) 12 16 26 26 40 52 52 72 104 104 152 160 216 S bit RAM ti a 24576 32768 53248 53248 81920 10649 6 10649 6 14745 6 21299 2 21299 2 31129 6 32768 0 44236 8 S I/O macrocel Num l ti a Max 192 256 416 416 640 832 832 1152 1664 1664 2432 2560 3456 128 196 252 246 316 382 376 408 502 488 588 708 808

EP20K30E EP20K60E EP20K100 EP20K100E EP20K160E EP20K200 EP20K200E EP20K300E EP20K400 EP20K400E EP20K600E EP20K1000E EP20K1500E

Hnh 2.12: Mt s thng s c bn ca APEX EP20K


17

APEX20K cha cc khi chnh sau: LUT-based logic, Product-Termbased logic, v b nh. Cc tn hiu c trao i bn trong nh kt ni trong FastTrack (mt ma trn dy lin tc gm hng v ct chy dc theo chiu ngang v dc ca thit b). Mi chn li vo c ch dn bi mt IOE (I/O Element) t u cui ca mi hng v ct ca kt ni trong FastTrack. Mi IOE cha mt b m hai hng vo ra, mt thanh ghi c s dng nh l thanh ghi li vo, li ra hoc hai hng ca tn hiu. Khi s dng cc chn clock chuyn dng th thanh ghi ny cung cp cho cc thc thi c bit.

Hnh 2.13: S khi thit b APEX 20K Cc chp trong h EP20K c thit k vi mt chui kin trc MegaLAB. Mt MegaLAB bao gm 16 LAB, mt ESB v mt kt ni trong MegaLAB. Cc i cao hn trong EP20K c th c nhiu LAB hn trong mt MegaLAB, tn hiu lin kt gia MegaLAB v cc chn vo ra uc thc hin bi kt ni ni FastTrack.

18

Hnh 2.14: Cu trc ca MegaLAB Nh trn chng ta thy mt LAB gm 10 LE, cc b kt ni trong cc b ca MegaLAB, v cc tn hiu iu khin LAB. LE l n v logic nh nht trong kin trc ca EP20K, mi LE cha 4 li vo LUT c chc nng thc hin nhanh chng bt c vai tr no ca 4 bin, LE c th dng iu khin cc kt ni cc b, kt ni MegaLAB hoc kt ni FastTrack.

19

Chng 3: B iu ch QAM
3.1 Tng quan T nhng kin thc c bn c c, trong chng ny, ti tin hnh xy dng mt b iu ch QAM-16 trn FPGA bng ngn ng thit k phn cng VHDL. D liu li vo c ly song song t Kit pht d liu mt cch ng b cn tn s k hiu c th thay i trong mt phm vi nht nh. Ton b qu trnh c thc hin vi tn hiu dng s. Sau khi qu trnh x l s c tin hnh, d liu QAM s s c a ra DAC c th quan st c trn dao ng k. 3.2 B iu ch QAM 3.2.1 Nguyn tc thc hin:
Pht lp d liu M ha QAM Khi iu ch QAM Thay i tn s k hiu Pht sin DAC Tn hiu QAM

Hnh 3.1: S khi h thng B iu ch c xy dng vi s khi nh trn gm: - Khi lp pht d liu to d liu s a vo b iu ch

20

- Khi thay i tn s k hiu gm cc phm tng gim tn s thay i tn s trong mt di nht nh t fc n 10fc. - Khi iu ch QAM: gm cc khi nh nh khi pht sng mang to tn hiu sin, cos s a vo iu ch, khi m ha QAM tnh ton biu thc QAM vi d liu nhn c v khi bin i DAC chuyn i s-tng t nhm to ra tn hiu QAM c th quan st trn dao ng k. 3.2.2 M hnh b iu ch QAM xy dng: Qu trnh thc hin c tin hnh trn 2 Kit vi 2 chip FPGA l APEX II v Cyclone II[3] ca Altera vi s khi nh sau:
Clock 50M

Cyclone II Pht lp d liu

SPI

B to APEX II sng mang Quay 90 Thay i tn s

DAC

Pht gi d liu

Clock 11M

Hnh 3.2: M hnh QAM-16 c thit lp 3.2.2.1 Khi pht lp d liu: S dng Kit DE2 ca phng th nghim, pht 16 tn hiu chn bit c th thay i c bng 16 cng tc gt bn ngoi, trng thi cc bit ca cng tc u c hin th trn led.

21

16 bit trng thi ca cng tc c phn thnh 4 nhm: A,B,C,D nh Hnh 9. Mi nhm cha 4 bit s to thnh mt im chm sao. im chm sao ny s c tch ra, ri a vo cc knh I,Q, mi knh 2 bit (Hnh 10). Cc knh I,Q ny s c a sang chip APEX II nh x vo trng d liu bng phng php truyn thng SPI.

B15

B14

B13

B12

B11

B10

B9

B8

Nhm D

Nhm C

B7

B6

B5

B4

B3

B2

B1

B0

Nhm B

Nhm A

Hnh 3.3: Cc nhm bit trng thi ca cng tc

B3 Q

B2

B1 I

B0

Hnh 3.4: Tch bit I,Q 3.2.2.2 Truyn thng ni tip SPI: Truyn thng gia hai chip s dng k thut truyn thng SPI c bt tay. Trong phng php ny, Cyclone II s kim tra chn vo Sync ca mnh, ti khi chn ny nhn c mt sn xung (m hoc dng) t APEX II thng bo sn sng nhn (RR) th Cyclone II s truyn cc bit I,Q ln lt ca cc nhm A,B,C,D sang cho APEX II ri i tn hiu RR tip theo.

22

Truyn thng SPI va to ra s ng b gia hai loi chip FPGA hot ng trong chu k xung nhp khc nhau va to ra s c lp tng i gia hai khi chn d liu v iu ch. Nh c truyn thng SPI, tn s sng mang c th d dng thay i m vn gi c s ng b vi khi nh x k hiu. Ngc li, ta c th to ra cc chm sao cp cao hn, c s bit ln hn a sang iu ch m ko gy ra nhiu thay i cho khi iu ch.

RR

Ready

Sync

D liu

I Q

Hnh 3.5: Truyn thng ni tip SPI 3.2.2.3 B to sng mang: Nhm mc ch to tn hiu sin chun a vo iu ch. Do d liu sin s c xut ra t phn mm PASCAL, m phn mm ny ly mu tn hiu sin u nn nu ly mu c mt chu k sin x l a ra DAC th tn hiu quan st c s c dng hnh tam gic, khng c cong ca tn hiu sin. khc phc nhc im ny, chng ti tin hnh xut ra 630 mu ca mt phn t chu k sin ri lp trnh hiu chnh li trn FPGA to ra mt chu k sin vi 2520 mu. Nguyn tc hiu chnh c m t Hnh 11:

23

Hnh 3.6: Hiu chnh sin Do sng cc mu ly t tn hiu sin trong PASCAL u c gi tr nh hn 1 nn phi tin hnh nhn cc tn hiu vi mt h s thch hp tng bin sng mang. 3.2.2.4 B thay i tn s sng mang: Nhn tn hiu t hai nt iu khin tng gim tn s c th thay i tn s trong di t fc n 10fc. B thay i tn s ny tc ng trc tip vo b pht sng mang thay i tn s cc sng sin, cos c to ra. Nguyn tc lm vic ca b thay i tn s l tng/gim s mu trong mt chu k sng mang thay i tn s (Hnh 12). Nguyn tc ca b thay i tn s sng mang ny ging vi cc b ly mu tng, gim.
Gim Tng

Hnh 3.7: B thay i tn s sng mang D thy trong QAM, khi tn s sng mang thay i s lm thay i tn s k hiu, s nh hng n khi pht lp k hiu nh x ln trng d liu. Tuy nhin, trong b pht QAM chng ti xy dng, nh tnh u vit ca truyn thng ni tip SPI c bt tay nh ni trn, tn s sng mang cng nh k hiu c th thay i d dng m khng nh hng g khi pht lp d liu to k hiu. 3.2.2.5 B quay 90 : Sng mang s hnh sin a vo y s c lm tr i 630 mu (1/4 chu k) to ra sng mang hnh cos (lch pha 90 vi sng mang hnh sin). S ca b quay:
24

Tr chu k

Hnh 3.8: B quay pha 90 3.2.2.6 B nhn s: B nhn s nhn sng mang vi d liu ca knh I hoc Q m k hiu nh x n to ra tn hiu AQ(n) v AI(n) nh phng trnh 1.4. B nhn s c dng nh sau:

AI(n)

AQ(n)

(a)

(b)

Hnh 3.9: B nhn s B nhn s thc hin php nhn d liu s ca knh I vi 2520 mu ca sng mang hnh sin v d liu knh Q vi 2520 mu ca sng mang hnh cos ri a kt qu ra b cng. 3.2.2.7 B cng s: B cng s thc hin php cng s hc cc d liu va c tnh ton b nhn kt hp cc tn hiu cc knh I,Q to ra tn hiu QAM. Ngoi ra, khi sau khi cng cc tn hiu I,Q do sng mang c dng hnh sin nn cha c thnh phn m, dng trong khi b bin i DAC bn ngoi ch nhn ng cc s dng nn phi nng thnh phn mt chiu ca tn hiu QAM s ln bng cch cng vo n mt hng s khng i. Tn hiu QAM s sau s c a vo b chuyn i DAC to ra tn hiu QAM quan st c trn dao ng k.
AI(n) 25

Hng s AQ(n)

QAM

Hnh 3.10: B cng s 3.3 Kt qu - Ti thc hin pht thnh cng tn hiu QAM trn chip FPGA APEX II vi cc bit thng tin c th thay i c bng cng tc. - Tn s sng mang cng nh k hiu c th thay i trong mt di nht nh - Kt qu u ra c th quan st d dng trn dao ng k.

26

Chng 4: X l du phy ng
4.1. Chun du phy ng IEEE: thun li cho vic tnh ton cc s nh phn ln, cng ng cc k s in-in t(IEEE) nghin cu v a ra chun IEEE 754 x l du phy ng nh phn. Theo chun ny th khung din t mt du phy ng phi c kch thc chun l 32 bit ( chnh xc n) v 64 bit ( chnh xc kp). Trong ti ny, chng ti xy dng h thng x l du phy ng theo chun 32 bit. Nh trong hnh v, khung 32 bit c chia thnh ba nhm ring bit: cc bit thp t bit0 n bit22 dng xc nh phn nh tr(mantissa), cc bit t 23 n 30 xc nh s m, cn bit 31 l bit du.

Bit du

Phn m

Phn nh tr

Hnh 4.1: Chun phy ng 32 bit ca IEEE Gi s thp phn c hnh thnh t chun du phy ng ny l V, ta c biu thc: V = (-1)S * M * 2E 127

27

Vi (-1)S biu th bit du (bit31: bit c trng s ln nht trong khung). Ta d dng nhn thy biu thc ny s biu din s dng nu S=0 v ngc li, s biu din s m khi S=1. Nhn vo hnh v ta thy, 8 bit t bit 23 n bit 30 biu din s m E, nh vy, E c th thay i t 0 n 255. Sau khi tr s m cho 127 theo ng chun th s cho php s m chy t 2-127 n 2128. Cc bit cn li biu th phn nh tr M, phn nh tr c hnh thnh t 23 bit biu din mt phn s di dng nh phn. V d: vi s nh phn 1,0101; c th khai trin thnh 1 + 0/2 + + 0/8 + 1/16. Du phy ng khi biu din cc phn s cng c chun ha nh vy. Ch c duy nht mt k t khc khng bn tri du phy ng, s trong h 2 hin nhin l 1. Do vy, bit ng u phn nh tr c mc nh l 1, v bit c lu tr trong khung. Gi s m22, m21, . m0 biu th 23 bit trong khung chun ca IEEE th s nh tr M c hiu l: M = 1.m22.m21m0. Biu din thp phn ca M l: M = 1 + m22 * 2-1 + m21 * 2-2 + m20 * 2-3 + i vi cc khung nh phn biu din du phy ng, 0 l mt s c bit, s 0 c ton b phn nh tr v s m bng 0 v bit du c th l 1 hoc 0. Bng di y s cho chng ta hiu hn v cch tnh du phy ng v cc gii hn ca n.

28

Hnh 4.2: Mt s gi tr phy ng 4.2 Mt s ngoi l trong tnh ton du phy ng Chun IEEE nh ngha nm ngoi l m mi khi chng khi to s c bo hiu bng mt c trng thi. 4.2.1 Ngoi l php ton sai Mt vi php ton s hc khng ng nh chia cho 0 hay cn bc hai ca mt s m. Kt qu ca mt php ton sai c gi l NaN. C hai loi NaN: NaN tnh (QNaN) v NaN bo hiu (SNaN) c dng nh sau (s l bit du): QNaN = s 11111111 10000000000000000000000 SNaN = s 11111111 00000000000000000000001.

29

Kt qu ca mi php ton sai s l mt chui QNaN vi ngoi l l QNaN hoc SNaN. Cn SNaN s ch bo hiu mi khi mt ton hng u vo l mt chui SNaN. Cc php ton s hc sau y l php ton sai nn s cho kt qu l mt chui QNaN v bo hiu mt ngoi l QNaN. - Bt k php ton no vi mt NaN - Cng hoc tr: + ( ) - Php nhn: 0 ( ) - Php chia: 0 / 0 hoc / - Cn bc hai: Vi cc ton hng nh hn 0. 4.2.2 Ngoi l chia cho 0: Php chia ca bt k s no cho 0 u cho mt kt qu khng xc nh hay thm ch ngay trong vic cng hoc nhn ca hai s cng c th to ra kt qu khng th xc nh. c th phn bit c hai trng hp , mt ngoi l chia cho 0 phi c thc hin. 4.2.3 Ngoi l tnh ton khng ng Ngoi l ny s bo hiu khi kt qu ca php ton khng tht s chnh xc cho gii hn ca s m v (hay) vng chnh xc. 4.2.4 Ngoi l trn di Ngoi l trn di s c bo khi php tnh c nh hoc khng chnh xc. nh s c pht hin trc hoc sau khi lm trn khi kt qu nm gia 2 Emin . S mt chnh xc c pht hin khi kt qu khng chnh xc hay khi mt mt mt gii chun ha xy ra. Nhn FPU s bo hiu mt ngoi l trn di mi khi nh c pht hin sau khi lm trn, khi , kt qu a ra s khng chnh xc. 4.2.5 Ngoi l trn trn

30

Ngoi l trn trn s c bo mi khi kt qu vt qu gi tr ti a n c th t n do gii hn ca s m. Tuy nhin n s khng bo khi mt ton t khng xc nh do s khng xc nh vn ng. Ngoi ra ngoi l ny cng s khng bo khi chia cho 0. 4.2.6 Ngoi l khng xc nh Ngoi l ny s c bo mi khi kt qu u ra khng xc nh m khng cn quan tm php ton nh th no. Ngoi l ny khng c a thnh chun nhng c dng thm pht hin nhanh hn cc kt qu khng xc nh. 4.2.7 Ngoi l khng Ngoi l ny s bo mi khi kt qu u ra l 0 m khng cn quan tm n php ton din ra nh th no. Ngoi l ny cng khng c a thnh chun nhng c dng thm pht hin kt qu 0 nhanh hn. 4.3 Cc ch lm trn Do kh c th xc nh c kt qu chnh xc, nn ta nhiu lc phi tin hnh lm trn. Trong khi x l ny, ch lm trn gn nht s cho kt qu gn ng nht. Ba bit tm thi c thm vo trong phn s thc l bit bo m, bit lm trn v bit mm. Cc bit bo m v lm trn c s dng lm chun lu tr cn bit mm l 1 khi 1 c dch ra ngoi vng. V d nh ta c 5 bit nh phn: 1.1001. Nu ta dch tri 4 bit ta s c s 0.0001, s ny khng th lm trn c nn kt qu s khng chnh xc. Cn nu ta tin hnh m thm 3 bit th s s l 0.0001 101 (bit cui phi l 1 do 1 c dch ra ngoi). Nu lc ny chng ta lm trn v li 5 bit u th s c: 0.0010, nn kt qu s c chnh xc cao hn.
31

4.3.1 Lm trn n gi tr chn gn nht y cng l gi tr lm trn mc nh chun. Gi tr s c lm trn ln hoc xung n kt qu ng gn nht. Nu s cn lm trn chnh gia hai gi tr nguyn, th s s c lm ln n gi tr nguyn gn nht. V d: S cha lm trn 3.4 5.6 3.5 2.5 4.3.2 Lm trn v 0 Cc s trong ch ny v c bn khng c lm trn, s bit vt qu ngng cho php s b ct i. V d nh 3.47 s b ct thnh 3.4. 4.3.3 Lm trn tng, gim Cc s c t ch lm trn tng s c lm trn hng ti + . V d nh 3.2 s c lm trn ln 4 cn -3.2 s c lm trn thnh -3. Ngc li, ch lm trn gim, cc s s c lm trn hng v . V d nh 3.2 s c lm trn v 3 cn -3.2 s c lm trn thnh -4. 4.4. Cc php ton trn du phy ng Trong phn ny, ti s cp n cc gii thut c s thc hin cc php ton du phy ng trong khi x l du phy ng (FPU). S lm trn 3 6 4 3

32

4.4.1 Php cng v tr Cc php ton cng v tr trn cc s phy ng kh hn nhiu so vi cc s nguyn. Gii thut cng v tr cc s phy ng c biu din trong gin sau: V d sau y s miu t tng bc mt s hot ng ca khi cng/ tr hai s phy ng. Gi s ta mun cng hai s phy ng nh phn 5 bit:
Ton hngA4=1.1001eA & fracA 2 duA & Ton hng2 2=1.0010 eB & fracB duB & + B

------------------------------eA > Sai Bc 1: Ly s m ca s ln hn tr i s m ca s nh hn. eB ? e = 4, eL = eB eL L =2eA eS = 22 nn diff = 4 - 2 = 2 eS = e eS = eA Bc 2: Dch Bphn thp phn ca s c s m nh hn sang bn fracL=fracA fracL=fracB phi diff bit. Lc ny, ta phi tch phn m ra mi c th dch c. fracS=fracB fracS=fracA ng

1.1001 000 + 0.0100 100 ------------------------ diff = eL*eS Bc 3: Sau khi dch v m thm bit, ta tin hnh cng hai phn thp phn vo nhau. dch phi fracS diff 1.1001 000 bit + 0.0100 100 frac ------------------------ 0 = fracS +/- fracL e0 = eL 1.1101 100
Lm trn frac0

Kim tra ngoi l Khng Chun ha 33 Ra = du0 & e0 & frac

Bo hiu ngoi l

Hnh 4.3 Lu gii thut php cng/tr s phy ng Bc 4: Sau khi cng xong phn thp phn, ta tin hnh lm trn n s chn gn nht. V d nh s va c tnh l 1.1101 100 s c lm trn thnh 1.1110 Bc 5: Sau khi tnh ton xong xui, ta ghp phn du v m vo phn thp phn va tnh c ri y kt qu ra u ra. Nh trong v d ny, kt qu s l 2 4 1.1110 4.4.2 Php nhn
34

B nhn trong khi x l phy ng ny s dng kh nng x l song song ca FPGA tit kim xung nhp ng h. Nu c s dng phng php x l ni tip lm b nhn th s mt 32 xung nhp trong khi thc hin x l song song ch cn 5 nhp. Tuy nhin, b nhn x l song song s tn ti nguyn FPGA gp 3 ln khi x l ni tip. Sau y s l lu gii thut ca b nhn du phy ng thc hin trn FPGA.
Ton hngA = duA & eA & fracA Ton hngB = duB & eB & fracB

frac0 = fracA fracB sign0 = signA xor signB

e0 = eA + eB - bias(127)

Lm trn frac0

Kim tra ngoi l Khng Chun ha Ra = du0 & e0 & frac0

Bo hiu ngoi l

Hnh 4.4 Lu gii thut php nhn s phy ng c th hiu r hn lu gii thut trn, ta s lm theo lu trn vi mt php nhn hai s phy ng nh phn 5 bit:
2100 1.1 0 01
2110 1.0010

------------------------------35

Bc1: bc ny, ta tin hnh tch ring phn thp phn, s m, du ca ton hng a vo ri nhn phn thp phn ca hai s vi nhau. 1.1001 1.0100 -----------------------1.11000010 Vy ta c frac0 = 1.11000010. Cng vic nhn phn thp phn vo nhau, ta cng tin hnh tnh s m: e0 = 2100+110-bias = 283 Bc 2: Sau khi tnh c cc kt qu trn, ta s lm trn phn thp phn v s nguyn gn nht: frac0 = 1.1100 Bc 3: Sau khi tnh c cc thng s, ta ghp li phn m v du s c kt qu l: 283 1.1100 4.4.3 Php chia Php chia trong khi x l phy ng ny c thc hin ni tip vi gii thut cn bn l php tr lin tc cc s. Do php chia khng c dng thng xuyn nh php nhn, nn n c lp trnh x l ni tip tit kim ti nguyn FPGA. c th hiu r hn cc khi trong php chia phy ng lu trn, ta th tin hnh php chia tng bc mt vi hai s phy ng nh phn 5 bit:
2110 1.0 0 00
2100 0.0011

Bc 1: m cc s 0 pha trc phn thp phn ca hai s cn tnh. trong v d ny ta d thy zA = 0, zB = 3.

36

Bc 2: Sau khi tm c zA v zB, ta tin hnh dch tri phn thp phn ca cc s theo zA, zB s c: fracA = 10000 00000 fracB = 00000 11000 Trong khi dch cc phn thp phn theo zA, zB ta cng tin hnh tnh s m ca kt qu: e0 = 2110-100+bias-0+3 = 2140
Ton hngA = duA & eA & fracA Ton hngB = duB & eB & fracB m cc bit 0 u cc phn thp phn: zA, zB Dch tri fracA zA bit Dch tri fracB zB bit frac0 = fracA / fracB sign0 = signA xor signB Lm trn frac0

e0 = eA - eB + bias(127) zA + zB

Kim tra ngoi l Khng Chun ha Ra = du0 & e0 & frac0

Bo hiu ngoi l

Hnh 4.5: Lu gii thut php chia s phy ng Bc 3: Sau khi c c cc thng s fracA, fracB c dch, ta tin hnh php chia:
100000 ,0000

37

000001 ,1000

----------------------1,0101 Bc 4: Sau khi cc bc tnh ton trn thc hin xong xui, ta s ghp cc bit du, bit m v bit thp phn li ri y kt qu ra u ra. Trong v d ny, kt qu s l: 1,0101 2140 4.5. Thit k phn cng Kin trc cn bn ca khi x l phy ng c miu t trong hnh sau:

Hnh 4.6: Kin trc khi x l du phy ng


38

Hnh 4.7: ng ng b cng/tr phy ng

Hnh 4.8: ng ng b nhn/chia phy ng Khi x l phy ng (FPU) c xy dng tnh ton bn php ton: 1. Php cng 2. Php tr 3. Php nhn 4. Php chia Do cc khi php tnh c lp vi nhau, khi mt khi tnh ton hot ng, c th tt cc khi tnh khc tit kim cc phn t logic trn FPGA. Nhn vo kin trc trn, ta c th nhn thy, khi mi khi tnh ton u gm ba phn: 1. B tin chun ha: Ton hng c chuyn thnh cc khun chun cc phn sau c th x l d dng, hiu hn. 2. B x l tnh ton: Tin hnh thc hin cc php ton cng, tr, nhn chia t cc khun nhn c t b tin chun ha ri a kt qu ra b chun ha cui

39

3. B chun ha cui: Nhn c kt qu x l t b x l tnh ton theo ng khun dng d liu c t b tin x l, b chun ha cui s chun ha li mt ln na (nu bit u trc du phy l 1). Ri sau , b chun ha cui s ghp li cc khun dng thu c a ra u ra d liu phy ng nh phn theo ng chun IEEE-754.

Chng 5 Khi phc nhp k hiu


5.1 Tng quan Trong mt h thng truyn thng s, tn hiu thu phi c ly mu tc mu v pha thch hp nht. lm c iu ny, b thu phi to ra nhp ly mu thay i c tin hnh ly mu. Tuy nhin, do b pht v b thu s dng tn s dao ng khc nhau, nn nhp k hiu b dch i l kh trnh khi. Qu trnh ng b nhp ly mu trong b nhn vi tn hiu thu c, gi l khi phc nhp k hiu. Hnh 5.1 biu din mt gin mt vi ba nhp k hiu khc nhau m t tm quan trng ca vic khi phc nhp k hiu cho tn hiu QAM256. Gin mt l th ca bin tn hiu theo thi gian trong cc chu k k hiu nht nh. Sau mt s chu k k hiu nht nh, ng i ca bin tn hiu theo thi gian li bt u t bn tri th to ra mt lng ln cc ng cong chng ln nhau.

40

Trn gin mt, cc ng chm dc biu din cc im ly mu ti u. Ta nhn thy, ti tm cc im ly mu ti u c mt s vng khng c ng cong i qua, cc vng ny c hnh dng ging con mt nn gin mi c tn l gin mt. Kch thc ca mt biu din mp nhiu v mp nhp ca tn hiu nhn c. cao ca mt biu din mp nhiu hoc lng nhiu thm vo gy ra li. rng ca mt biu din mp nhp hay dch ca nhp to ra li. Ngoi gin mt, hnh 5.1 cn m t ba xung nhp din t tm quan trng ca vic ng b nhp k hiu. Nhp A trong hnh v m t nhp ly mu c ng b vi tn hiu trong gin mt. Nhp B m t nhp ly mu c s lch pha so vi nhp ly mu ti u. Nhp C m t nhp ly mu c tn s khng ph hp vi tn s ca dng sng trong gin mt. Nhp ly mu c s c ng b vi nhp k hiu ti im c dch bng khng nhng do lch pha gia dng sng trong gin mt v nhp ly mu tng theo thi gian x l, nn cc k hiu chnh xc kh c th tm ra t cc mu ly c.

Hnh 5.1: Ly mu

41

5.2 Cc k thut khi phc nhp k hiu ng b k hiu c th c thc hin bng nhiu cch. Mt trong s l b pht v b thu c ng b vi mt xung nhp ch, da vo , b thu c th tnh ton tr t b pht n n. Mt phng php khc l tryn nhp k hiu hay bi s ca n theo tn hiu thng tin. S khc bit ca vic pht nhp k hiu i cng thng tin l gi i cc chui m thanh tun hon, b thu s tm kim cc chui m thanh thit lp nhp mu v s s dng chng cho ti khi chui m thanh khc c nhn. Cc k thut ny kh n gin nhng nu thc hin, b pht s phi phn phi mt phn cng sut v bng thng truyn thng tin v nhp k hiu nn chng khng c s dng rng ri. Ngoi cc phng php trn, phng php c s dng rng ri nht hin nay l khi phc xung nhp ngay trn d liu nhn c, phng php ny c gi l phng php t ng b. Cc k thut t ng b bao gm k thut gp i, k thut bin ti a, k thut sm-mun v k thut ct khng. Cc k thut ny u hot ng hiu qu vi d liu ngu nhin v s c gii thiu ln lt sau y. 5.2.1 K thut khi phc nhp k hiu gp i K thut khi phc gp i nhp k hiu da trn c im: tn hiu d liu gm cc chui lp li cc k hiu c bin dng, m lun phin nhau. Cc chui ny s cha mt tn s bng na tc ly mu. Nu tn hiu l vung, thnh phn tn s bng na tc k hiu s c gp i trong min tn s. Mt b lc thng di hp c th c s dng ly ra xung nhp mu t tn hiu vung. K thut ny t ra kh hiu qu vi QAM-4 do phng php iu ch ny c xc sut lp li cc k hiu c bin dng, m lun phin nhau tng i cao. Tuy nhin, khi tng khi bc iu ch, s to ra nhiu
42

im chm sao trn gin hn lm k thut ny tr nn km hiu qu do xc sut cc k hiu lin tip lp li nh hn nhiu. 5.2.2 K thut khi phc nhp k hiu bin ti a K thut ng b bin ti a xut pht t k thut c lng xp x cc i. K thut da trn nguyn tc: khi ly trung bnh mt vi k hiu, gi tr tuyt i bin ca mt tn hiu s l cao nht im ly mu ti u c biu din Hnh 5.2.

Hnh 5.2: Bin k hiu trung bnh l hm ca thi gian K thut ng b bin cc i c thc hin bng cch ly mu tn hiu thu c vi J mu mt k hiu. Do , cc mu J c pha cch u nhau. T cc mu ny, cc gi tr trung bnh ca J c tnh ton cho mi trng hp pha. T cc kt qu , trng hp pha c gi tr trung bnh ln nht c s dng l im mu vic bt u khi phc nhp d liu t tn hiu thu c. 5.2.3 K thut khi phc nhp k hiu sm-mun K thut khi phc nhp k hiu sm-mun cng da trn nguyn tc: khi trung bnh ha mt vi k hiu, gi tr tuyt i bin ca mt tn hiu l cao nht im mu ti u. Tuy nhin, khng ging nh k thut ng b bin ti a, ly mu t tn hiu thu c J ln mi k hiu, k

43

thut ng b sm-mun ly mu ba ln mt k hiu: mt mu c coi l mu c dch pha ti u, mt k hiu trc dch pha ti u v mt k hiu sau dch pha ti u. Nu b nhn tht s ly mu dch pha ti u nh trong hnh 5.3. Gi tr trung bnh tuyt i ca cc mu sm s bng vi gi tr trung bnh tuyt i ca cc mu mun. Nu b thu ly mu cc im khng c dch pha ti u, cc gi tr trung bnh sm v mun s khng bng nhau. Khi , da trn s khc bit gia cc mu trung bnh sm v cc mu trung bnh mun s tin hnh nng ln hay lm tr mt nhp ly mu.

Hnh 5.3: Ly mu sm-mun 5.2.4 K thut khi phc nhp k hiu ct khng K thut ng b ct khng da trn nguyn tc: v mt trung bnh, ct khng xy ra gia k hiu trc im ly mu ti u. Hnh 5.4 biu din gin mt c to ra t mt chui QAM-4 ngu nhin xc nh v tr tng i ca im ct khng v ly mu ti u. Nu vic ly mu din ra qu sm, gi tr ct khng trung bnh s din ra ln hn mt na k hiu sau thi gian ly mu. Do , tr gia khong thi gian ly mu v ct khng phi c xem xt nng ln hay lm tr mt nhp ly mu.

44

Hinhg 5.4: Gin 4 mt ca QAM Cng nh k thut trc, k thut khi phc nhp ct khng cng khng c ng dng rng ri cho cc modem c thit k bng cc phn t logic s hoc modem hot ng trong cc chm sao phc tp. Tr ngi chnh khi a k thut ny vo cc phn t logic s l rt kh c th tm ra v tr ca cc im ct khng t cc mu d liu s. Ngoi ra, mt kh khn khc ca k thut khi phc nhp k hiu ct khng trong cc chm sao ln l s xut hin ca nhiu jitter ln ti cc im ct khng v nhiu s dch chuyn k hiu m khng ct khng. Tuy nhin, Daniel Aspel v Klymyshyn ch ra rng, k thut ct khng c th m ra hot ng trn cc chm sao phc v a ra k thut d on bin tm ra s chuyn bin ca cc k hiu thay th cho k thut ct khng. K thut d on bin vt qua c cc jitter ct khng do dch chuyn k hiu m ct bc bin khng v cho php s dng ca s dch chuyn k hiu m khng ct khng. Do vic d on bin c quyt nh trc tip nn k thut ny khng b nh hng bi s ct khng ngu nhin ca chui d liu. V vy, k thut d on bin to ra s gim st ng cong khi BER thp. Hn na, nhng s dch chuyn m khng ct khng vn s phi ct ngng bin d on. V th, k thut d on bin l s la chn thch hp cho cc h thng M-QAM

45

v khi BERs thp th s c rt nhiu s dch chuyn k hiu m khng ct khng. K thut d on bin v ang c pht trin ng b cho cc h thng M-QAM phc tp. Tuy nhin, phng php xy dng ca Daniel Aspel v Klymyshyn kh phc tp, i hi nhiu khu tnh ton, ng b. Trong kha lun ny, ti tin hnh xy dng h thng khi phc nhp d liu da trn phng php tng quan cho h thng QAM-16. 5.3 K thut khi phc nhp k hiu bng phng php tng quan B khi phc nhp k hiu c biu din trong hnh v sau:

To sng

Tn hiu vo

Xt tng quan

Tn hiu ra

Hnh 5.5: B khi phc nhp k hiu V mt tng quan, b to xung nhp bao gm hai khi ln: khi to li sng mang v khi xt tng quan sng mang vi tn hiu vo. Khi to sng mang s to li sng sin s a vo mt u ca b xt tng quan, u cn li ca b xt tng quan s l tn hiu QAM thu c. B xt tng quan s tin hnh chun ha cc tn hiu v a ra u ra k hiu gn ng nht vi k hiu thu c. 5.3.1 B xt tng quan Cc khi con ca b xt tng quan c miu t trong hnh 5.6
46

Sng mang

Tn hiu vo

Chun ha bin

Xoay pha

Xt tng quan

Tn hiu ra

Hnh 5.6: B xt tng quan tng tnh chnh xc ca vic xt tng quan, b to sng mang s pht ra cc mu sin s ca hai chu k sng mang. Cc mu ca hai chu k sng mang ngay sau s c chun ha bin . Khi chun ha bin : Khi chun ha bin s nhn cc mu ca hai chu k sng mang mang a vo vi mt h s thch hp bin sng mang bng vi bin ca k hiu a vo. H s nhn chnh bng mu ln nht (bin ) ca k hiu thu c. Do bn cht ca QAM l mt sng sin c iu ch pha-bin nn khi ny s h tr tm li bin ca sng QAM. Khi xoay pha: Sau khi bin c chun ha, cc mu sng mang c chun ha s c a vo khi xoay pha. T cc mu ca hai chu k sng mang c c, khi xoay pha s tin hnh ly mu li cc mu cng vi tn s nh vy nhng dch pha 10 mc khc nhau. Vic ly mu li s to ra 10 sng mang khc pha nhau m mi sng c s mu nh hn 10 ln sng mang ban u. Khi xt tng quan: y l khi quan trng nht ca b xt tng quan. Nh ni trn, khi xoay pha s a ra 10 sng mang s vi 10 mc pha khc nhau y vo b xt tng quan. B xt tng quan s so snh cc mu ca k hiu thu c vi cc mu sng mang pht ra t khi xoay pha. V mt chi tit, khi xt tng quan s trt k hiu thu c trn tng sng mang mt, sng mang no cho sai s tch ly nh nht s c coi l k hiu QAM chnh xc v c a v x l cc phn tip theo. M t chi tit qu trnh xt tng quan s c nu phn tip theo ca kha lun.

47

Hnh 5.7: Tng quan ca mt sng QAM 5.3.2 Qu trnh xt tng quan 5.3.2.1 Qu trnh ng b k hiu u tin Khi b thu c bt ln v bt u thu c sng QAM, nhim v u tin l phi ng b c k hiu u tin ri ly lm nn to ra nhp ng b k hiu. Do vy, qu trnh ng b u tin l v cng quan trng, v n lin quan n nhp ng b ca c h thng. Tuy nhin, khng phi bt chun c k hiu u l xung nhp lc no cng ng nn cc k hiu sau cng phi c ch t ng b theo sng QAM, qu trnh t ng b s c m t phn tip theo cn trong phn ny, ti s gii thiu su v cch thc tm k hiu u tin tht chun. V mt tng quan, ngay khi b thu c bt ln, b xt tng quan s lin tc qut tn hiu u vo n khi tm c k hiu c sai s tch ly nh c th chp nhn l mt k hiu. Gi s ly 24 mu mt k hiu, th sau khi khi ng, b xt tng quan s lin tc ly 24 mu u vo bt k l nhiu, k hiu khc hay tn hiu DC ti khi bt c mt k hiu tht s. Ta s d dng nhn ra mt k hiu ng do khi , cc
48

mu ca n s cho sai s tch ly nh hn hn so vi cc mu khng phi ca mt k hiu QAM chun. Tuy nhin, c mt s trng hp c bit lm qu trnh ly mu b sai cng nh a ra mt nhp k hiu khng chun. Cc k hiu u tin l mt chui lin tip ging nhau: Hnh 5.8 s m t cc k hiu u tin ging nhau dch chuyn, gi s 0 l thi im b thu bt u c khi to, b xt tng quan trong b thu s lin tc qut u vo tm chui c sai s tch ly nh. Hnh 5.8a m t b thu c khi ng trc b pht, khi , cho n khi bt c k hiu u tin, cc mu trc s ch l 0 hoc nhiu. Hnh 5.8b m t b thu c bt v thu c mt tn hiu gia chng, khi , cc mu trc k hiu u tin thc s tng quan c s l mu ca mt k hiu trc . Tr ngi ln nht khi x l cc k hiu lin tc ny l nu ta ly 24 mu cho mt k hiu QAM, th bt k 24 mu no trong vng cc k t lin tip (t mu 15 n mu 62 trong hnh 5.8) u s cho sai s tch ly nh hn ngng xt (thm ch bng k hiu tht s). Do vy, s to ra xung nhp ng b lch do tc ng ca chui lin tc ny. khc phc hin tng lch xung nhp ny, ta buc phi tin hnh loi b cc k hiu lin tc cho n khi bt c k hiu mi. Gi s ta xt tn hiu QAM c ly 24 mu mt k hiu, nu ta thy cc mu trong khong t i n i+23 c sai s tch ly nm trong ngng, ta xt tip cc mu trong khong t i+1 n i+24 tc l vng tip theo, nu cc mu ny c sai s tch ly ln hn ngng tc l c mt s nhy bin ti v tr ny, khi , cc mu trong khong t i n i+23 s c nhn l mt k hiu v nhp ng b k hiu s c pht ra da vo k hiu u tin ny.

49

a)

b) Hnh 5.8: Cc k t u tin l chui lin tip ging nhau 5.3.2.2 Qu trnh t ng b cc k hiu sau k hiu u tin.

50

Sau khi bt ng c k hiu u tin, nhp k hiu s c pht ra da vo k hiu v nhp ny c tn s ng bng tn s ca tn hiu QAM n. V mt l thuyt th t thi im ny, nhp k hiu ti to hon ton ng b vi d liu QAM. Tuy nhin, do c nhng lch nht nh do nhiu khi truyn, qu trnh truyn c th t ngt b mt ng b. Do , trong qu trnh thu, nhp ng b cng phi t ng b vi d liu thu c nu c li th li s khng gy nh hng ln n d liu thu c. Qu trnh t ng b cng bao gm hai phn. Mt phn l ng b cc d liu lch pha nhau, vi cc d liu ny, c th d dng ng b chun vi nhp khi phc. Phn cn li l d liu lin tip khng c s lch pha. Ta li xt tn hiu QAM c ly 24 mu mt k hiu. Nu sai s tch ly ca cc mu trong vng t i n i+23 tha mn nh hn ngng m sai s tch ly ca i+1 n i+24 ln hn ngng tc l ti mu i+24 c s thay i pha lm nn khng th bt c ng k hiu, ti y, cc mu trong vng t i n i+23 c coi l mt k hiu ng. Ngc li, nu sai s tch ly ca i+1 v i+24 nh hn ngng, iu chng t k hiu lp li, ta tm coi cc mu trong vng i n i+23 l mt k hiu, ri xt tip cc mu trong cc vng i+24 n i+37 v i+25 n i+38 nh trn n khi nhn c s lch pha nh trn s nn chnh li.

Chng 6 Khi phc sng mang v gii iu ch QAM


6.1 Tng quan

51

Hin nay, c hai phng php gii iu ch ph bin l gii iu ch kt hp v khng kt hp. Trong hai phng php ny, gii iu ch khng kt hp khng yu cu khi phc sng mang trong khi iu ny l rt cn thit khi tin hnh gii iu ch kt hp. Mt s phng php iu ch nh iu ch bin hay iu ch dch pha sng mang c th tin hnh gii iu ch bng cc k thut gii iu ch khng kt hp. Tuy nhin, i vi cc phng php iu ch khc nh QAM i hi nhiu kin thc xc nh sng mang, nn ch c th s dng phng php gii iu ch kt hp. C hai phng php tin hnh gii iu ch kt hp trong QAM: Phng php th nht s dng mt b to dao ng ni c tn s iu chnh c c th thay i nhp gii iu ch. Cn phng php th hai s dng b to dao ng ni c tn s c nh ri dng mt b gii quay s khc phc s dch ca tn s v pha sng mang. Mi phng php u c nhng u, nhc im ring nn s dng phng php no phi quyt nh da trn cc iu kin c th. 6.2 Khi phc sng mang Nu b dao ng ni trong b thu khng ng b vi tn hiu QAM thu c, d liu nhn c s khng th khi phc chun xc. Hnh 6.1 biu din s dch pha v tn s trong b dao ng ni. Hnh 6.1a biu din mt chm sao QAM-64 m c gii iu ch bng b dao ng ni c dch pha v tn s bng khng. Hnh 6.1b cng biu din chm sao QAM nh vy nhng ln ny b dao ng ni dch pha 10 so vi sng QAM. Trong trng hp ny, chm sao b quay i 10 gy ra li bit do cc im chm sao dch chuyn ct ng gii hn. Hnh 6.1c cng biu din chm sao nh hnh 6.1a v b nhng dch pha ca b dao ng ni ln ny khng ch dng ti mt v tr m thay i lin tc. Nhn vo hnh v ta c th nhn thy, khi dch pha thay i lin tc theo thi gian th cc im chm sao c qu tch l cc vng trn lng nhau.

52

Hnh 6.1: Kt qu ca dch pha sng mang v tn s Ta c th biu din mt tn hiu QAM sai pha nh phng trnh 6.1:
s (t ) = AI (t ) co 2 c t + ) AQ (t ) sin 2 c t + ) s( f ( f

(6.1)

Vi AI(t) l bin ca knh I(ng pha) nh mt hm bin i theo thi gian, cn AQ(t) l bin ca knh Q(vung pha) cng nh mt hm ca thi gian, fc l tn s sng mang v l pha ca sng mang c iu ch. Nu tn hiu QAM c gii iu ch bi cc phng trnh cI(t) v cQ(t) tng ng vi cc knh I,Q nh Phng trnh 6.2 v 6.3.
c I (t ) = cos( 2 c t +d ) f

(6.2)
c Q (t ) = ( 2 c t + d ) sin f

(6.3)

Vi d l pha ca cc tn hiu c s dng gii iu ch s(t). Qua , s khi phc c cc thnh phn ng pha AI(t) nh phng trnh 6.4 v cc thnh phn vung pha AQ(t) nh phng trnh 6.5.
AI' (t ) =
' AQ (t ) =

1 1 AI (t ) cos( d ) AQ (t ) sin( d ) 2 2

(6.4) (6.5)

1 1 AQ (t ) cos( d ) + AI (t ) sin( d ) 2 2

T phng trnh 6.4 v 6.5, ta thy rng cc bin AI(t) v AQ(t) gim cos(-d) ln so vi bin tht s ca chng khi khng c s dch
53

pha. Do cng sut t l vi bnh phng bin nn cng sut ca AI(t) v AQ(t) gim cos2(-d) ln so vi cng sut tht s chng (khng c dch pha). Ngoi ra, phng trnh 6.4 v 6.5 cng ch ra rng nhiu xuyn m c sinh ra gia cc thnh phn ng pha v vung pha. 6.3 Cc k thut khi phc sng mang C hai loi k thut ng b sng mang l: gi km (assisted) v m (blind). C s ca k thut cng tc l phn chia tn hiu thu c thnh hai tn hiu: tn hiu phao tiu (pilot) v d liu. Cn k thut ng b m li tin hnh c lng pha sng mang trc tip t tn hiu iu ch. Phng php ny thng c s dng trong thc tin nhiu hn v khi , ton b cng sut ca b pht c th s dng cho thnh phn tn hiu cha thng tin. 6.3.1 K thut khi phc sng mang c gi km tn s phao tiu (pilot tone) H thng s dng k thut khi phc sng mang c gi km tn s phao tiu phn phn chia tn hiu thu c thnh hai phn: mt phn l tn hiu c tn s khng c iu ch (tone) cn phn cn li l tn hiu thng tin. Tn s gi km thng c cng vo chnh tn s sng mang (Hnh 6.2) hoc l tch ca tn s sng mang. Da vo , b nhn s s dng vng kha pha thu li thnh phn sng mang. Vng kha pha s dng phi c bng thng nh tn hiu thng tin khng nh hng nhiu ti s vic c lng sng mang.

54

Hnh 6.2: Tn hiu phao tiu c truyn cng tn hiu thng tin. 6.3.2 Vng lp vung (Squaring Loop) Cc thit b s dng vng lp vung c s dng rng ri c lng pha ca sng mang i vi cc tn hiu c sng mang c nn bn trong PAM. PAM khng c nng lng kt hp ti tn s sng mang nn nu ta t mt b lc thng di lc tn hiu thu c ti tn s sng mang th vn s khng th khi phc sng mang. Tuy nhin, c th vung ha tn hiu thu c to ra mt thnh phn tn s gp i tn s sng mang. Thnh phn tn s ny c th s dng iu khin mt b PLL to ra tn hiu ng b vi sng mang. K thut ny c miu t Hnh 6.3. Tic thay, phng php ny khng th s dng vi QAM. Tn hiu QAM c cng sut bng nhau trn c hai nhnh, do , nu vung ha QAM, tn hiu trn cc nhnh s c xu hng ct b cc tn hiu tn s thp trong khi phi s dng chng mi c th khi phc sng mang. Nhc ny c th khc phc bng cc vng lp tip theo.

Hnh 6.3: To quy lut sng vung da trn PLL cho vic khi phc sng mang 6.3.3 Vng lp Costas

55

Vng lp Costas c pht trin vo nm 1956 khng nhng khi phc sng mang t cc tn hiu c sng mang nn bn trong ging vi thnh vng lp vung m cn c th khi phc pha sng mang ca tn hiu QAM. S khi ca vng lp Costas c m t trong Hnh 6.4. Tn hiu thu c chia lm hai nhnh. Nhnh th nht c nhn vi sng mang c khi phc cn nhnh th hai cng nhn vi sng mang nhng b dch pha 90 . u ra cc nhnh ny c a vo b lc thng thp. Kt qu ca chng c nhn vi nhau to ra tn hiu li, tn hiu ny c s dng iu khin b dao ng iu khin in th (VCO).

Hnh 6.4: Vng lp Costas 6.3.4 Vng kha pha phn hi quyt nh C vng lp vung v vng lp Costas u xem cc tn hiu thng tin l mt chui ngu nhin v s dng gi tr trung bnh thng k ca n khi phc thng tin sng mang bn trong n.

56

Hnh 6.5: PLL phn hi quyt nh cho QAM Thng thng, PLL phn hi quyt nh to ra t nhp jitter hn cc b khng quyt nh, cc h thng khi phc sng mang trc tip c BER nh hn 10-2 do cc li bit gy ra tc ng khng ng k ln s c lng pha sng mang c to ra bi b lc lp. 6.4 Gii iu ch QAM s dng phng php tng quan thun li cho vic tnh ton, ti pht trin h thng c biu din bi hnh 6.6, h thng ny c thit k ph hp vi vic tnh ton, xt tng quan k hiu.

57

B tch phn

A/D

Chuyn i nh phn sang phy ng

Xt tng quan

To li sng mang Quay 90 B tch phn Khi phc xung nhp Q

Xung nhp ly mu

Hnh 6.6: H thng gii iu ch QAM s dng phng php tng quan B A/D: D liu thu c s c ly mu bng b A/D vi xung nhp c th thay i c. Do c th iu chnh c nhp ly mu AD nn ta c th thay i s lng mu mi k hiu to thun li cho b tnh tng quan. Khi chuyn i nh phn sang phy ng: Khi ny c miu t chi tit chng 4. Do d liu y ra t khi A/D l d liu nh phn s, trong khi qu trnh x l trn FPGA ca h thng i hi tnh ton cc s rt ln, cc s nh phn, s nguyn thng thng khng th p ng c nn khi nh phn sang phy ng s chuyn i cc s nh phn sang khun dng du phy ng ton b cc php ton ca cc khi bn trong s hon ton c tnh ton thng qua khi x l du phy ng FPU. Khi xt tng quan: Khi ny c m t chi tit chng 5, nhim v ca khi ny l tm ng im bt u v kt thc ca k hiu c th to ra xung nhp k hiu chun bng khi khi phc xung nhp. D liu chun t khi khi phc xung nhp s l d liu ng b m c h thng da vo ng b cc khi vo nhau v gii iu ch.
58

Khi to li sng mang, khi quay 90 : Hai khi ny c nhim v to li sng mang sin v sng mang cos da trn c s nhp ng b ca khi khi phc xung nhp. Sau , cc sng mang s c nhn tn hiu vo to ra tn hiu cc knh I,Q. B tch phn c vai tr nh mt b lc thng thp, s kh i cc thnh phn xoay chiu, gi li thnh phn mt chiu chnh l v tr ca im chm sao trn cc knh I, Q .

Kt lun
Trong kha lun ny, ti tin hnh thit k mt b iu ch v gii iu ch QAM-16 trn FPGA. Trc khi xy dng trn FPGA, ti tin hnh thit k, m phng h thng ca mnh trc trn Matlab. Sau khi xem xt, la chn gia nhiu k thut khc nhau, ti nhn thy, k thut khi phc nhp k hiu ly nn tng l k thut tng quan l ph hp nht, c th thc hin c nn ti tin hnh thit k, xy dng h thng ca mnh trn c s ca k thut tng quan. Sau khi thit k, m phng h thng thnh cng trn Matlab, ti tin hnh xy dng trn FPGA. B iu ch c xy dng thnh cng trn FPGA, tn hiu QAM c pht ra trn nhiu bng tn s khc nhau v c th quan st c trn dao ng k. i vi b gii iu ch, khi tnh ton du phy ng thc hin cc php tnh c bn c xy dng thnh cng. Nh c kh nng tnh ton nhanh v mnh ca khi ny, b gii iu ch s sm c hon thin. Hng pht trin tip theo ca ti: Tip tc hon thin khi gii iu ch QAM

59

Nghin cu, trin khai QAM 1024 vi tn s k hiu cao

- Kt hp FFT/IFFT pht a sng mang. TI LIU THAM KHO [1] Circuit design with VHDL, Volnei A. Pedron, M.I.T press, Massachusetts Institute of Technology [2] L. Mintzer, Soft Radios and Modems on FPGS, Communications System Design, pp.52-57, Feb. 2000. [3] Quartus II Development Software, Altera Corporation, http://www.altera.com/literature/lit-qts.jsp , February 2004. [4] 802.16TM IEEE Standard for Local and metropolitan area networks, Part 16: Air Interface for Fixed Broadband Wireless Access Systems, The Institute of Electrical and Electronics Engineers, Inc., New York, NY, 2002. [5] V. Eklund et al., IEEE Standard 802.16: A Technical Overview of the Wireless MAN Air Interface for Broadband Wireless Access, IEEE Communications Magazine, pp. 98-107, June 2002. [6] APEX 20K Programmable Logic Family, Altera Coporation, website: http://www.altera.com/literature/ds/apex.pdf [7] Cyclone II Device Family Data Sheet, website: http://www.altera.com/literature/hb/cyc2/cyc2_cii5v1_01.pdf [8] L. Couch, Digital and Analog Communication Systems, Prentice Hall, Upper Saddle River, NJ, 1997. [9] L. Yang and L. Hanzo, Recursive Algorithm for the Error Probability Evaluation of M-QAM, IEEE Communications Letters, vol. 4, no. 10, pp. 304-306, October 2000. [10] W. Reuter, Source and Synthesizer Phase Noise Requirements for QAM Radio Applications, http://www.cti-inc.com/pdfs/QAM_Article.pdf.
60

[11] K. Cho and D. Yoon, On the General Expression of One- and TwoDimensional Amplitude Modulations, IEEE Transactions on Communications, vol. 50, no. 7, pp. 1074-1080, 2002.

61