OMP信道估计基于OMP压缩感知的信道估计算法的MATLAB仿真
Posted fpga&matlab
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了OMP信道估计基于OMP压缩感知的信道估计算法的MATLAB仿真相关的知识,希望对你有一定的参考价值。
1.软件版本
MATLAB2021a
2.本算法理论知识
3.核心代码
clc;
clear;
close all;
warning off;
addpath 'func\\'
CYC = 20;
for ij = 1:CYC
ij
CYC = 20;
RandStream.setDefaultStream(RandStream('mt19937ar','seed',ij));
Len = 8;
Nc = 64*Len;%子载波数
T = 6.4e-6;
TG = 1.6e-6;
fLen = 512;
I = 4;
%导频坐标
pilot_index = [1:I:Nc];
N = Nc;%总载波数
[Rm,Cn] = size(pilot_index);%导频子载波数
%多普勒频移
doppler_frequency = 0.01;
ts = 1e-6;
%保护时间
CP = Nc/Len/(T/TG);
C = 2;
SNR_dB = [0:2:20];
err_rate = ones(C,length(SNR_dB));
ERR_RATE = ones(1,length(SNR_dB));
ERR_RATE2 = ones(1,length(SNR_dB));
ERR_RATE3 = ones(1,length(SNR_dB));
h1 = zeros(N,1);
h2 = zeros(N,1);
%多径个数
multipath_number = 3;
delay = [0,1e-6,2e-6]/ts;%各径延迟
trms = 4e-6/ts; %多径平均延迟
var_pow = 10*log10(exp(-delay/trms));
RLchannel = rayleighchan(1,doppler_frequency,delay,var_pow);
RLchannel.StorePathGains = 1;
test = ones(C,1);%测试向量
filter(RLchannel,test);
%提取瑞利信道
h_RL = RLchannel.PathGains;
for ii=1:C
x_Trans = randint(N,1,4);
%QPSK调制
X = func_QPSK_mod(x_Trans);
%待传输信号
x = func_OFDM_mod(X,fLen,CP,Nc);
%信道
for hh=1:multipath_number;
h1(1+delay(hh))= h_RL(ii,hh);%信道的冲击响应
end
%H为根据22计算得到的H
H = fft(h1,fLen);
%收到的信号
y_r = filter(h1,1,x);
for SNR_index=1:length(SNR_dB);
%加噪声
y = awgn(y_r,SNR_dB(SNR_index),'measured');
%去CP
y0 = y(CP+1:CP+Nc,1);
Y = fft(y0);
%你所要求的不太对的函数写法
est_H = ChannelEstimation(SNR_dB(SNR_index),1,delay,doppler_frequency,var_pow);
%CS信道估计,H_esti为估计得到的H
[H_esti,h2] = func_omp(Y,X,Nc,fLen,pilot_index,multipath_number);
%计算估计得到的Ap部分
Ap = abs(h2);
%计算估计得到的exp部分
exps = angle(h2);
%估计的导频加信号的值
X_esti = Y./H_esti;
x_omp_rec = func_QPSK_demod(X_esti);
[err_number,err_rate(ii,SNR_index)] = symerr(x_Trans,x_omp_rec);
err_num(ii,SNR_index) = sum(sum(cov(x_Trans,x_omp_rec)));
mse_num(ii,SNR_index) = mse(abs(h1(1:multipath_number)-h2(1:multipath_number)));
end
end
for jj=1:length(SNR_dB);
ERR_RATE(1,jj) = mean(err_rate(:,jj));
ERR_RATE2(1,jj)= mean(err_num(:,jj));
ERR_RATE3(1,jj)= mean(mse_num(:,jj));
end
S1 = [];
S2 = [];
S3 = [];
if ij > 1
load func\\tmps.mat
end
S1 = [S1;ERR_RATE];
S2 = [S2;ERR_RATE2];
S3 = [S3;ERR_RATE3];
save func\\tmps.mat S1 S2 S3 SNR_dB
addpath 'func\\'
end
load func\\tmps.mat
ERR_RATEs = mean(S1,1);
ERR_RATE2s = mean(S2,1);
ERR_RATE3s = mean(S3,1);
figure;
plot(SNR_dB,ERR_RATE2s/max(ERR_RATE2s),'b-s');
hold on;
xlabel('SNR');
ylabel('信号相关性');
grid on;
figure;
semilogy(SNR_dB,ERR_RATEs,'b-s');
hold on;
xlabel('SNR');
ylabel('系统误码率');
grid on;
figure;
semilogy(SNR_dB,ERR_RATE3s,'b-s');
hold on;
xlabel('SNR');
ylabel('信道估计H 估计误差');
grid on;
save R.mat SNR_dB ERR_RATEs ERR_RATE2s ERR_RATE3s
%显示原始信道和估计后的信道
ho = h1(1:multipath_number);
hest = h2(1:multipath_number);
ho
hest
4.操作步骤与仿真结论
5.参考文献
[1]赵锦航, 刘健均, 周思源,等. 基于BIC停止准则的改进A*OMP信道估计算法[J]. 计算机应用与软件, 2019, 36(5):6.
[2]朱芹, 王彪. 基于改进BOMP算法的水声信道估计[J]. 2022(8).
A01-102
6.完整源码获得方式
订阅MATLAB/FPGA教程,免费获得教程案例以及任意2份完整源码
以上是关于OMP信道估计基于OMP压缩感知的信道估计算法的MATLAB仿真的主要内容,如果未能解决你的问题,请参考以下文章
m基于rbf神经网络和遗传算法优化的MIMO-OFDM系统信道估计算法matlab仿真
压缩感知合集9压缩感知的OMP算法(算法步骤分析举例分析说明总结和缺陷)
信道估计均衡基于FPGA的MMSE信道估计均衡verilog实现