OTFS系统建模、通信性能分析、信道估计、模糊函数【附MATLAB代码】

news2024/11/27 16:43:42

文献来源:​微信公众号:EW Frontier

OTFS简介

OTFS信道估计

% Clear command window, workspace variables, and close all figures
clc; 
clear all; 
close all;
​
% Define Eb values in dB
EbdB = -10:2:10;
​
% Convert Eb values from dB to linear scale
Eb = 10.^(EbdB/10);
​
% Define Noise Power
No = 1;
​
% Calculate Signal-to-Noise Ratio (SNR) in linear scale
SNR = 2*Eb/No;
​
% Convert SNR to dB scale
SNRdB = 10*log10(SNR);
​
% Define matrix dimensions and parameters
M = 32; 
N = 16;
Ptx = eye(M); 
Prx = eye(M);
nTaps = 5;
DelayTaps = [0 1 2 3 4];
DopplerTaps = [0 1 2 3 4];
Ncp = max(DelayTaps);
​
% Initialize arrays to store Bit Error Rate (BER) for different methods
BER_MMSE = zeros(length(Eb),1);
BER_ZF = zeros(length(Eb),1);
​
% Number of iterations for Monte Carlo simulation
ITER = 10;
​
% Precompute matrices for transformation
F_M = 1/sqrt(M)*dftmtx(M);
F_N = 1/sqrt(N)*dftmtx(N);
​
% Main loop for Monte Carlo simulation
for ite = 1:ITER
    ite
    
    % Generate random bits for transmission
    XddBits = randi([0,1],M,N);
    
    % Generate random channel taps
    h = sqrt(1/2)*(randn(1,nTaps)+ 1j*randn(1,nTaps));
    
    % Construct effective channel matrix
    Hmat = zeros(M*N,M*N);
    omega = exp(1j*2*pi/(M*N));
    for tx = 1:nTaps
        Hmat = Hmat + h(tx)*circshift(eye(M*N),DelayTaps(tx))*...
            (diag(omega.^((0:M*N-1)*DopplerTaps(tx))));
    end
    Heff = kron(F_N,Prx)*Hmat*kron(F_N',Ptx);
    
    % Generate Complex Noise
    ChNoise = sqrt(No/2)*(randn(1,M*N) + 1j*randn(1,M*N));
    
    % Loop over different Eb/N0 values
    for ix = 1:length(Eb)
        % Generate modulated symbols
        X_DD = sqrt(Eb(ix))*(2*XddBits-1); 
        X_TF = F_M*X_DD*F_N';
        S_mat = Ptx*F_M'*X_TF;        
        TxSamples = reshape(S_mat,M*N,1).';
        TxSamplesCP = [TxSamples(M*N-Ncp+1:M*N) TxSamples];
        
        % Channel filtering
        RxsamplesCP = 0;
        for tx = 1:nTaps
            Doppler = exp(1j*2*pi/M*(-Ncp:M*N-1)*DopplerTaps(tx)/N);
            RxsamplesCP = RxsamplesCP + h(tx)*circshift(TxSamplesCP.*Doppler,[1, DelayTaps(tx)]);
        end
        
        % Remove cyclic prefix
        Rxsamples = RxsamplesCP(Ncp+1:M*N+Ncp) + ChNoise;
        R_mat = reshape(Rxsamples.',M, N) ;
        Y_TF = F_M*Prx*R_mat;
        Y_DD = F_M'*Y_TF*F_N;
        y_DD = reshape(Y_DD, M*N, 1) ;
        
        % MMSE Equalization
        xhatMMSE = inv(Heff'*Heff + eye(M*N)/Eb(ix))*Heff'*y_DD;
        DecodedBits = (real(xhatMMSE) >= 0);
        BER_MMSE(ix) = BER_MMSE(ix) + sum(DecodedBits ~= reshape(XddBits,M*N,1));
        
        % Zero Forcing (ZF) Equalization
        xhatZF = pinv(Heff)*y_DD;
        DecodedBits = (real(xhatZF) >= 0);
        BER_ZF(ix) = BER_ZF(ix) + sum(DecodedBits ~= reshape(XddBits,M*N,1));
    end
end
​
% Average BER over iterations and symbols
BER_MMSE = BER_MMSE/M/N/ITER;
BER_ZF = BER_ZF/M/N/ITER;
​
% Plot BER versus SNR
semilogy(EbdB,BER_MMSE,'b-s','linewidth',3.0,'MarkerFaceColor','b','MarkerSize',9.0);
hold on; 
grid on; 
semilogy(EbdB,BER_ZF,'r-o','linewidth',3.0,'MarkerFaceColor','r','MarkerSize',9.0);
axis tight;
legend('MMSE','ZF');
title('OTFS BER v/s SNR');
xlabel('SNR(dB)'); 
ylabel('BER');
​

OTFS系统建模

% Clear command window, workspace variables, and close all figures
clc; 
clear all; 
close all;
​
% Define Eb values in dB
EbdB = -10:2:10;
​
% Convert Eb values from dB to linear scale
Eb = 10.^(EbdB/10);
​
% Define Noise Power
No = 1;
​
% Calculate Signal-to-Noise Ratio (SNR) in linear scale
SNR = 2*Eb/No;
​
% Convert SNR to dB scale
SNRdB = 10*log10(SNR);
​
% Define matrix dimensions and parameters
M = 32; 
N = 16;
Ptx = eye(M); 
Prx = eye(M);
nTaps = 5;
DelayTaps = [0 1 2 3 4];
DopplerTaps = [0 1 2 3 4];
Ncp = max(DelayTaps);
​
% Initialize arrays to store Bit Error Rate (BER) for different methods
BER_MMSE = zeros(length(Eb),1);
BER_ZF = zeros(length(Eb),1);
​
% Number of iterations for Monte Carlo simulation
ITER = 10;
​
% Precompute matrices for transformation
F_M = 1/sqrt(M)*dftmtx(M);
F_N = 1/sqrt(N)*dftmtx(N);
​
% Main loop for Monte Carlo simulation
for ite = 1:ITER
    ite
    
    % Generate random bits for transmission
    XddBits = randi([0,1],M,N);
    
    % Generate random channel taps
    h = sqrt(1/2)*(randn(1,nTaps)+ 1j*randn(1,nTaps));
    
    % Construct effective channel matrix
    Hmat = zeros(M*N,M*N);
    omega = exp(1j*2*pi/(M*N));
    for tx = 1:nTaps
        Hmat = Hmat + h(tx)*circshift(eye(M*N),DelayTaps(tx))*...
            (diag(omega.^((0:M*N-1)*DopplerTaps(tx))));
    end
    Heff = kron(F_N,Prx)*Hmat*kron(F_N',Ptx);
    
    % Generate Complex Noise
    ChNoise = sqrt(No/2)*(randn(1,M*N) + 1j*randn(1,M*N));
    
    % Loop over different Eb/N0 values
    for ix = 1:length(Eb)
        % Generate modulated symbols
        X_DD = sqrt(Eb(ix))*(2*XddBits-1); 
        X_TF = F_M*X_DD*F_N';
        S_mat = Ptx*F_M'*X_TF;        
        TxSamples = reshape(S_mat,M*N,1).';
        TxSamplesCP = [TxSamples(M*N-Ncp+1:M*N) TxSamples];
        
        % Channel filtering
        RxsamplesCP = 0;
        for tx = 1:nTaps
            Doppler = exp(1j*2*pi/M*(-Ncp:M*N-1)*DopplerTaps(tx)/N);
            RxsamplesCP = RxsamplesCP + h(tx)*circshift(TxSamplesCP.*Doppler,[1, DelayTaps(tx)]);
        end
        
        % Remove cyclic prefix
        Rxsamples = RxsamplesCP(Ncp+1:M*N+Ncp) + ChNoise;
        R_mat = reshape(Rxsamples.',M, N) ;
        Y_TF = F_M*Prx*R_mat;
        Y_DD = F_M'*Y_TF*F_N;
        y_DD = reshape(Y_DD, M*N, 1) ;
        
        % MMSE Equalization
        xhatMMSE = inv(Heff'*Heff + eye(M*N)/Eb(ix))*Heff'*y_DD;
        DecodedBits = (real(xhatMMSE) >= 0);
        BER_MMSE(ix) = BER_MMSE(ix) + sum(DecodedBits ~= reshape(XddBits,M*N,1));
        
        % Zero Forcing (ZF) Equalization
        xhatZF = pinv(Heff)*y_DD;
        DecodedBits = (real(xhatZF) >= 0);
        BER_ZF(ix) = BER_ZF(ix) + sum(DecodedBits ~= reshape(XddBits,M*N,1));
    end
end
​
% Average BER over iterations and symbols
BER_MMSE = BER_MMSE/M/N/ITER;
BER_ZF = BER_ZF/M/N/ITER;
​
% Plot BER versus SNR
semilogy(EbdB,BER_MMSE,'b-s','linewidth',3.0,'MarkerFaceColor','b','MarkerSize',9.0);
hold on; 
grid on; 
semilogy(EbdB,BER_ZF,'r-o','linewidth',3.0,'MarkerFaceColor','r','MarkerSize',9.0);
axis tight;
legend('MMSE','ZF');
title('OTFS BER v/s SNR');
xlabel('SNR(dB)'); 
ylabel('BER');
​


OTFS系统建模
clc; clear all; close all;
% SIGNAL MODEL OF OTFS
M = 32; N = 32;                 %M-> no. of subcarriers/delay bins ; N-> no. of symbols/doppler bins
F_M = 1/sqrt(M)*dftmtx(M);      %disrete fourier transform matrix (normalised)   
F_N = 1/sqrt(N)*dftmtx(N);      %forms the grid
Ptx = eye(M);
delta_f = 15e3;                 %subcarrier BW
T = 1/delta_f;                  %OFDM symbol Duration
​
                   
X_DD = zeros(M,N);              %Delay Doppler Grid
X_DD(3, 3) = 1;                 %impulse in DD Domain
X_TF = F_M*X_DD*F_N';            
S = Ptx*F_M'
*X_TF;
s = reshape(S,M*N,1);
​
​
​
​
% figure()
subplot(4,2,[1,2,3,4])
bar3(X_DD);
axis tight;
xlabel('Doppler'); 
ylabel('Delay');
title('Basis function in DD-domain');
​
% figure()
subplot(4,2,5)
surf(real(X_TF));
axis tight;
xlabel('Time'); 
ylabel('Subcarrier');
title('Basis function in TF-domain (Real)');
​
% figure()
subplot(4,2,6)
surf(imag(X_TF));
axis tight;
xlabel('Time'); 
ylabel('Subcarrier');
title('Basis function in TF-domain (Imag)');
​
% figure()
subplot(4,2,7)
plot((0:length(s)-1)*T/M,real(s));
axis tight;
ylim([-0.5 0.5]);
xlabel('Time');
title('Basis function in time-domain (Real)');
​
% figure()
subplot(4,2,8)
plot((0:length(s)-1)*T/M,imag(s));
axis tight;
ylim([-0.5 0.5]);
xlabel('Time');
title('Basis function in time-domain (Imag)');
​

OTFS系统性能部分代码

% Clear command window, workspace variables, and close all figures
clc; 
clear all; 
close all;
​
% Define Eb values in dB
EbdB = 2;
​
% Convert Eb values from dB to linear scale
Eb = 10.^(EbdB/10);
​
% Define Noise Power
No = 1;
​
% Calculate Signal-to-Noise Ratio (SNR) in linear scale
SNR = 2*Eb/No;
​
% Convert SNR to dB scale
SNRdB = 10*log10(SNR);
​
% Define matrix dimensions and parameters
M = 32; 
N = 16;
Ptx = eye(M); 
Prx = eye(M);
nTaps = 5;
DelayTaps = [5 1 0 3 4];
DopplerTaps = [0 3 2 3 4];
Ncp = max(DelayTaps);
​
​
% Precompute matrices for transformation
F_M = 1/sqrt(M)*dftmtx(M);
F_N = 1/sqrt(N)*dftmtx(N);
​
% Generate random bits for transmission
XddBits = randi([0,1],M,N);
​
% Generate random channel taps
h = sqrt(1/2)*(randn(1,nTaps)+ 1j*randn(1,nTaps));
​
% Construct effective channel matrix
Hmat = zeros(M*N,M*N);
omega = exp(1j*2*pi/(M*N));
for tx = 1:nTaps
    Hmat = Hmat + h(tx)*circshift(eye(M*N),DelayTaps(tx))*...
        (diag(omega.^((0:M*N-1)*DopplerTaps(tx))));
end
Heff = kron(F_N,Prx)*Hmat*kron(F_N',Ptx);
    
% Generate Complex Noise
ChNoise = sqrt(No/2)*(randn(1,M*N) + 1j*randn(1,M*N));
    
% Generate modulated symbols
X_DD = sqrt(Eb)*(2*XddBits-1); 
X_TF = F_M*X_DD*F_N';
S_mat = Ptx*F_M'*X_TF;        
TxSamples = reshape(S_mat,M*N,1).';
TxSamplesCP = [TxSamples(M*N-Ncp+1:M*N) TxSamples];
​
% Channel filtering
RxsamplesCP = 0;
for tx = 1:nTaps
    Doppler = exp(1j*2*pi/M*(-Ncp:M*N-1)*DopplerTaps(tx)/N);
    RxsamplesCP = RxsamplesCP + h(tx)*circshift(TxSamplesCP.*Doppler,[1, DelayTaps(tx)]);
end
​
% Remove cyclic prefix
Rxsamples = RxsamplesCP(Ncp+1:M*N+Ncp) + ChNoise;
R_mat = reshape(Rxsamples.',M, N) ;
Y_TF = F_M*Prx*R_mat;
Y_DD = F_M'*Y_TF*F_N;
y_DD = reshape(Y_DD, M*N, 1) ;
​
% MMSE Equalization
xhatMMSE = inv(Heff'*Heff + eye(M*N)/Eb)*Heff'*y_DD;
DecodedBits_MMSE = (real(xhatMMSE) >= 0);
DecodedBits_MMSE_reshaped = reshape(DecodedBits_MMSE,M,N);
BER_MMSE_Map = (DecodedBits_MMSE_reshaped ~= XddBits);
BER_MMSE = sum(DecodedBits_MMSE ~= reshape(XddBits,M*N,1));
​

OTFS模糊函数部分代码

% Clear command window, workspace variables, and close all figures
clc; 
clear all; 
close all;
​
% Define Eb values in dB
EbdB = 3;
​
% Convert Eb values from dB to linear scale
Eb = 10.^(EbdB/10);
​
% Define Noise Power
No = 1;

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1708548.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【计算机毕业设计】基于SSM++jsp的汽车客运站管理系统【源码+lw+部署文档】

目录 第1章 绪论 1.1 课题背景 1.2 课题意义 1.3 研究内容 第2章 开发环境与技术 2.1 MYSQL数据库 2.2 JSP技术 2.3 SSM框架 第3章 系统分析 3.1 可行性分析 3.1.1 技术可行性 3.1.2 经济可行性 3.1.3 操作可行性 3.2 系统流程 3.2.1 操作流程 3.2.2 登录流程 3.2.3 删除信息流…

【iOS】didReceiveMemoryWarning实例方法

iPhone下每个App可用的内存是被限制的,如果一个App使用的内存超过20M,则系统会向该App发送Memory Warning(内存警告)消息,收到此消息后,App必须正确处理,否则可能出错或出现内存泄漏。 目录 流程…

查询DQL

016条件查询之等量关系 条件查询语法格式 select ... from... where过滤条件;等于 select empno, ename from emp where sal3000;select job, sal from emp where enameFORD;select grade, losal, hisal from salgrade where grade 1;不等于 <> 或 ! selectempno,en…

JS逆向之企名科技

文章目录 初步分析定位js编写完整代码参考文献初步分析 目标网址:企名科技 抓包分析,发现是post请求 请求代码如下: #!/usr/bin/env python3 # -*- coding: utf-8 -*- import requestsheaders = {Connection:

MySQL 数据类型和搜索引擎

文章目录 【 1. 数据类型 】1.1 数值类型1.1.1 整型1.1.2 小数1.1.3 数值类型的选择 1.2 日期和时间YEAR 年TIME 时间DATE 日期DATETIME 日期时间TIMESTAMP 时间戳日期和时间的选择 1.3 文本字符串CHAR 固定字符串、VARCHAR 可变字符串TEXT 文本ENUM 枚举SET 集合字符串类型的选…

错误提示:“由于找不到steam_api.dll,无法继续执行代码”修复方法,缺少steam_api.dll文件原因

在尝试运行某些游戏或程序时&#xff0c;用户可能会遇到一个常见的错误提示&#xff1a;“由于找不到steam_api.dll&#xff0c;无法继续执行代码”。这个错误信息表明&#xff0c;系统在启动程序或游戏时无法定位到必要的steam_api.dll文件&#xff0c;这是一个关键的动态链接…

SwiftUI初探

SwiftUI 虽然出现了好几年(1.0好像2019年出的&#xff0c;还有SPM也是同一年)&#xff0c;现在已经到从1.0到5.0&#xff0c;但受限于对系统的要求(最低iOS13.0,有的要求17.0及以上)&#xff0c;每个版本里面差异也很大&#xff0c;语法和Flutter 的Dart 比较像。空闲之余可以先…

黑马es0-1实现自动补全功能

1、安装分词器 上github上找人做好的分词器&#xff0c;放到es-plugin数据卷里&#xff0c;然后重启es即可 2、自定义分词器 elasticsearch中分词器(analyzer)的组成包含三部分: character filters:在tokenizer之前对文本进行处理。例如删除字符、替换字符 …

【Python编程实战】基于Python语言实现学生信息管理系统

&#x1f3a9; 欢迎来到技术探索的奇幻世界&#x1f468;‍&#x1f4bb; &#x1f4dc; 个人主页&#xff1a;一伦明悦-CSDN博客 ✍&#x1f3fb; 作者简介&#xff1a; C软件开发、Python机器学习爱好者 &#x1f5e3;️ 互动与支持&#xff1a;&#x1f4ac;评论 &…

若依ruoyi-vue element-ui 横向滚动条 动态横向滚动条

动态横向滚动条 因为每次横向滑动都要到底部&#xff0c;引入插件 https://github.com/mizuka-wu/el-table-horizontal-scroll //动态横向滚动条移入样式 .el-table-horizontal-scrollbar :hover{//高度 变大10%transform: scaleY(1.5) translateY(-10%);//百分之八十亮度&a…

阻塞、非阻塞、同步与异步IO的区别

IO读取数据的过程 如图所示&#xff0c;进程读取数据的过程主要分为两个步骤 1.内核将数据准备好到内核缓冲区 2.内核将数据拷贝到用户态 在上述这两个过程里&#xff0c;进程首先和内核打交道&#xff0c;之后内核再和硬件&#xff08;如网卡&#xff09;打交道 阻塞IO 如图所…

将 KNX 接入 Home Assistant 之二 准备软件

写在前面&#xff1a; 在KNX官网也有关于 Home Assistant 的教程&#xff0c;地址是 Get started with Home Assistant x KNX 需要的东西是 a KNX IP Interface or Routera Raspberry Pian SD Card at least 32 GB 安装 Home Assistant 系统 下载镜像&#xff1a; 地址&…

【调试笔记-20240522-Windows-WSL 修改已安装发行版名称】

调试笔记-系列文章目录 调试笔记-20240522-Windows-WSL 修改已安装发行版名称 文章目录 调试笔记-系列文章目录调试笔记-20240522-Windows-WSL 修改已安装发行版名称 前言一、调试环境操作系统&#xff1a;Windows 10 专业版调试环境调试目标 二、调试步骤方法一&#xff1a;修…

3步找回丢失数据,EasyRecovery让数据恢复如此简单!

在数字化时代&#xff0c;数据已成为我们生活和工作中不可或缺的一部分。然而&#xff0c;数据丢失却是一个令人头疼的问题。无论是因为意外删除、硬盘损坏还是系统崩溃&#xff0c;丢失的文件和数据都可能给我们造成巨大的经济损失和时间浪费。因此&#xff0c;如何高效利用现…

Python内置方法串讲:类型转化与实用技巧

新书上架~&#x1f447;全国包邮奥~ python实用小工具开发教程http://pythontoolsteach.com/3 欢迎关注我&#x1f446;&#xff0c;收藏下次不迷路┗|&#xff40;O′|┛ 嗷~~ 目录 一、类型转化&#xff1a;从A到B的魔法 二、实用技巧&#xff1a;避免类型错误 三、总结 一…

【安装笔记-20240519-Windows-安装测试 PuTTY】

安装笔记-系列文章目录 安装笔记-20240521-Windows-安装测试 PuTTY 文章目录 安装笔记-系列文章目录安装笔记-20240521-Windows-安装测试 PuTTY 前言一、软件介绍名称&#xff1a;PuTTY主页官方介绍 二、安装步骤测试版本&#xff1a;0.81下载链接安装步骤功能界面 三、应用场…

列表、元组、字典和集合的区别

自学python如何成为大佬(目录):https://blog.csdn.net/weixin_67859959/article/details/139049996?spm1001.2014.3001.5501 在前面介绍了序列中的列表、元组、字典和集合的应用&#xff0c;下面通过表2对这几个数据序列进行比较。 表2 列表、元组、字典和集合的区别 数 据…

设计模式18—— 迭代器模式

写文章的初心主要是用来帮助自己快速的回忆这个模式该怎么用&#xff0c;主要是下面的UML图可以起到大作用&#xff0c;在你学习过一遍以后可能会遗忘&#xff0c;忘记了不要紧&#xff0c;只要看一眼UML图就能想起来了。同时也请大家多多指教。 迭代器模式&#xff08;Iterat…

LiveGBS流媒体平台GB/T28181用户手册-操作日志:HTTP接口记录、上级SIP信令、搜索、清空

LiveGBS流媒体平台GB/T28181用户手册-操作日志:HTTP接口记录、上级SIP信令、搜索、清空 1、操作日志1.1、列表1.2、搜索过滤1.3、清空 2、搭建GB28181视频直播平台 1、操作日志 操作日志&#xff0c;记录了HTTP接口调用的记录&#xff0c;还有级联给上级平台&#xff0c;上级平…