Upload
duc-trung
View
136
Download
6
Embed Size (px)
Citation preview
BÁO CÁO THÍ NGHIỆM THÔNG TIN SỐ
Họ và tên :
Lớp : ĐT 10-K52 Mssv:
Bài số 1
1.1 Vẽ hàm phân bố xác suất Gauss
x=-4:0.02:4;p=1/sqrt(2*pi)*exp(-x.^2/2);plot(x,p);title('ham phan bo xac suat Gauss cua bien ngau nhien');xlabel('x');ylabel('y');
-3 -2 -1 0 1 2 30
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0.4ham phan bo xac suat cua bien ngau nhien
x
y
1.2 Tạo một quá trình ngẫu nhiên với trị trung bình và độ lệch chuẩn như trường hợp trên:
m=0;sigma=1;
n=100000;x=-4:0.05:4;p=(1/sqrt(2*pi)*sigma)*exp(-(x-m).^2/2*sigma^2);check=trapz(x,p);plot(x,p,'r');hold on;y=randn(1,n);m=mean(y);vairiance=std(y)^2;x2=-4:0.1:4;c=hist(y,x2);stem(x2,c/n/(x2(2)-x2(1)));title('ham mat do phan bo');xlabel('X');ylabel('Y');hold off;
-4 -3 -2 -1 0 1 2 3 40
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0.4
0.45ham mat do phan bo
X
Y
So với đồ thị thu được ở 1.1, đường bao của 2 đồ thị là như nhau, cho thấy phân bố xác suất của quá trình ngẫu nhiên tuân theo phân bố xác suất Gauss.
Bài số 33.1 Biểu đồ chòm sao của tín hiệu điều chế QPSK mã hóa theo mã Gray : clear;
x=round(rand(1,10000));plot(x);for i=1:2:length(x) if x(i)==0&x(i+1)==0 s((i+1)/2)=exp(j*pi/4); elseif x(i)==0&x(i+1)==1 s((i+1)/2)=exp(j*3*pi/4); elseif x(i)==1&x(i+1)==1 s((i+1)/2)=exp(j*5*pi/4); elseif x(i)==1&x(i+1)==0 s((i+1)/2)=exp(j*7*pi/4); end endsave ex3p1_res s x;plot(s,'*');hold on;t=0:0.01:2*pi;plot(exp(j*t),'r--');xlabel('\phi(t)');ylabel('S_m');title('bieu do khong gian tin hieu phuc cua tin hieu dieu che QPSK');
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
(t)
Sm
bieu do khong gian tin hieu phuc cua tin hieu dieu che QPSK
3.2 Cho tín hiệu ở trên qua kênh nhiễu trắng AWGN :
clear;load ex3p1_res;es=var(s);eb=es/2;snr_db=6;n_0=eb/10^(snr_db/10);n=sqrt(n_0/2)*(randn(size(s))+j*randn(size(s)));r=s+n;plot(r,'.');hold on;plot(s,'r*');hold on;t=0:0.01:2*pi;plot(exp(j*t),'r--');legend('S_m','S');xlabel('I');ylabel('Q');title('Bieu do khong gian tin hieu phuc');
-2 -1.5 -1 -0.5 0 0.5 1 1.5-2
-1.5
-1
-0.5
0
0.5
1
1.5
I
Q
Bieu do khong gian tin hieu phuc
Sm
S
Bài số 44.1 Mô phỏng hệ thống truyền dẫn số băng tần cơ sở QPSK :Xây dựng hàm: clear all;load ex3p1_res s x;snr_db=0:2:8;for i=1:length(snr_db) c(i)=cha(snr_db(i),s,x); end BEP=c/length(x);semilogy(snr_db,BEP,'--');title('The bit error probability');xlabel('SNR in dB');ylabel('P_b');legend('P_b');save ex4p1_res c BEP;
0 1 2 3 4 5 6 7 810
-4
10-3
10-2
10-1
The bit error probability
SNR in dB
Pb
Pb
4.2 Tính tỉ lệ lỗi bit lý thuyết clear;snr_db=0:8; snr_db_simulation=0:2:8; for i=1:length(snr_db)
snr(i)=10^(snr_db(i)/10); gamma_b(i)=snr(i); p_b(i)=erfc(sqrt(2*gamma_b(i))/sqrt(2))/2;endsemilogy(snr_db,p_b,'ro--')hold onload ex6p1_res c BEP;semilogy(snr_db_simulation,BEP,'x--')title('The bit error probability');xlabel('SNR in dB');ylabel('P_b');legend('Theory','Simulation');hold off
0 1 2 3 4 5 6 7 810
-4
10-3
10-2
10-1
The bit error probability
SNR in dB
Pb
Theory
Simulation