You are on page 1of 10

PH LC

Ph Lc
Chng Trnh Chnh M Phng
1 Chng Trnh iu Khin Cng Sut 1.1 Chng Trnh iu Khin Cng Sut Bc C nh function pushbutton1_Callback(hObject, eventdata, handles) congsuatphat=str2double(get(handles.edit2,'string')); user=str2double(get(handles.edit1,'string')); In=14.200; nc=8.000; %congsuatcuatungsongmang; deltaP=0.500; NumAngles=2^4; C=3e8; alpha=RayCh1(NumAngles, Velocity); sipow = tinhieu(user); sigpower1=congsuatphat; sigpower2=congsuatphat; G=8.000; snrchuan=abs(G/user); Y1=[]; Y2=[]; e=0.025*deltaP; deltaP1=0.250; for i=1:80 alpha1=randint(1,1,[975 980])*1e-03; % gia tri snr chuan %sigpower=abs((20*log(out))/4 phuong phap fixed-step %phuong phap multi-level Length, symbolRate, NumWaveforms,carrierFreq, %buoc dieu khien cong suat Length=2^8; symbolRate=9.6; NumWaveforms=2; % cong suat nhieu ,In = No*B/nc,No laf mat do cong suat nhieu,B bang tan moi song mang

carrierFreq=1.2286; Velocity=36;

PH LC

snr1=(sigpower1*alpha1^2*G)/((user-1)*sigpower1+In); Y1(i)=sigpower1; if snr1 >= snrchuan sigpower1= sigpower1-deltaP; else sigpower1=sigpower1+deltaP; end end Y=Y1; bar([Y]','group'); xlabel('time(x1.25msec)'); ylabel('cong suat phat(dB)'); title('fixstep'); grid on 1.2 Chng Trnh iu Khin Cng Sut a Mc function pushbutton2_Callback(hObject, eventdata, handles) congsuatphat=str2double(get(handles.edit2,'string')); user=str2double(get(handles.edit1,'string')); In=14.200; nc=8.000; deltaP=0.500; alpha=0.94; sipow = tinhieu(user); sigpower1=congsuatphat; sigpower2=congsuatphat; G=8.000; snrchuan=abs(G/user); Y1=[]; % gia tri snr chuan %sigpower=abs((20*log(out))/4 phuong phap fixed-step %phuong phap multi-level %buoc dieu khien cong suat % cong suat nhieu ,In = No*B/nc,No laf mat do cong suat nhieu,B bang tan moi song mang

PH LC

Y2=[]; e=0.025*deltaP; deltaP1=0.250; for i=1:80 alpha2=randint(1,1,[975 960])*1e-03; snr2=(sigpower2*alpha2^2*G)/((user-1)*sigpower2+In); Y2(i)=sigpower2; if snr2-snrchuan < -5*e sigpower2=sigpower2+3*deltaP1; elseif snr2-snrchuan <-3*e sigpower2=sigpower2+2*deltaP1; elseif -3*e <= snr2-snrchuan < -e sigpower2=sigpower2+deltaP1; elseif -e <=snr2-snrchuan < e sigpower2=sigpower2; elseif e <= snr2-snrchuan < 3*e sigpower2=sigpower2 -deltaP1; else sigpower2=sigpower2-2*deltaP1; end end y2=Y2; bar([y2]','group'); xlabel('time(x1.25msec)'); ylabel('cong suat phat(dB)'); title('multilevel'); grid on; 1.3 Chng Trnh iu Khin Cng Sut D on function pushbutton3_Callback(hObject, eventdata, handles)

PH LC

congsuatphat=str2double(get(handles.edit2,'string')); user=str2double(get(handles.edit1,'string')); In=14.200; nc=8.000; deltaP=0.0250; %alpha=0.95 ; cuongdo=tinhieu(user) sigpower2=congsuatphat-1; G=32.000; snrchuan=abs(G/user); Y1=[]; Y3=[]; e=0.5*deltaP; Pbit=1; sigpowerI=In*(snrchuan)/(G-(snrchuan)*(user-1)); [tetra,r]=gtdelta(Pbit); gama=1.3; for i=1:80 %snr2=(sigpower2*alpha^2*G)/(3*sigpower2+In); Y3(i)=sigpower2; alpha=randint(1,1,[981 965]); alpha1=alpha*1e-03; if (tetra <=0) & (r<=0) rama(i)=Pbit-tetra; else rama(i) =Y3(i)*alpha1^2-sigpowerI; end if (rama(i) < -5*e) %phuong phap tinh C sigpower2=sigpower2+3*deltaP; % dieu khien de du doan % gia tri snr chuan %phuong phap multi-level % mat do cong suat nhieu %so song mang ,bang he so do loi %buoc dieu khien cong suat

PH LC

elseif (rama(i) < -3*e) sigpower2=sigpower2+2*deltaP; elseif (-3*e <= rama(i) < -e) sigpower2=sigpower2 + deltaP; elseif (-e<=rama(i)< e) sigpower2=sigpower2; elseif ( e <= rama(i) < 3*e) sigpower2=sigpower2-deltaP; else sigpower2=sigpower2-2*deltaP; end end y=Y3*gama; bar([y]','group'); xlabel('time(x1.25msec)'); ylabel('cong suat phat(dB)'); title('predictive'); grid on; 2 Chng Trnh So Snh 2.1 Chng Trnh So Snh Cng Sut Pht function pushbutton1_Callback(hObject, eventdata, handles) cla(handles.axes1) user=str2double(get(handles.edit1,'string')); congsuatphat=str2double(get(handles.edit2,'string')); [Y1,Y2]=dkcs1(user,congsuatphat); Y3=csdudoan(user,congsuatphat); i=1:1:80; %bar([Y1]','grouped') hold on

PH LC

plot(i,Y1,'r-'); plot(i,Y2,'k-'); plot(i,Y3,'b*-'); %axis([0, 80,13, 20]); xlabel('time(x1.25msec)'); ylabel('cong suat phat(dB)'); legend('buoc co dinh','da muc','du doan'); grid on hold off 2.2 Chng Trnh So Snh SNR function pushbutton2_Callback(hObject, eventdata, handles) cla(handles.axes1) user=str2double(get(handles.edit1,'string')); congsuatphat=str2double(get(handles.edit2,'string')); [Y1,Y2]=dkcssnr(user,congsuatphat); Y4=dkdudoansnr(user,congsuatphat); i=1:1:80 hold on plot(i,Y1,'r-'); plot(i,Y2,'k-'); plot(i,Y4,'b-'); %axis([0, 80,3,4]); xlabel('time(x1.25msec)'); ylabel('SNR(dB)'); legend('buoc co dinh','da muc','du doan'); grid on hold off 2.3 Chng Trnh So Snh BER function pushbutton3_Callback(hObject, eventdata, handles)

PH LC

cla(handles.axes1) user=str2double(get(handles.edit1,'string')); congsuatphat=str2double(get(handles.edit2,'string')); y1=nhapthu(user,congsuatphat); y2=nhapthu2(user,congsuatphat); y3=nhapthu3(user,congsuatphat); hold on axis([5,user,1e-05,1e-01]); semilogy(y1,'r-'); semilogy(y2,'k-'); semilogy(y3,'b-'); %axis([5,user,1e-05,1e-01]); %axis([4,50,1e-05,1e-01]); %axis([5,user,1e-05,1e-01]); grid on hold off xlabel('number of Users');ylabel('BER'); legend('du doan','buoc co dinh','da muc'); grid on hold off 3 Chng Trnh M Phng H Thng MC-CDMA La Chn Bng Tn Thch Nghi(1/N) 3.1 Chng Trnh M Phng SNR-Based Band Selection function pushbutton1_Callback(hObject, eventdata, handles) user=str2double(get(handles.edit1,'string')); congsuat=str2double(get(handles.edit2,'string')); Y=thu(user,congsuat); H=3000000;

PH LC

for i=1 : user for j=1:8 Y1(i,j)=Y(i,j)/(sum(Y(:,j))-Y(i,j)); end y2(i)=max(Y1(i,:)) ; end b=y2; for i=1:user %syms y1(i) positive; S(i)=qfunc(b(i)); end f=S; syms y real for i=1:user %P2(i)=int(S,y,0,inf) F= mvnpdf(y); P1=int(F,y,0,inf); P(i)=P1*f(i); k(i)=i^3*(double(P(i)))/H; %P(i)=single(P1(i)) end v2=k; semilogy(v2,'k*-.') xlabel('Number of User'); ylabel('BER'); title('BER cho he thong 1/16'); axis([5,15,1e-06,1e-01]); grid on % --- Executes on button press in pushbutton2.

PH LC

3.2 Chng Trnh M Phng Power-Based Band Selection function pushbutton2_Callback(hObject, eventdata, handles) user=str2double(get(handles.edit1,'string')); congsuat=str2double(get(handles.edit2,'string')); Y=thu(user,congsuat); H=1000000; for i=1:user y1(i)=max(Y(i,:)); end for i=1:user %syms y1(i) positive; b(i)=y1(i)/(sum(y1)-y1(i)) S(i)=qfunc(b(i)); end f=S; syms y real for i=1:user %P2(i)=int(S,y,0,inf) F= mvnpdf(y); P1=int(F,y,0,inf); P(i)=P1*f(i); k(i)=i^2*(double(P(i)))/H; %P(i)=single(P1(i)) end v1=k; semilogy(v1,'m+-') xlabel('Number of User'); ylabel('BER');

PH LC

title('BER cho he thong 1/16'); axis([5,15,1e-06,1e-01]); grid on


3.1 Chng Trnh M Phng So Snh

function pushbutton3_Callback(hObject, eventdata, handles) user=str2double(get(handles.edit1,'string')); congsuat=str2double(get(handles.edit2,'string')); v1=thu2(user,congsuat); v2=thu3(user,congsuat); hold on i=1:1:user title('BER cho he thong 1/16'); semilogy(i,v1,'b*-.'); semilogy(i,v2,'r+-.'); axis([5,15,1e-6,1e-1]); xlabel('Number of User'); ylabel('BER'); axis([5,user,1e-06,1e-01]); legend('SNR-Based Band Selection','Power-Based Band Selection'); grid on hold off

You might also like