代做matlab和similink仿真,MATLAB代做|FPGA代做|simulink代做--MIMO-OFDM系统的仿真与分析...

资源简介:

MATLAB程序下载——一MIMO-OFDM系统的仿真与分析。

clear

clc

tic

N  =64;

GI = N/4;           % guard interval length保护间隔长度4

M  = 4;             % modulation调制阶数

L  = 4;            % channel length信道长度(h1,h2,h3,h4,h5估计信道就是估计这五个数据)

nIteration = 100;    % number of iteration in each evaluation每一估计的迭代(循环,重复)次数

SNR_V = [0:2:18];   % signal to noise ratio vector in dB信噪比向量(单位dB)

ber = zeros(1,length(SNR_V));

% +++++++++++++++fft matrix+++++++++++++++++++++++++++++++++++++++++++++++++

F = exp(2*pi*sqrt(-1)/N .* meshgrid([0:N-1],[0:N-1]).* repmat([0:N-1]',[1,N]));

for( ii = 1 : length(SNR_V))  %10层循环(取了10个SNR值来做估计)

SNR = SNR_V(ii);

sig = sqrt(0.5/(10^(SNR/10)));

for(k = 1 : nIteration)

h11(1:L,1)=random('Normal',0,1,L,1) +1i * random('Normal',0,1,L,1);

h21(1:L,1)=random('Normal',0,1,L,1) +1i * random('Normal',0,1,L,1);

TrDataBit = randint(N,1,M);

TrDataMod = qammod(TrDataBit,M);

TrDataIfft = ifft(TrDataMod,N);

TrDataIfftGi = [TrDataIfft(N-GI+1:N);TrDataIfft];

%+++++++++++ tx Data发射数据++++++++++++++++++++++++++++++++++++++++++++++

TxDataIfftGi11 = filter(h11,1,TrDataIfftGi);

TxDataIfftGi21 = filter(h21,1,TrDataIfftGi);

%++++++++++ adding awgn noise(加入高斯噪声----就代表经过高斯信道传输后的接受信号)++++++++++++++

TxDataIfftGiNoise11 = awgn(TxDataIfftGi11,SNR-db(std(TxDataIfftGi11)));

TxDataIfftGiNoise21 = awgn(TxDataIfftGi21,SNR-db(std(TxDataIfftGi21)));

%+++++++++++++去保护间隔(去掉被干扰IC污染的信号,即完全去掉了干扰IC的影响)++++++++++++++++++++++++++++++++++++

TxDataIfft11  = TxDataIfftGiNoise11(GI+1:N+GI);

TxDataIfft21  = TxDataIfftGiNoise21(GI+1:N+GI);

%+++++++++++++++做FFT(转到频域)+++++++++++++++++++++++++++++++++++++

TxDataMod11 = fft(TxDataIfft11,N);

TxDataMod21 = fft(TxDataIfft21,N);

% +++++++Channel estimation(利用导频进行信道估计)+++++++++++++++++++++++++++++++++++

h_f11=fft(h11,N);

h_f21=fft(h21,N);

for p = 1:N

H = [h_f11(p) ; h_f21(p) ];% MIMO channel freuqncy channel

G=inv(H'*H+(sig^2)*eye(1))*H';

y=G*[TxDataMod11(p,:) ;TxDataMod21(p,:)];

y2=H'*[TxDataMod11(p,:) ;TxDataMod21(p,:)];

S(p,:)=y2(1,:);

S_est(p,:)=y(1,:);

end

TxDataBit   = qamdemod(S_est,M);%利用了循环卷积的特点,利用理想的信道系数计算的接受信号

TxDataBit2   = qamdemod(S,M);

%++++++++++ bit error rate computation(BER的计算)++++++++++++++

[nErr bErr(ii,k)] = symerr(TxDataBit,TrDataBit);%理想情况下的接收信号与发射信号的码字错误性分析

[nErr2 bErr2(ii,k)] = symerr(TxDataBit2,TrDataBit);

end

end

f1 = figure(1);

h = gcf; grid on; hold on;

set(gca, 'yscale', 'log', 'xlim', [SNR_V(1), SNR_V(end)], 'ylim', [1e-4 1]);

%set(f1,'color',[1 1 1]);%设置图像为三维(RGB)彩色图,可以不要此语句

semilogy(SNR_V,mean(bErr'),'r-+');

semilogy(SNR_V,mean(bErr2'),'b-*');

hold on% semilogy创建对数坐标

xlabel('SNR in dB');

ylabel('Bit Error Rate')

hold off

toc

下载:

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
MIMO OFDM Simulator: OFDM.m: OFDM Simulator (outer function) create_channel.m: Generates a Rayleigh fading frequency-selective channel, parametrized by the antenna configuration, the OFDM configuration, and the power-delay profile. svd_decompose_channel.m: Since full channel knowledge is assumed, transmission is across parallel singular value modes. This function decomposes the channel into these modes. BitLoad.m: Apply the bit-loading algorithm to achieve the desired bit and energy allocation for the current channel instance. ComputeSNR.m: Given the subcarrier gains, this simple function generates the SNR values of each channel (each singular value on each tone is a separate channel). chow_algo.m: Apply Chow's algorithm to generate a particular bit and energy allocation. EnergyTableInit.m: Given the SNR values, form a table of energy increments for each channel. campello_algo.m: Apply Campello's algorithm to converge to the optimal bit and energy allocation for the given channel conditions. ResolvetheLastBit.m: An optimal bit-loading of the last bit requires a unique optimization. modulate.m: Modulate the random input sequence according to the bit allocations for each channel. ENC2.mat: BPSK Modulator ENC4.mat: 4-QAM Modulator (Gray coded) ENC16.mat: 16-QAM Modulator (Gray coded) ENC64.mat: 64-QAM Modulator (Gray coded) ENC256.mat: 256-QAM Modulator (Gray coded) precode.m: Precode the transmitted vector at each time instance by filtering the modulated vector with the right-inverse of the channel's right singluar matrix. ifft_cp_tx_blk.m: IFFT block of the OFDM system. channel.m: Apply the channel to the OFDM frame. fft_cp_rx_blk.m: FFT block of the OFDM system. shape.m: Complete the diagonalization of the channel by filtering the received vector with the left-inverse of the channel's left singular matrix. demodulate.m: Perform a nearest neighbor search knowing the transmit constellation used.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值