1. Trang chủ
  2. » Tất cả

(Luận văn thạc sĩ hcmute) sử dụng mã ldpc tích chập trong hệ thống mimo

120 3 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

BỘ GIÁO DỤC VÀ ĐÀO TẠO TRƯỜNG ĐẠI HỌC SƯ PHẠM KỸ THUẬT THÀNH PHỐ HỒ CHÍ MINH LUẬN VĂN THẠC SĨ PHẠM THỊ TUYẾT SỬ DỤNG MÃ LDPC TÍCH CHẬP TRONG HỆ THỐNG MIMO NGÀNH: KỸ THUẬT ĐIỆN TỬ - 60520203 S K C0 Tp Hồ Chí Minh, tháng 10/2015 Luan van BỘ GIÁO DỤC VÀ ĐÀO TẠO TRƢỜNG ĐẠI HỌC SƢ PHẠM KỸ THUẬT THÀNH PHỐ HỒ CHÍ MINH LUẬN VĂN THẠC SĨ PHẠM THỊ TUYẾT SỬ DỤNG MÃ LDPC TÍCH CHẬP TRONG HỆ THỐNG MIMO NGÀNH: KỸ THUẬT ĐIỆN TỬ - 60520203 Hướng dẫn khoa học: PGS.TS PHẠM HỒNG LIÊN Tp Hồ Chí Minh, tháng 10/2015 Luan van Luận văn thạc sĩ GVHD: PGS.TS Phạm Hồng Liên LÝ LỊCH KHOA HỌC I LÝ LỊCH SƠ LƢỢC: Họ & tên: Phạm Thị Tuyết Giới tính: Nữ Ngày, tháng, năm sinh: 10/02/1985 Nơi sinh: Thanh Hóa Quê quán: Quảng Xương - Thanh Hóa Dân tộc: Kinh Chỗ riêng địa liên lạc: 223/19/24 Tây Sơn, Phường Quang Trung, TP Quy Nhơn, Bình Định Điện thoại quan: 0985967799 Điện thoại nhà riêng: Fax: Phamtuyet0502@gmail.com E-mail: II QUÁ TRÌNH ĐÀO TẠO: Trung học chuyên nghiệp: Hệ đào tạo: Thời gian đào tạo từ ……/…… đến ……/ …… Nơi học (trường, thành phố): Ngành học: Đại học: Hệ đào tạo: Chính Quy Thời gian đào tạo từ 9/2003 đến 6/ 2008 Nơi học (trường, thành phố): Trường Bách Khoa Hà Nội đào tạo liện kết cho trường Đại học Quy Nhơn Ngành học: Điện tử - Viễn Thông Tên đồ án, luận án môn thi tốt nghiệp: Tổng quan mạng WCDMA Ngày & nơi bảo vệ đồ án: 25.6.2008 Trường Bách Khoa Hà Nội HVTH: Phạm Thị Tuyết Trang i Luan van MSHV: 138520203032 Luận văn thạc sĩ GVHD: PGS.TS Phạm Hồng Liên Người hướng dẫn: TS Nguyễn Tiến Quyết III Q TRÌNH CƠNG TÁC CHUN MƠN KỂ TỪ KHI TỐT NGHIỆP ĐẠI HỌC: Thời gian 9/2008 - 3/ 2009 9/2009 - Nơi công tác Công việc đảm nhiệm Phịng Kỹ thuật - Cơng ty TC Trần Hưng Đạo - Quận TP.HCM Nhân viên kỹ thuật Khoa Điện tử - Trường Cao Đẳng Nghề Quy Nhơn Giáo viên HVTH: Phạm Thị Tuyết Trang ii Luan van MSHV: 138520203032 Luận văn thạc sĩ GVHD: PGS.TS Phạm Hồng Liên LỜI CAM ĐOAN Tơi cam đoan cơng trình nghiên cứu Các số liệu, kết nêu luận văn trung thực chưa cơng bố cơng trình khác Tp Hồ Chí Minh, ngày 10 tháng năm 2015 Người viết Phạm Thị Tuyết HVTH: Phạm Thị Tuyết Trang iii Luan van MSHV: 138520203032 Luận văn thạc sĩ GVHD: PGS.TS Phạm Hồng Liên LỜI CẢM TẠ Tôi xin gửi lời cảm ơn chân thành đến Quý thầy cô trường Đại học Sư phạm kỹ thuật Thành phố Hồ Chí Minh, thầy tận tình giảng dạy, truyền đạt cho kiến thức vô quý báu suốt thời gian học cao học Những kiến thức tảng cho tiếp tục bước đường sau Tôi xin bày tỏ lịng biết ơn sâu sắc đến Phạm Hồng Liên tận tình hướng dẫn, giúp đỡ, hỗ trợ tài liệu định hướng nghiên cứu giúp tơi hồn thành luận văn Một lần nữa, xin chân thành cảm ơn bè bạn, đồng nghiệp người sát cánh bên việc giải vấn đề khoa học nảy sinh nghiên cứu để tác giả có lời giải đáp, tiếp tục hướng đường nghiên cứu để đạt kết cuối cùng, hồn thành hướng nghiên cứu Cơng trình hồn thành chờ đón, động viên chia sẻ người thân gia đình, người đồng nghiệp người bạn Cảm ơn người bên lúc Tôi xin gửi đến gia đình, Q thầy cơ, bạn bè, người thân lời kính chúc sức khỏe, hạnh phúc thành cơng Tp Hồ Chí Minh, ngày 01 tháng năm 2015 Phạm Thị Tuyết HVTH: Phạm Thị Tuyết Trang iv Luan van MSHV: 138520203032 Luận văn thạc sĩ GVHD: PGS.TS Phạm Hồng Liên TÓM TẮT Sự phát triển lĩnh vực viễn thông năm gần tạo quan tâm sử dụng kỹ thuật mã hóa kiểm sốt lỗi Một số tiêu chuẩn giao tiếp không dây DVB-S2 802.16, vv áp dụng mã kiểm tra chẵn lẻ mật độ thấp (LDPC), hay gọi mã Gallager, đề xuất Gallager vào năm 1962 Về loại mã khối tuyến tính có ma trận thưa Bộ mã LDPC xem mã sửa lỗi tốt đạt đến gần giới hạn Shannon Trong thời gian sau người ta khám phá khả kiểm sốt lỗi cao chúng Vì mã LDPC sử dụng nhiều ứng dụng thực tế thông tin vô tuyến lưu trữ liệu Trong đó, mã LDPC tích chập (LDPC convolutional codes, gọi mã LDPC chập) cho thấy khả đạt hiệu suất kiểm soát lỗi tốt khả tiếp cận giống mã LDPC khối Luận văn trình bày phương pháp tạo họ mã LDPC chập: time-varying time-invariant từ mã LDPC khối Luận văn chứng minh hiệu suất mã LDPC chập tốt so với mã LDPC khối Đồng thời, luận văn đưa mơ hình có kết hợp mã LDPC chập vào hệ thống MIMO-một hệ thống thông tin sử dụng rộng rãi ngày nay, sau tiến hành phân tích hiệu suất mơ hình Trong phần lý thuyết, trước hết luận văn trình bày tổng quan hai họ mã tảng có khả kiểm sốt lỗi cao sử dụng nhiều ứng dụng thực tế: mã LDPC khối mã LDPC gần vòng (Quasi-Cyclic LDPC) Trong phần chính, luận văn trình bày lý thuyết mã LDPC chập, chủ yếu tập trung vào việc xây dựng ma trận kiểm tra chẵn lẻ H, phương pháp mã hóa giải mã hóa cho mã LDPC chập Đồng thời đưa giải pháp xây dựng ma trận kiểm tra chẳn lẽ H từ ma trận kiểm tra mã LDPC khối mã QC-LDPC Tiếp theo luận văn thực so sánh tổng quan mã LDPC chập xây dựng với mã LDPC khối mã QC-LDPC Trong phần mô phỏng, luận văn đề xuất mơ hình có kết hợp mã LDPC chập vào hệ thống MIMO, thực so sánh mã LDPC chập LDPC khối thông qua biễu diễn liên hệ tỉ lệ lỗi bit (BER) tỉ số Eb/N0 Các kết HVTH: Phạm Thị Tuyết Trang v Luan van MSHV: 138520203032 Luận văn thạc sĩ GVHD: PGS.TS Phạm Hồng Liên mô thực thuật tốn Mim-Sum với số vịng lặp thay đổi, đánh giá mã LDPC chập qua việc thay đổi chu kỳ mã Thông qua kết mô chứng minh khả kiểm sốt lỗi hệ thống có sử dụng mã LDPC chập hiệu suất mã LDPC chập tốt so với không sử dụng mã sử dụng mã LDPC khối HVTH: Phạm Thị Tuyết Trang vi Luan van MSHV: 138520203032 Luận văn thạc sĩ GVHD: PGS.TS Phạm Hồng Liên ABTRACT In recent years, the development of the telecommunications has created interest in using the technique error control coding Some wireless communication standards such as DVB-S2 and new 802.16, etc, have used parity Low Density Parity Check Code (LDPC), also known as Gallager codes, proposed by Gallager in 1962 Basically this is a linear block code with sparse matrices LDPC Code is seen as the better error correction codes reaches near the Shannon limit During the later the more one discovers the ability to control their high error So LDPC code can be used in many pratical application such as radio communications and data storage In particular, LDPC convolutional code have shown the ability to achieve performance better error control.This thesis shows methods create LDPC convolutional codes : time-varying and time-invariant LDPC from LDPC block code The thesis demonstrates LDPC Convolutional code has better performance than the block LDPC code Besides that, the thesis has given model that combines LDPC Convolutional code in MIMO system, the system widely used today, then proceed to analyze the performance of this model Theoretically, we firstly present overview of two platform codes, they have the ability to control very high error used in many practical applications: Block LDPC code and Quasi-Cylcic LDPC In the main part, we present the theory of LDPC Convolutional code, primarily focused on the contruction of parity check matrix H, the encoding and decoding methid for LDPC Convolutional code Besides, we offer constructive solutions parity check matrix H from parity check matrix of Block LDPC code and QC – LDPC And then, we compare overview of LDPC Convolutional code and Block LDPC code and QC – LDPC code In the simulation, the thesis proposed a model with a combination of LDPC Convolutional in MIMO system, compared LDPC Convolutional code and Block LDPC through the bit error ratio (BER) and the ratio Eb/N0 The simulation results HVTH: Phạm Thị Tuyết Trang vii Luan van MSHV: 138520203032 Luận văn thạc sĩ GVHD: PGS.TS Phạm Hồng Liên are made by Min- Sum algorithm with the loop changes, and assess the short LDPC code by changing the length of the code This results have demonstrated the ability to control the system error when using the LDPC Convolutional code and performance of LDPC Convolutional Code better than no coding and the Block LDPC Code HVTH: Phạm Thị Tuyết Trang viii Luan van MSHV: 138520203032 Luận văn thạc sĩ GVHD: PGS.TS Phạm Hồng Liên end end end data_demod1=reshape(data_demod,1,row*col); data_demod2=data_demod1(1,1:numberOfBits); % Bit error rate [n ber(snr)] = biterr(data_demod2, u); end % for snr end Chƣơng trình tính Ber hệ thống dùng mã LDPC CC điều chế BPSK function ber = lpcdcc(iteration,EbN0dB,tx,baseHT,T,numberOfBits,u,v,Ms) for snr = 1:length(EbN0dB) snr % AWGN channel - Noise variance N0 = 1/(exp(EbN0dB(snr)*log(10)/10)); % Received vector - Noise variance is set for bit rate = 1/2 rx = tx + sqrt(N0)*randn(size(tx)); % - Decoding vHat = decodeLdpccc(rx, baseHT, T, N0, iteration); uHat = []; for i = 2:length(v)/(2*(Ms + 1)) - % Get the estimated bits tmp = reshape(vHat(:, i), 2, length(vHat(:, i))/2); uHat = [uHat tmp(1, :)]; end % for i % Bit error rate [n ber(snr)] = biterr(uHat(1:numberOfBits), u); end % for snr end HVTH: Phạm Thị Tuyết Trang 88 Luan van MSHV: 138520203032 Luận văn thạc sĩ GVHD: PGS.TS Phạm Hồng Liên Chƣơng trình đánh giá Ber hệ thống có sử dụng mã LDPC CC, sử dụng mã LDPC khối không dùng mã điều chế BPSK clear all; clc; format long % - Variables -% Convolutional code period T = 128; % Number of data bits numberOfBits = 10000; % Number of iteration iteration = 5; % Eb/N0 in dB EbN0dB = [0 10 15 20]; % - Initialization % Convolutional code memory Ms = T + 1; % Create random binary sequence (0/1) u = round(rand(1, numberOfBits)); % Create base matrix H transpose baseHT = makeBaseLdpccc(T, 2); % - Encoding % Encoded sequence v = encodeLdpccc(u, T, baseHT); % - Modulation and channel % BPSK modulation tx = 2*v - 1; ldpccc = lpcdcc(iteration,EbN0dB,tx,baseHT,T,numberOfBits,u,v,Ms); nocode = nocode(EbN0dB,u,numberOfBits); % LDPC matrix size, rate must be 1/2 % Warning: encoding - decoding can be very long for large LDPC matrix! M = 128; N = 256; % Method for creating LDPC matrix (0 = Evencol; = Evenboth) method = 1; % Eliminate length-4 cycle noCycle = 1; % Number of 1s per column for LDPC matrix onePerCol = 3; HVTH: Phạm Thị Tuyết Trang 89 Luan van MSHV: 138520203032 Luận văn thạc sĩ GVHD: PGS.TS Phạm Hồng Liên % LDPC matrix reorder strategy (0 = First; = Mincol; = Minprod) strategy = 2; % EbN0 in dB EbN0 = [0 10 15 20]; % Number of iteration; iter = 5; % Number of frame (N bits per frame) frame = 40; % Make the LDPC matrix H = makeLdpc(M, N, 1, 1, onePerCol); for i = 1:length(EbN0) ber1(i) = 0; ber2(i) = 0; % Make random data (0/1) dSource = round(rand(M, frame)); for j = 1:frame fprintf('Frame : %d\n', j); % Encoding message [c, newH] = makeParityChk(dSource(:, j), H, strategy); u = [c; dSource(:, j)]; % BPSK modulation bpskMod = 2*u - 1; % Additional white gaussian noise N0 = 1/(exp(EbN0(i)*log(10)/10)); tx = bpskMod + sqrt(N0/2)*randn(size(bpskMod)); % Decoding (select decoding method) %vhat = decodeProbDomain(tx, H, N0, iter); %vhat = decodeLogDomain(tx, newH, N0, iter); %vhat2 = decodeLogDomainSimple(tx, newH, iter); vhat = decodeBitFlip(tx, newH, iter); % Get bit error rate (for brevity, BER calculation includes parity bits) HVTH: Phạm Thị Tuyết Trang 90 Luan van MSHV: 138520203032 Luận văn thạc sĩ GVHD: PGS.TS Phạm Hồng Liên [num1, rat1] = biterr(vhat', u); ber1(i) = (ber1(i) + rat1); %[num2, rat2] = biterr(vhat2', u); %ber2(i) = (ber2(i) + rat2); end % for j % Get average of BER ber1(i) = ber1(i)/frame; % ber2(i) = ber2(i)/frame; end % for i hold on; close all figure semilogy(EbN0dB,ldpccc,'bp-','LineWidth',2); hold on semilogy(EbN0dB,nocode,'kd-','LineWidth',2); semilogy(EbN0, ber1, 'c+-','LineWidth',2); hold on; %semilogy(EbN0, ber2, 'kd-','LineWidth',2); %hold on; grid on; axis([0 10 10^-5 0.5]) legend('ldpccc', 'nocode','ldpc'); xlabel('Eb/No, dB'); ylabel('Bit Error Rate'); title('BER for LDPC-CC,LDPC & No encoder (AWGN channel)'); Chƣơng trình tính Ber hệ thống sử dụng mã LDPC CC điều chế QAM function ber = lpcdccQAM(iteration,EbN0dB,baseHT,T,numberOfBits,u,v,Ms,m) modqam = QAM_mod(v,m); [row,col]=size(modqam); %num=mod(row*col,numcarr); %num1=numcarr-num; for snr = 1:length(EbN0dB) snr % AWGN channel - Noise variance N0 = 1/(exp(EbN0dB(snr)*log(10)/10)); HVTH: Phạm Thị Tuyết Trang 91 Luan van MSHV: 138520203032 Luận văn thạc sĩ GVHD: PGS.TS Phạm Hồng Liên % Received vector - Noise variance is set for bit rate = 1/2 rx = modqam + sqrt(N0)*randn(size(modqam)); data_estimated1=reshape(rx,row*col,1); data_demod=data_estimated1(1:(row*col),1); R=real(data_demod); I=imag(data_demod); data_demod1=[R,I]; data_demod2=reshape(data_demod1,1,row*col*2); % - Decoding vHat = decodeLdpccc(data_demod2, baseHT, T, N0, iteration); uHat = []; for i = 2:length(v)/(2*(Ms + 1)) - % Get the estimated bits tmp = reshape(vHat(:, i), 2, length(vHat(:, i))/2); uHat = [uHat tmp(1, :)]; end % for i % Bit error rate [n ber(snr)] = biterr(uHat(1:numberOfBits), u); end % for snr end Chƣơng trình đánh giá Ber hệ thống sử dụng mã LDPC CC không dùng mã, với phƣơng pháp điều chế QAM clear all; clc; format long m = input ('Nhap kieu dieu che QAM m = '); % - Variables -% Convolutional code period T = 9; % Number of data bits numberOfBits = 10000; % Number of iteration iteration = 5; HVTH: Phạm Thị Tuyết Trang 92 Luan van MSHV: 138520203032 Luận văn thạc sĩ GVHD: PGS.TS Phạm Hồng Liên % Eb/N0 in dB EbN0dB = [0 10 15 20]; % - Initialization % Convolutional code memory Ms = T + 1; % Create random binary sequence (0/1) u = round(rand(1, numberOfBits)); % Create base matrix H transpose baseHT = makeBaseLdpccc(T, 2); % - Encoding % Encoded sequence v = encodeLdpccc(u, T, baseHT); % - Modulation and channel % BPSK modulation tx = 2*v - 1; ldpcccQAM = lpcdccQAM(iteration,EbN0dB,baseHT,T,numberOfBits,u,v,Ms,m); nocodeQAM = nocode2(EbN0dB,u,numberOfBits); % Plot the result %semilogy(EbN0, ber1, 'bp-','LineWidth',2); hold on; %semilogy(EbN0, ber2, 'kd-','LineWidth',2); %hold on; %grid on; %axis([2 10^-5 0.5]) close all figure semilogy(EbN0dB,ldpcccQAM,'bp-','LineWidth',2); hold on semilogy(EbN0dB,nocodeQAM,'kd-','LineWidth',2); hold on; grid on; axis([0 10 10^-5 0.5]) legend('ldpcccQAM', 'nocodeQAM'); xlabel('Eb/No, dB'); ylabel('Bit Error Rate'); title('BER for LDPC-CC& No encode (AWGN channel)'); HVTH: Phạm Thị Tuyết Trang 93 Luan van MSHV: 138520203032 Luận văn thạc sĩ GVHD: PGS.TS Phạm Hồng Liên Chƣơng trình đánh giá Ber hệ thống sử dụng mã LDPC CC hệ thống SISO, SIMO, MISO, MIMO clear all; clc; nRx = 2; % - Variables -% Convolutional code period T = 9; % Number of iteration iteration = 10; % Number of data bits numberOfBits = 10000; % Eb/N0 in dB EbN0dB = [0 10 15 20]; % - Initialization % Convolutional code memory Ms = T + 1; % Create random binary sequence (0/1) u = round(rand(1, numberOfBits)); % Create base matrix H transpose baseHT = makeBaseLdpccc(T, 2); % - Encoding % Encoded sequence v = encodeLdpccc(u, T, baseHT); % - Modulation and channel % BPSK modulation tx = 2*v - 1; % Preparation data s = tx'; si = size(tx); len = si(1)*si(2); for snr = 1:length(EbN0dB) snr % Alamouti STBC sCode = 1/sqrt(2)*kron(reshape(s,2,len/2),ones(1,2)) ; % channel h = 1/sqrt(2)*[randn(nRx,len) + j*randn(nRx,len)]; % Rayleigh channel n = 1/sqrt(2)*[randn(nRx,len) + j*randn(nRx,len)]; % white gaussian noise, 0dB variance HVTH: Phạm Thị Tuyết Trang 94 Luan van MSHV: 138520203032 Luận văn thạc sĩ GVHD: PGS.TS Phạm Hồng Liên y = zeros(nRx,len); yMod = zeros(nRx*2,len); hMod = zeros(nRx*2,len); for kk = 1:nRx hMod = kron(reshape(h(kk,:),2,len/2),ones(1,2)); % repeating the same channel for two symbols hMod = kron(reshape(h(kk,:),2,len/2),ones(1,2)); temp = hMod; hMod(1,[2:2:end]) = conj(temp(2,[2:2:end])); hMod(2,[2:2:end]) = -conj(temp(1,[2:2:end])); % Channel and noise Noise addition y(kk,:) = sum(hMod.*sCode,1) + 10^(-EbN0dB(snr)/20)*n(kk,:); % Receiver yMod([2*kk-1:2*kk],:) = kron(reshape(y(kk,:),2,len/2),ones(1,2)); % forming the equalization matrix hEq([2*kk-1:2*kk],:) = hMod; hEq(2*kk-1,[1:2:end]) = conj(hEq(2*kk-1,[1:2:end])); hEq(2*kk, [2:2:end]) = conj(hEq(2*kk, [2:2:end])); end % equalization hEqPower = sum(hEq.*conj(hEq),1); yHat = sum(hEq.*yMod,1)./hEqPower; % [h1*y1 + h2y2*, h2*y1 -h1y2*, ] yHat(2:2:end) = conj(yHat(2:2:end)); % receiver - hard decision decoding ipHat = real(yHat)>0; % - Decoding vHat = decodeLdpccc(ipHat, baseHT, T, iteration); uHat = []; for i = 2:length(v)/(2*(Ms + 1)) - % Get the estimated bits tmp = reshape(vHat(:, i), 2, length(vHat(:, i))/2); uHat = [uHat tmp(1, :)]; HVTH: Phạm Thị Tuyết Trang 95 Luan van MSHV: 138520203032 Luận văn thạc sĩ GVHD: PGS.TS Phạm Hồng Liên end % for i % Bit error rate [n ber(snr)] = biterr(uHat(1:numberOfBits), u); end EbN0Lin = 10.^(EbN0dB/10); theoryBer_nRx1 = 0.5.*(1-1*(1+1./EbN0Lin).^(-0.5)); p = 1/2 - 1/2*(1+1./EbN0Lin).^(-1/2); theoryBerMRC_nRx2 = p.^2.*(1+2*(1-p)); pAlamouti = 1/2 - 1/2*(1+2./EbN0Lin).^(-1/2); theoryBerAlamouti_nTx2_nRx1 = pAlamouti.^2.*(1+2*(1-pAlamouti)); close all figure semilogy(EbN0dB,theoryBer_nRx1,'bp-','LineWidth',2); hold on semilogy(EbN0dB,theoryBerMRC_nRx2,'kd-','LineWidth',2); semilogy(EbN0dB,theoryBerAlamouti_nTx2_nRx1,'c+-','LineWidth',2); semilogy(EbN0dB,ber,'mo-','LineWidth',2); grid on axis([0 30 10^-5 0.5]) legend('theory (nTx=1,nRx=1)', 'theory (nTx=1,nRx=2, MRC)', 'theory (nTx=2, nRx=1, Alamouti)', 'sim (nTx=2, nRx=2, Alamouti)'); xlabel('Eb/No, dB'); ylabel('Bit Error Rate'); title('BER for BPSK modulation with 2Tx, 2Rx Alamouti STBC (Rayleigh channel)'); Chƣơng trình đánh giá Ber hệ thống sử dụng mã LDPC CC sử dụng mã LDPC khối hệ thống MIMO Alamouti 2x2 clear all; clc; nRx = 2; % - Variables -% Convolutional code period T = 9; % Number of iteration iteration = 10; % Number of data bits numberOfBits = 10000; % Eb/N0 in dB HVTH: Phạm Thị Tuyết Trang 96 Luan van MSHV: 138520203032 Luận văn thạc sĩ GVHD: PGS.TS Phạm Hồng Liên EbN0dB = [0 10 15 20]; % - Initialization % Convolutional code memory Ms = T + 1; % Create random binary sequence (0/1) u = round(rand(1, numberOfBits)); % Create base matrix H transpose baseHT = makeBaseLdpccc(T, 2); % - Encoding % Encoded sequence v = encodeLdpccc(u, T, baseHT); % - Modulation and channel % BPSK modulation tx = 2*v - 1; % Preparation data s = tx'; si = size(tx); len = si(1)*si(2); for snr = 1:length(EbN0dB) snr % Alamouti STBC sCode = 1/sqrt(2)*kron(reshape(s,2,len/2),ones(1,2)) ; % channel h = 1/sqrt(2)*[randn(nRx,len) + j*randn(nRx,len)]; % Rayleigh channel n = 1/sqrt(2)*[randn(nRx,len) + j*randn(nRx,len)]; % white gaussian noise, 0dB variance y = zeros(nRx,len); yMod = zeros(nRx*2,len); hMod = zeros(nRx*2,len); for kk = 1:nRx hMod = kron(reshape(h(kk,:),2,len/2),ones(1,2)); % repeating the same channel for two symbols hMod = kron(reshape(h(kk,:),2,len/2),ones(1,2)); temp = hMod; hMod(1,[2:2:end]) = conj(temp(2,[2:2:end])); hMod(2,[2:2:end]) = -conj(temp(1,[2:2:end])); HVTH: Phạm Thị Tuyết Trang 97 Luan van MSHV: 138520203032 Luận văn thạc sĩ GVHD: PGS.TS Phạm Hồng Liên % Channel and noise Noise addition y(kk,:) = sum(hMod.*sCode,1) + 10^(-EbN0dB(snr)/20)*n(kk,:); % Receiver yMod([2*kk-1:2*kk],:) = kron(reshape(y(kk,:),2,len/2),ones(1,2)); % forming the equalization matrix hEq([2*kk-1:2*kk],:) = hMod; hEq(2*kk-1,[1:2:end]) = conj(hEq(2*kk-1,[1:2:end])); hEq(2*kk, [2:2:end]) = conj(hEq(2*kk, [2:2:end])); end % equalization hEqPower = sum(hEq.*conj(hEq),1); yHat = sum(hEq.*yMod,1)./hEqPower; % [h1*y1 + h2y2*, h2*y1 -h1y2*, ] yHat(2:2:end) = conj(yHat(2:2:end)); % receiver - hard decision decoding ipHat = real(yHat)>0; % - Decoding vHat = decodeLdpccc(ipHat, baseHT, T, iteration); uHat = []; for i = 2:length(v)/(2*(Ms + 1)) - % Get the estimated bits tmp = reshape(vHat(:, i), 2, length(vHat(:, i))/2); uHat = [uHat tmp(1, :)]; end % for i % Bit error rate [n ber(snr)] = biterr(uHat(1:numberOfBits), u); end EbN0Lin = 10.^(EbN0dB/10); theoryBer_nRx1 = 0.5.*(1-1*(1+1./EbN0Lin).^(-0.5)); p = 1/2 - 1/2*(1+1./EbN0Lin).^(-1/2); theoryBerMRC_nRx2 = p.^2.*(1+2*(1-p)); HVTH: Phạm Thị Tuyết Trang 98 Luan van MSHV: 138520203032 Luận văn thạc sĩ GVHD: PGS.TS Phạm Hồng Liên pAlamouti = 1/2 - 1/2*(1+2./EbN0Lin).^(-1/2); theoryBerAlamouti_nTx2_nRx1 = pAlamouti.^2.*(1+2*(1-pAlamouti)); % The MIMO system's design can refer my following book % [1] Yang Xiao, MIMO Multiple Antenna Wireless Communication Systems, Press of Posts and Telecommunications, Beijing, 2009 % Different from the MIMO scheme of IEEE 802.16e, our MIMO-LDPC system has no space-time coding, % while it achieved good BER performance % %clear; p=43; %p is the prime number of rank of sub-matrices of parity check matrix; k2=3; % k is the row weight of parity check matrix; j2=6; % j is the column weight of parity check matrix; M=k2*p; % M is the number of row of parity check matrix; N=j2*p; % N is the number of column of parity check matrix; NT1=1; E0=eye(p); EZ=zeros(p); a=3; b=5; R=0.5; % coding rate frame_num =1; Npf=2*N*frame_num dlta=1/Npf; EZ=zeros(p); E0=eye(p); % The design of parity check matrix of QC LDPC without girth_4, see my book E11=E0; E12=circshift(E0,a*NT1); E13= circshift(E0,a^2*NT1); E14= circshift(E0,a^3*NT1); E15= circshift(E0,a^4*NT1); E16= circshift(E0,a^5*NT1); E21=EZ; E22=E0; E23=circshift(E0,a^2*b*NT1); E24=circshift(E0,a^3*b*NT1); E25= circshift(E0,a^4*b*NT1); E26= circshift(E0,a^5*b*NT1); E31=circshift(E0,b^2*NT1);E32=EZ; E33=E0; E34=circshift(E0,b^2*a^3*NT1);E35= circshift(E0,b^2*a^4*NT1);E36= circshift(E0,b^2*a^5*NT1); h1=[E11 E12 E13 E14 E15 E16; HVTH: Phạm Thị Tuyết Trang 99 Luan van MSHV: 138520203032 Luận văn thạc sĩ GVHD: PGS.TS Phạm Hồng Liên E21 E22 E23 E24 E25 E26; E31 E32 E33 E34 E35 E36]; A(:,1:M)=h1(:,1:M); B(:,1:M)=h1(:,M+1:N); % d=mod(inv_GF2(A)*B,2); E00=eye(M); % The generator matrix of QC LDPC, see my book G=[d' E00]; H=sparse(h1); N1=0; N2=30; % Flat fading MIMO Channel h11=0.9; h12=0.3; h21=0.4; h22=0.73; SNRindB1=N1:1:N2; for i=1:length(SNRindB1) error_count1= 0; error_count2= 0; for f_n = 1:frame_num SNR=(10^(SNRindB1(i)/10)); sigma = 1/sqrt(2*R*SNR); x1 = (sign(randn(1,size(G,1)))+1)/2; % random information bits x2 = (sign(randn(1,size(G,1)))+1)/2; % random information bits y1 = mod(x1*G,2); % LDPC Encoding for signal_1 from atenna of the transmitter y2 = mod(x2*G,2); % LDPC Encoding for signal_2 from atenna of the transmitter z1=2*y1-1; % BPSK modulation z2=2*y2-1; % BPSK modulation z11=h11*z1+h12*z2+sigma*randn(1,size(G,2)); % AWGN transmission z22=h21*z1+h22*z2+sigma*randn(1,size(G,2)); HC=[h11 h12;h21 h22]; % Channel Matrix HC1=HC^(-1); u=HC1*[z11;z22]; % ZF spatial decoding u1=u(1,:); % recieved signal_1 from atenna of the receiver u2=u(2,:); % recieved signal_2 from atenna of the receiver HVTH: Phạm Thị Tuyết Trang 100 Luan van MSHV: 138520203032 Luận văn thạc sĩ GVHD: PGS.TS Phạm Hồng Liên f11=1./(1+exp(-2*u1/sigma^2)); % likelihoods f01=1-f11; [z1_hat, success, k] = ldpc_decode(f01,f11,H); % LDPC decoding for signal_1 x1_hat = z1_hat(size(G,2)+1-size(G,1):size(G,2)); x1_hat1 = x1_hat'; f12=1./(1+exp(-2*u2/sigma^2)); % likelihoods f02=1-f12; [z2_hat, success, k] = ldpc_decode(f02,f12,H); % LDPC decoding for signal_2 x2_hat = z2_hat(size(G,2)+1-size(G,1):size(G,2)); x2_hat1 = x2_hat'; error_count2= sum(xor(x1,x1_hat1))+sum(xor(x2,x2_hat1)); % bit error count error_count1 = error_count1 + error_count2; end BER(i)= error_count1/Npf if BER(i)

Ngày đăng: 02/02/2023, 10:01

Xem thêm: