无人驾驶飞行器 (UAV) 以飞行基站 (FBS) 的形式辅助 5G 通信附matlab代码

简介: 无人驾驶飞行器 (UAV) 以飞行基站 (FBS) 的形式辅助 5G 通信附matlab代码

✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。

🍎个人主页:Matlab科研工作室

🍊个人信条:格物致知。

更多Matlab仿真内容点击👇

智能优化算法       神经网络预测       雷达通信      无线传感器        电力系统

信号处理              图像处理               路径规划       元胞自动机        无人机

⛄ 内容介绍

Investigating the Unmanned Aerial Vehicle (UAV) assisted 5G communications in the form of flying base stations (FBSs). The techniques deployed include assessing, improving, and developing optimization methods to route drones that carry Flying Base Station (FBS) enhancing the terrestrial 5G network infrastructure. One way being effectively collecting and transmitting data through line of sight (LoS) communication to support flash crowds, machine type communication (IoTs), analysis of energy consumption, and total time to complete the tasks.

⛄ 部分代码

xv1 = [2 -2 4];

yv1 = [2 2 5.464];


xv2=[2 4 4];

yv2=[2 -1.4642 5.464];


xv3=[2 -2 4];

yv3=[2 2 -1.4642];


fx=[2,4]    

fy=[2,5.464]


%these coordinates represent traingle and the tangent in the three drone

%case


lx=[2,2];%lx and ly represent the two axis that cut the circle into 4 parts

ly=[0,4];


velocity=60 %velocity of the drone is 60m/s

power= 50   %power of the drone is 50W


 

d=zeros(5,1)



n=50; % number of points that you want

center = [2 ,2]; % center coordinates of the circle [x0,y0]

radius = 2; % radius of the circle

angle = 2*pi*rand(n,1);


rng(1)%fixes the points

r = radius*sqrt(rand(n,1));


 

x = center(1)+r.*cos(angle) ;%x coordinates of the points inscribed in my circle

y = center(2)+r.*sin(angle);%y coordinates of the points inscribed in my circle

x(1)=2;

y(1)=2;%center of the circle coordinates which is the base station in our case where the drone should launch from

v=[x,y]



%first case when we have one drone


   figure(1)

   plot( x, y, 'r*');

   axis equal

   X = v;

   s = size(X,1);

   [p,d1] = tspsearch(X,s)%the 2opt algorithm

   figure(2)

   tspplot(p,X,1)

   opts = statset('Display','final');

   distance_to_finish_the_task1=d1*1000

   time_to_finish_the_task1=distance_to_finish_the_task1/velocity  

   distance_onedrone=d1*1000

   time1=distance_onedrone/velocity

 

   energy_consumption1=power*(distance_onedrone/velocity)

   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

   figure(3)

   plot( x, y,'r*',ly,lx, 'r-');

   axis equal

   x_center = 2;

   y_center = 2;% coordinates of the center of the circle


   b=v(:,2);% each drone is going through one part of the circle the upper part for y>2 and lower part y<2 that is why the y coordinates are being called

   

   X = v( b<=y_center,:);

   s = size(X,1);

   [p,d1] = tspsearch(X,s)

   figure(4)

   tspplot(p,X,1)


   X =  v( b>=y_center,:);

   s = size(X,1);

   [p,d2] = tspsearch(X,s)

   figure(5)

   tspplot(p,X,1)


   opts = statset('Display','final');

 

   

   

    distance2=[d1*1000 d2*1000];

   distance_to_finish_the_task2=max(distance2);

   time_to_finish_the_task2=distance_to_finish_the_task2/velocity;

   

   distance_twodrones=(d1+d2)*1000;

   time2=((d1*1000/velocity)+(d2*1000/velocity))/2;

   energy_consumption2=power*(distance_twodrones/velocity);

   


 

   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

   


 

figure(6)


plot( x, y,'r*',xv3,yv3,'.-r',xv1,yv1,'.-r',xv2,yv2,'.-r',fx,fy, 'r-')

axis equal



a=v(:,1);

b=v(:,2);

in = inpolygon(a,b,xv1,yv1);


g= [a(in),b(in)]

   

   X=g;

   s = size(X,1);

   [p,d1] = tspsearch(X,s)

   figure(7)

   tspplot(p,X,1)



in = inpolygon(a,b,xv2,yv2);  

 l= [a(in),b(in)]

 

   X =  l;

   s = size(X,1);

   [p,d2] = tspsearch(X,s)

   figure(8)

   tspplot(p,X,1)

 


  in = inpolygon(a,b,xv3,yv3);  

  m= [a(in),b(in)]

 


   

   X = m;

   s = size(X,1);

   [p,d3] = tspsearch(X,s)

   figure(9)

   tspplot(p,X,1)

 

   opts = statset('Display','final');

   

   

 

   

   

   

   

 

   distance3=[d1*1000 d2*1000 d3*1000]

   distance_to_finish_the_task3=max(distance3)

   time_to_finish_the_task3=distance_to_finish_the_task3/velocity

   distance_threedrones=(d1+d2+d3)*1000

   time3=((d1*1000/velocity)+(d2*1000/velocity)+(d3*1000/velocity))/3

   energy_consumption3=power*(distance_threedrones/velocity)

 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%






   X = v(a<=x_center & b<=y_center,:);

   s = size(X,1);

   [p,d1] = tspsearch(X,s)

   figure(10)

   tspplot(p,X,1)

 

   X =  v(a<=x_center & b>=y_center,:);

   s = size(X,1);

   [p,d2] = tspsearch(X,s)

   figure(11)

   tspplot(p,X,1)

 


   

   X = v(a>=x_center & b<=y_center,:);

   s = size(X,1);

   [p,d3] = tspsearch(X,s)

   figure(12)

   tspplot(p,X,1)

 



   

   X = v(a>=x_center & b>=y_center,:);

   s = size(X,1);

   [p,d4] = tspsearch(X,s)

   figure(13)

   tspplot(p,X,1)

   

   opts = statset('Display','final');

   

   


   distance4=[d1*1000 d2*1000 d3*1000 d4*1000];

   distance_to_finish_the_task4=max(distance4);

   time_to_finish_the_task4= distance_to_finish_the_task4/velocity;

   

   

   

   distance_fourdrones=(d1+d2+d3+d4)*1000;

   time4=((d1*1000/velocity)+(d2*1000/velocity)+(d3*1000/velocity)+(d4*1000/velocity))/4;

   

   energy_consumption4=power*(distance_fourdrones/velocity);

   

   

   



number_of_drones = {'1drone';'2drones';'3drones';'4drones'}

distance = [distance_onedrone;distance_twodrones;distance_threedrones;distance_fourdrones];

time = [time1;time2;time3;time4];

energy_consumption = [energy_consumption1;energy_consumption2;energy_consumption3;energy_consumption4];



time_to_finish_the_task=[time_to_finish_the_task1;time_to_finish_the_task2;time_to_finish_the_task3;time_to_finish_the_task4];

distance_to_finish_the_task=[distance_to_finish_the_task1;distance_to_finish_the_task2;distance_to_finish_the_task3;distance_to_finish_the_task4];



xorigin=xlim %starting from zero

yorigin=ylim %starting from zero




drones_1dist=sqrt(((time1-xorigin(1))^2 )+((energy_consumption1-yorigin(1))^2))


drones_2dist=sqrt(((time2-xorigin(1))^2 )+((energy_consumption2-yorigin(1))^2))


drones_3dist=sqrt(((time3-xorigin(1))^2 )+((energy_consumption3-yorigin(1))^2))


drones_4dist=sqrt(((time4-xorigin(1))^2 )+((energy_consumption4-yorigin(1))^2))

trade_off=[drones_1dist;drones_2dist;drones_3dist;drones_4dist]


best_trade_off=min([drones_2dist,drones_3dist,drones_1dist,drones_4dist])


table = array2table(trade_off);

table.Properties.VariableNames = {'distance_fourdrones'}

bar(trade_off)

%%%%%

timee= 7 + (9-7).*rand(n,1)

hovering_time=sum(timee)


total_energy_consumption1=power*((distance_onedrone/velocity)+hovering_time);

total_energy_consumption2=power*((distance_twodrones/velocity)+hovering_time);

total_energy_consumption3=power*((distance_threedrones/velocity)+hovering_time);

total_energy_consumption4=power*((distance_fourdrones/velocity)+hovering_time);


total_energy_consumption=[total_energy_consumption1;total_energy_consumption2;total_energy_consumption3;total_energy_consumption4];

total_time=[time1+hovering_time;time2+hovering_time;time3+hovering_time;time4+hovering_time];

total_time_to_finish_the_task=[time_to_finish_the_task1+hovering_time;time_to_finish_the_task2+hovering_time;time_to_finish_the_task3+hovering_time;time_to_finish_the_task4+hovering_time];

D=[distance_onedrone;distance_twodrones;distance_threedrones;distance_fourdrones];


drone_one1=[time1;time_to_finish_the_task1];

drone_one2=[time2;time_to_finish_the_task2];

drone_one3=[time3;time_to_finish_the_task3];

drone_one4=[time4;time_to_finish_the_task4];

data = [drone_one1 drone_one2 drone_one3 drone_one4 ];

figure(14)

hb = bar(data)

set(hb(1), 'FaceColor','r')

set(hb(2), 'FaceColor','b')

set(hb(3), 'FaceColor','g')

set(hb(4), 'FaceColor','y')

ylabel('Time in sec');

set(gca,'XTickLabel',{'average time spent by the drones','time to complete the task'})

set(hb, {'DisplayName'}, {'one drone','two drones','three drones','four drones'}')

legend()

figure(15)


labels = {'one drone','two drones','three drones','four drones'};


plot(total_time_to_finish_the_task,distance_to_finish_the_task,'o',total_time_to_finish_the_task,distance_to_finish_the_task)

text(total_time_to_finish_the_task,distance_to_finish_the_task,labels,'VerticalAlignment','bottom','HorizontalAlignment','right')

ylabel('Distance Covered by the UAV with the Longest Route');

xlabel('Time to complete the task in sec');


figure(16)

labels = {'one drone','two drones','three drones','four drones'};

plot(total_time_to_finish_the_task,total_energy_consumption,'o',total_time_to_finish_the_task,total_energy_consumption)

text(total_time_to_finish_the_task,total_energy_consumption,labels,'VerticalAlignment','bottom','HorizontalAlignment','right')

ylabel('Total Energy Consumption in Joules');

xlabel('Time to complete the Task by the UAVs in sec');



figure(17)

labels = {'one drone','two drones','three drones','four drones'};

plot(time,energy_consumption,'o',time,energy_consumption)

ylabel('Energy Consumption in Joules Excluding Houvering Energy');

xlabel('Time to Complete the Task by the Drones in sec Excluding houvering time');

text(time,energy_consumption,labels,'VerticalAlignment','bottom','HorizontalAlignment','right')




figure(18)

labels = {'one drone','two drones','three drones','four drones'};

plot(total_time,total_energy_consumption,'o',total_time,total_energy_consumption)

text(total_time,total_energy_consumption,labels,'VerticalAlignment','bottom','HorizontalAlignment','right')

ylabel('Total Energy Consumption in Joules ');

xlabel('Average Time Spent by the UAVs in sec');




figure(19)


[maxBar,maxIndex] = max(trade_off);

[minBar,minIndex] = min(trade_off);

figure(100)

bar(trade_off)


text(minIndex-0.5,minBar+5,'Best Trade Off')

set(gca,'XTickLabel',{'one drone','two drones','three drone','four drones'})

xtickangle(45)

xlabel('Number of Drones');

ylabel('Euclidean Distance From the Origin to Each Drone in Meters')

 

title('Best Trade off')

box off

⛄ 运行结果

⛄ 参考文献


⛳️ 代码获取关注我

❤️部分理论引用网络文献,若有侵权联系博主删除
❤️ 关注我领取海量matlab电子书和数学建模资料


目录
打赏
0
0
0
0
859
分享
相关文章
基于SC-FDE单载波频域均衡MQAM通信链路matlab仿真,包括帧同步,定时同步,载波同步,MMSE信道估计等
本内容主要介绍基于MATLAB的SC-FDE单载波频域均衡通信链路设计与实现,包括UW序列设计、QAM调制、帧同步、定时同步、载波同步、SNR估计和MMSE信道估计等关键环节。通过仿真(MATLAB 2022a),验证了系统的可行性和性能。核心程序展示了不同QAM调制方式(如256QAM)及同步算法的具体实现,并通过绘图展示帧同步、定时同步和频偏补偿效果。此研究为优化通信系统性能提供了理论与实践基础。
55 0
基于DVB-T的COFDM+16QAM+Viterbi编解码图传通信系统matlab仿真,包括载波定时同步,信道估计
本内容展示了基于DVB-T的COFDM+16QAM+Viterbi编解码通信链路的算法仿真与实现。通过Matlab2022a仿真,验证了系统性能(附无水印完整代码运行结果截图)。该系统结合COFDM、16QAM调制和Viterbi编解码技术,具备高效传输与抗多径衰落能力。核心程序涵盖加循环前缀、瑞利多径衰落信道模拟、符号同步、细定时估计等关键步骤,并实现了图像数据的二进制转换与RGB合并展示。理论部分详细解析了载波同步、定时同步及信道估计模块的功能与原理,为数字视频广播系统的开发提供了全面参考。
78 19
基于SC-FDE单载波频域均衡的MPSK通信链路matlab仿真,包括帧同步,定时同步,载波同步,MMSE信道估计等
本内容展示了基于MATLAB 2022a的SC-FDE单载波频域均衡通信链路仿真,包括UW序列设计、QPSK调制、帧同步、定时与载波同步、SNR估计及MMSE信道估计等关键环节。通过8张仿真结果图验证了系统性能。理论部分详述了单载波频域均衡技术原理,以及各模块的设计与实现步骤。核心程序代码涵盖调制方式选择(如QPSK)、UW序列生成、数据帧构建、信道模拟及同步补偿等操作,为高效数据传输提供了完整解决方案。
80 19
基于DVB-T的COFDM+16QAM+LDPC图传通信系统matlab仿真,包括载波同步,定时同步,信道估计
### 简介 本项目基于DVB-T标准,实现COFDM+16QAM+LDPC码通信链路的MATLAB仿真。通过COFDM技术将数据分成多个子载波并行传输,结合16QAM调制和LDPC编码提高传输效率和可靠性。系统包括载波同步、定时同步和信道估计模块,确保信号的准确接收与解调。MATLAB 2022a仿真结果显示了良好的性能,完整代码无水印。仿真操作步骤配有视频教程,便于用户理解和使用。 核心程序涵盖导频插入、载波频率同步、信道估计及LDPC解码等关键环节。仿真结果展示了系统的误码率性能,并保存为R1.mat文件。
165 76
基于扩频解扩+turbo译码的16QAM图传通信系统matlab误码率仿真,扩频参数可设置
本项目基于MATLAB 2022a实现图像传输通信系统的仿真,涵盖16QAM调制解调、扩频技术和Turbo译码。系统适用于无人机图像传输等高要求场景,通过扩频解扩和Turbo译码提升抗干扰能力。核心程序包括图像源处理、16QAM调制、扩频编码、信道传输、解扩及Turbo译码,最终还原并显示RGB图像。仿真结果无水印,操作步骤配有视频指导。
73 5
基于扩频解扩+turbo译码的QPSK图传通信系统matlab误码率仿真,扩频参数可设置
本项目基于MATLAB 2022a实现图像传输通信系统的仿真,涵盖QPSK调制解调、扩频技术和Turbo译码。系统适用于无人机图像传输等高要求场景,确保图像质量和传输稳定性。通过仿真,验证了系统在不同信噪比下的性能,展示了图像的接收与恢复效果。核心代码实现了二进制数据到RGB图像的转换与显示,并保存不同条件下的结果。
54 6
基于扩频解扩+LDPC编译码的QPSK图传通信系统matlab误码率仿真,扩频参数可设置
该通信系统主要用于高质量图像传输,如无人机、视频监控等场景。系统采用QPSK调制解调、扩频技术和LDPC译码,确保复杂电磁环境下的稳定性和清晰度。MATLAB仿真(2022a)验证了算法效果,核心程序包括信道编码、调制、扩频及解调等步骤,通过AWGN信道测试不同SNR下的性能表现。
138 6
基于扩频解扩+LDPC编译码的QPSK图传通信系统matlab误码率仿真,扩频参数可设置
基于扩频解扩+LDPC编译码的16QAM图传通信系统matlab误码率仿真,扩频参数可设置
该通信系统主要用于高质量图像传输,适用于无人机、视频监控等场景。系统采用16QAM调制解调、扩频技术和LDPC译码,确保复杂电磁环境下的稳定性和清晰度。MATLAB 2022a仿真结果显示图像传输效果良好,附带的操作视频详细介绍了仿真步骤。核心代码实现了图像的二进制转换、矩阵重组及RGB合并,确保图像正确显示并保存为.mat文件。
87 20
基于扩频解扩+turbo译码的64QAM图传通信系统matlab误码率仿真,扩频参数可设置
该通信系统基于MATLAB 2022a仿真,适用于高要求的图像传输场景(如无人机、视频监控等),采用64QAM调制解调、扩频技术和Turbo译码提高抗干扰能力。发射端包括图像源、64QAM调制器、扩频器等;接收端则有解扩器、64QAM解调器和Turbo译码器等。核心程序实现图像传输的编码、调制、信道传输及解码,确保图像质量和传输可靠性。
96 16
数字通信中不同信道类型对通信系统性能影响matlab仿真分析,对比AWGN,BEC,BSC以及多径信道
本项目展示了数字通信系统中几种典型信道模型(AWGN、BEC、BSC及多径信道)的算法实现与分析。使用Matlab2022a开发,提供无水印运行效果预览图、部分核心代码及完整版带中文注释的源码和操作视频。通过数学公式深入解析各信道特性及其对系统性能的影响。

热门文章

最新文章

AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等