无线楼宇数据传输系统的仿真.docx

上传人:飞****2 文档编号:82411293 上传时间:2023-03-25 格式:DOCX 页数:10 大小:102KB
返回 下载 相关 举报
无线楼宇数据传输系统的仿真.docx_第1页
第1页 / 共10页
无线楼宇数据传输系统的仿真.docx_第2页
第2页 / 共10页
点击查看更多>>
资源描述

《无线楼宇数据传输系统的仿真.docx》由会员分享,可在线阅读,更多相关《无线楼宇数据传输系统的仿真.docx(10页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。

1、无线楼宇数据传输系统的仿真1. 摘要本实验的内容是无线楼宇数据传输仿真,分析915M的楼宇通信特性,建立楼宇数据通信系统的仿真模型,采用无线收发芯片NRF905,依据其性能参数来判断楼宇内两点能否进行数据传输。2. 实验内容:无线楼宇数据传输系统的仿真。分析915M的楼宇通信特性,建立楼宇数据通信系统的仿真模型,采用无线收发芯片NRF905,依据其性能参数来判断楼宇内两点之间能否进行数据传输。路径损耗(Path Loss)主要是由三个方面的因素导致的:一是发射机和接收机之间相隔的距离;二是同一楼层的软隔板;三是竖直方向的混凝土墙。它们造成的路径损耗可用以下公式表示:PL(d)dB=20*log

2、10(4*pi*d/l)+p*AF(soft partition)dB+q*AF(concret wall)dB.其中d是收发之间相隔的距离(m),l是芯片发出信号的波长(l= c / f = 300 M / 914 M = 0. m),p是软隔墙数,其相应的AF(soft partition)=1.39dB,q是混凝土墙数,其相应的 AF(concret wall)=2.38dB。由此,考虑此仿真系统为二维。即:当知道软隔墙数p和混凝土墙数q时,根据平面两点之间距离公式,可以得到收发之间相隔的近似距离:d=sqrt(p*x)2+(q*y)2).其中x为每两个软隔墙之间的水平距离,y为每两个混

3、凝土墙楼层之间的竖直高度。x,y为已知参数。所以程序需输入p、q两个变量,即可得到收发之间相隔的近似距离,进而算出收发之间的路径损耗。无线收发芯片NRF905的最大输出功率为10dBm=-20dB,接收分辨功率(能接收到的最小功率)为-100dBm=-130dB,所以其能允许的最大衰减范围为-20-(-130)=110dB,当路径损耗在此范围内芯片能够收发信号。程序中先算出发射机和接收机之间的路径损耗,再与110dB相比较。若小于110dB,则在允许的衰减范围内,能够进行无线楼宇数据通信;若大于110dB,则超出允许的衰减范围,不能进行无线楼宇数据通信。最后,程序分别绘制出路径损耗随软隔墙数p

4、和混凝土墙数q的变化曲线。即同一楼层(q=0)的路径损耗随软隔墙数的增加(水平距离的增大)的变化曲线;和竖直方向上(p=0)路径损耗随混凝土墙数的增加(竖直高度的增加)的变化曲线。3. 实验程序及结果:function varargout = Wirelesscommunication_building(varargin)% WIRELESSCOMMUNICATION_BUILDING M-file for Wirelesscommunication_building.fig% WIRELESSCOMMUNICATION_BUILDING, by itself, creates a new W

5、IRELESSCOMMUNICATION_BUILDING or raises the existing% singleton*.% H = WIRELESSCOMMUNICATION_BUILDING returns the handle to a new WIRELESSCOMMUNICATION_BUILDING or the handle to% the existing singleton*.% WIRELESSCOMMUNICATION_BUILDING(CALLBACK,hObject,eventData,handles,.) calls the local% function

6、named CALLBACK in WIRELESSCOMMUNICATION_BUILDING.M with the given input arguments.% WIRELESSCOMMUNICATION_BUILDING(Property,Value,.) creates a new WIRELESSCOMMUNICATION_BUILDING or raises the% existing singleton*. Starting from the left, property value pairs are% applied to the GUI before Wirelessco

7、mmunication_building_OpeningFunction gets called. An% unrecognized property name or invalid value makes property application% stop. All inputs are passed to Wirelesscommunication_building_OpeningFcn via varargin.% *See GUI Options on GUIDEs Tools menu. Choose GUI allows only one% instance to run (si

8、ngleton).% See also: GUIDE, GUIDATA, GUIHANDLES% Edit the above text to modify the response to help Wirelesscommunication_building% Last Modified by GUIDE v2.5 18-May-2006 22:38:07% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct(gui_Name, mfilename, . gui_Singleton, gui_

9、Singleton, . gui_OpeningFcn, Wirelesscommunication_building_OpeningFcn, . gui_OutputFcn, Wirelesscommunication_building_OutputFcn, . gui_LayoutFcn, , . gui_Callback, );if nargin & ischar(varargin1) gui_State.gui_Callback = str2func(varargin1);endif nargout varargout1:nargout = gui_mainfcn(gui_State,

10、 varargin:);else gui_mainfcn(gui_State, varargin:);end% End initialization code - DO NOT EDIT% - Executes just before Wirelesscommunication_building is made visible.function Wirelesscommunication_building_OpeningFcn(hObject, eventdata, handles, varargin)% This function has no output args, see Output

11、Fcn.% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% varargin command line arguments to Wirelesscommunication_building (see VARARGIN)% Choose default command line output for Wirelesscommunication

12、_buildinghandles.output = hObject;% Update handles structureguidata(hObject, handles);% UIWAIT makes Wirelesscommunication_building wait for user response (see UIRESUME)% uiwait(handles.figure1);% - Outputs from this function are returned to the command line.function varargout = Wirelesscommunicatio

13、n_building_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT);% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Get default command line output

14、 from handles structurevarargout1 = handles.output;function edit1_Callback(hObject, eventdata, handles)% hObject handle to edit1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,String) return

15、s contents of edit1 as text% str2double(get(hObject,String) returns contents of edit1 as a double% Read the input value edit1 = str2double(get(hObject,String);% Check whether the input is a numberif isnan(edit1) set(hObject, String, 1); errordlg(Input must be a number,Error);endif (edit14) errordlg(

16、发射机和接收机相隔的楼层数必须在零到四层之间,Error);end;% Save the new valuedata = getappdata(gcbf, metricdata);data.edit1 = edit1;setappdata(gcbf, metricdata, data);% - Executes during object creation, after setting all properties.function edit1_CreateFcn(hObject, eventdata, handles)% hObject handle to edit1 (see GCBO)%

17、 eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc & isequal(get(hObject,BackgroundColor), get(0,defaultUicontrolBackg

18、roundColor) set(hObject,BackgroundColor,white);endfunction edit2_Callback(hObject, eventdata, handles)% hObject handle to edit2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,String) returns

19、 contents of edit2 as text% str2double(get(hObject,String) returns contents of edit2 as a double% Read the input valueedit2 = str2double(get(hObject,String);% Check whether the input is a numberif isnan(edit2) set(hObject, String, 1); errordlg(Input must be a number,Error);endif edit20 errordlg(发射机和

20、接收机相隔的距离必须大于0,Error);end;% Save the new valuedata = getappdata(gcbf, metricdata);data.edit2 = edit2;setappdata(gcbf, metricdata, data);% - Executes during object creation, after setting all properties.function edit2_CreateFcn(hObject, eventdata, handles)% hObject handle to edit2 (see GCBO)% eventdat

21、a reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc & isequal(get(hObject,BackgroundColor), get(0,defaultUicontrolBackgroundColo

22、r) set(hObject,BackgroundColor,white);endfunction edit3_Callback(hObject, eventdata, handles)% hObject handle to edit3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,String) returns contents

23、 of edit3 as text% str2double(get(hObject,String) returns contents of edit3 as a double% Read the input valueedit3 = str2double(get(hObject,String);% Check whether the input is a numberif isnan(edit3) set(hObject, String, 1); errordlg(Input must be a number,Error);endif edit30 errordlg(收发之间的软隔墙数必须大于

24、或等于0,Error);end;% Save the new valuedata = getappdata(gcbf, metricdata);data.edit3 = edit3;setappdata(gcbf, metricdata, data);% - Executes during object creation, after setting all properties.function edit3_CreateFcn(hObject, eventdata, handles)% hObject handle to edit3 (see GCBO)% eventdata reserve

25、d - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc & isequal(get(hObject,BackgroundColor), get(0,defaultUicontrolBackgroundColor) set(hO

26、bject,BackgroundColor,white);endfunction edit4_Callback(hObject, eventdata, handles)% hObject handle to edit4 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,String) returns contents of edit4

27、 as text% str2double(get(hObject,String) returns contents of edit4 as a double% Read the input valueedit4 = str2double(get(hObject,String);% Check whether the input is a numberif isnan(edit4) set(hObject, String, 1); errordlg(Input must be a number,Error);endif edit40 errordlg(收发之间的混凝墙数必须大于或等于0,Erro

28、r);end;% Save the new valuedata = getappdata(gcbf, metricdata);data.edit4 = edit4;setappdata(gcbf, metricdata, data);% - Executes during object creation, after setting all properties.function edit4_CreateFcn(hObject, eventdata, handles)% hObject handle to edit4 (see GCBO)% eventdata reserved - to be

29、 defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc & isequal(get(hObject,BackgroundColor), get(0,defaultUicontrolBackgroundColor) set(hObject,Bac

30、kgroundColor,white);end% - Executes on button press in pushbutton1.function pushbutton1_Callback(hObject, eventdata, handles)% hObject handle to pushbutton1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)data =

31、getappdata(gcbf, metricdata);p=data.edit3; %收发之间的软隔墙数q=data.edit4; %收发之间的混凝土墙数x=5; %每两个软隔墙之间的距离(m)y=3; %每一楼层的高度(m)d=sqrt(p*x)2+(q*y)2); %发射机和接收机之间相隔的近似距离(m)l=0.; %波长,l=c/f=300M (m/s) /914M (Hz) =0.6 mAF_soft=1.39; %每层软隔板的路径衰减值(dB)AF_concret=2.38; %每层混凝土墙的路径衰减值(dB)PL=20.0*log10(4*pi*d/l)+p*AF_soft+q*

32、AF_concret; %同一楼层中发射机和接收机之间有软隔墙和混凝土墙的路径损耗 set(handles.text7, String, PL); %返回到fig中if PL=110 %判断得到的路径损耗值(dB)是否在允许的范围(110dB)之内 str=路径损耗在允许的范围内,可以在楼宇间进行无线数据传输;else str=路径损耗超出范围,不能在楼宇间进行数据传输;end;set(handles.text6, String, str); %返回到fig中p0=0; %收发之间的软隔墙数q0=0; %收发之间的混凝土墙数p1=1:20; %收发之间软隔墙数矢量 d1=(x*p1).2+(y

33、*q0)2).0.5; %混凝土墙数q0=0时,收发之间相隔水平距离矢量 PL1=20.0*log10(4*pi*d1/l+eps)+p1*AF_soft+q0*AF_concret; %当发射机和接收机之间混凝土墙数q0=4时,路径损耗矢量(dB) q1=1:20; %收发之间混凝土墙数矢量d2=(x*p0)2+(y*q1).2).0.5; %软隔墙数p0=0时,收发之间相隔垂直距离矢量 PL2=20.0*log10(4*pi*d2/l+eps)+p0*AF_soft+q1*AF_concret; %当发射机和接收机之间软隔墙数p0=4时,路径损耗矢量(dB)figuresubplot(2,1,1);plot(p1,PL1,-rd); %绘制同一楼层路径损耗随软隔墙数的变化曲线title(路径损耗在同一楼层内的变化曲线);subplot(2,1,2);plot(q1,PL2,-.rd); %绘制竖直方向上路径损耗随混凝土墙数的变化曲线title(路径损耗在数值方向上的变化曲线);仿真结果:实验结果与实验分析的一致,即:若小于110dB,则在允许的衰减范围内,能够进行无线楼宇数据通信;若大于110dB,则超出允许的衰减范围,不能进行无线楼宇数据通信。

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 教案示例

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号© 2020-2023 www.taowenge.com 淘文阁