In: Electrical Engineering
Using MATLAB plot path loss prediction versus distance and log distance for a cellular system you are designing with the following assumptions: PCS frequency (1900 MHz), base height 20 m, mobile 2 m, suburban area, flat terrain with moderate tree density.
work varargout = URBANPtHLOSSMDLS(vargin)
URBANPATHLOSSMODELS M-petition for URBANPATHLOSSMODELS.fig
gui_Sinton = 1;
gui_St = strct('gui_Name', mfilename, ...
'gui_Sileton', gui_Singleton, ...
'gui_OpningFcn', @URBANPATHLOSSMODELS_OpeningFcn, ...
'gui_OutptFcn', @URBANPATHLOSSMODELS_OutputFcn, ...
'gui_LaytFcn', [] , ...
'gui_Callbck', []);
in the event that nargn && ischr(vargin{1})
gui_Stat.gui_Callback = str2func(varargin{1});
end
on the off chance that nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End instatement code - DO NOT EDIT
% - Executes just before URBANPATHLOSSMODELS is made noticeable.
work URBANPATHLOSSMODELS_OpeningFcn(hObject, eventdata, handles, varargin)
% This capacity has no yield args, see OutputFcn.
% hObject handle to figure
% eventdata held - to be characterized in a future form of MATLAB
% handles structure with handles and client information (see GUIDATA)
% varargin charge line contentions to URBANPATHLOSSMODELS (see VARARGIN)
% Choose default charge line yield for URBANPATHLOSSMODELS
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT influences URBANPATHLOSSMODELS to sit tight for client reaction (see UIRESUME)
% uiwait(handles.figure1);
% - Outputs from this capacity are come back to the summon line.
work varargout = URBANPATHLOSSMODELS_OutputFcn(hObject, eventdata, handles)
% varargout cell exhibit for returning yield args (see VARARGOUT);
% hObject handle to figure
% eventdata saved - to be characterized in a future variant of MATLAB
% handles structure with handles and client information (see GUIDATA)
% Get default charge line yield from handles structure
varargout{1} = handles.output;
work edit1_Callback(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata saved - to be characterized in a future variant of MATLAB
% handles structure with handles and client information (see GUIDATA)
% Hints: get(hObject,'String') returns substance of edit1 as content
% str2double(get(hObject,'String')) returns substance of edit1 as a twofold
% - Executes amid question creation, subsequent to setting all properties.
work edit1_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata held - to be characterized in a future form of MATLAB
% handles purge - handles not made until after all CreateFcns called
% Hint: alter controls generally have a white foundation on Windows.
% See ISPC and COMPUTER.
on the off chance that ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
work edit2_Callback(hObject, eventdata, handles)
% hObject handle to edit2 (see GCBO)
% eventdata held - to be characterized in a future rendition of MATLAB
% handles structure with handles and client information (see GUIDATA)
% Hints: get(hObject,'String') returns substance of edit2 as content
% str2double(get(hObject,'String')) returns substance of edit2 as a twofold
% - Executes amid protest creation, in the wake of setting all properties.
work edit2_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit2 (see GCBO)
% eventdata saved - to be characterized in a future variant of MATLAB
% handles exhaust - handles not made until after all CreateFcns called
% Hint: alter controls normally have a white foundation on Windows.
% See ISPC and COMPUTER.
in the event that ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
work edit3_Callback(hObject, eventdata, handles)
% hObject handle to edit3 (see GCBO)
% eventdata saved - to be characterized in a future adaptation of MATLAB
% handles structure with handles and client information (see GUIDATA)
% Hints: get(hObject,'String') returns substance of edit3 as content
% str2double(get(hObject,'String')) returns substance of edit3 as a twofold
% - Executes amid question creation, in the wake of setting all properties.
work edit3_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit3 (see GCBO)
% eventdata saved - to be characterized in a future adaptation of MATLAB
% handles discharge - handles not made until after all CreateFcns called
% Hint: alter controls for the most part have a white foundation on Windows.
% See ISPC and COMPUTER.
in the event that ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
work edit4_Callback(hObject, eventdata, handles)
% hObject handle to edit4 (see GCBO)
% eventdata saved - to be characterized in a future variant of MATLAB
% handles structure with handles and client information (see GUIDATA)
% Hints: get(hObject,'String') returns substance of edit4 as content
% str2double(get(hObject,'String')) returns substance of edit4 as a twofold
% - Executes amid question creation, subsequent to setting all properties.
work edit4_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit4 (see GCBO)
% eventdata held - to be characterized in a future form of MATLAB
% handles purge - handles not made until after all CreateFcns called
% Hint: alter controls ordinarily have a white foundation on Windows.
% See ISPC and COMPUTER.
on the off chance that ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% - Executes on catch press in pushbutton1.
work pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata saved - to be characterized in a future adaptation of MATLAB
% handles structure with handles and client information (see GUIDATA)
%% Free Space Model Simulation
% clear figure;
Dist=get(handles.edit1,'string');% Get Distance in Km
Dist= str2num(Dist);
Dist_m=Dist*1000; % Convert it into meters
Dist_Log_Km= log10(Dist); % Distance in Log Scale (for Km)
Dist_Log_Meter=log10(Dist_m); % Distance in Log Scale (FOr meters)
% disp(Dist)
% disp(Dist_m)
% disp(Dist_Log_Km)
% disp(Dist_Log_Meter)
c=3*1e8;
Freq=get(handles.edit2,'string'); % Get Carrier Frequency in MHz
Freq= str2num(Freq);
% disp(Freq)
lamda=c/(Freq*1e6); % Calculate Wavelength
% disp(lamda)
TX_Ht=get(handles.edit3,'string'); % Get Carrier Frequency in MHz
TX_Ht= str2num(TX_Ht);
% disp(TX_Ht)
RX_Ht=get(handles.edit4,'string'); % Get Carrier Frequency in MHz
RX_Ht= str2num(RX_Ht);
% disp(RX_Ht)
% The Path Loss for the free space when the recieving wires are solidarity pick up is given by,
FreeSpace=10*log10((Dist_m*pi*4).^2/lamda^2);
% disp(FreeSpace)
axes(handles.axes1);
handles.axes1=min(Dist_Log_Km):max(Dist_Log_Km);
plot(Dist_Log_Km,FreeSpace,'g-*');
% Equation (4.6) From "Remote COmmunication, Principles and Practice" By Theodore Rappaport
title('Pathloss forecast by Free space demonstrate for Urban Area');
xlabel('Distance log10(d)');
ylabel('Path misfortune (dB)');
legend('Free Space Loss');
% hang on
% - Executes on catch press in pushbutton2.
work pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata held - to be characterized in a future rendition of MATLAB
% handles structure with handles and client information (see GUIDATA)
%% Okumura Model
% clear figure;
Dist=get(handles.edit1,'string');% Get Distance in Km
Dist= str2num(Dist);
Dist_m=Dist*1000; % Convert it into meters
Dist_Log_Km= log10(Dist); % Distance in Log Scale (for Km)
Dist_Log_Meter=log10(Dist_m); % Distance in Log Scale (FOr meters)
% disp(Dist)
% disp(Dist_m)
% disp(Dist_Log_Km)
% disp(Dist_Log_Meter)
c=3*1e8;
Freq=get(handles.edit2,'string'); % Get Carrier Frequency in MHz
Freq= str2num(Freq);
% disp(Freq)
lamda=c/(Freq*1e6); % Calculate Wavelength
% disp(lamda)
TX_Ht=get(handles.edit3,'string'); % Get Carrier Frequency in MHz
TX_Ht= str2num(TX_Ht);
% disp(TX_Ht)
RX_Ht=get(handles.edit4,'string'); % Get Carrier Frequency in MHz
RX_Ht= str2num(RX_Ht);
OKU_LOSS=20*log10(lamda^2/(4*pi)^2*Dist_m)+5-20*log10(TX_Ht/200)- 10*log10(RX_Ht/3)- 9;
% Okumura Loss Model Equation
axes(handles.axes1);
handles.axes1=min(Dist_Log_Km):max(Dist_Log_Km);
plot(Dist_Log_Km,OKU_LOSS,'- *');
% Equation (4.6) From "Remote COmmunication, Principles and Practice" By Theodore Rappaport
title('Pathloss expectation by Okumura show for Urban Area');
xlabel('Distance log10(d)');
ylabel('Path misfortune (dB)');
legend('Okumura Model');
% hang on
% - Executes on catch press in pushbutton3.
work pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata saved - to be characterized in a future form of MATLAB
% handles structure with handles and client information (see GUIDATA)
%% HATA's model:
Dist=get(handles.edit1,'string');% Get Distance in Km
Dist= str2num(Dist);
Dist_m=Dist*1000; % Convert it into meters
Dist_Log_Km= log10(Dist); % Distance in Log Scale (for Km)
Dist_Log_Meter=log10(Dist_m); % Distance in Log Scale (FOr meters)
% disp(Dist)
% disp(Dist_m)
% disp(Dist_Log_Km)
% disp(Dist_Log_Meter)
c=3*1e8;
Freq=get(handles.edit2,'string'); % Get Carrier Frequency in MHz
Freq= str2num(Freq);
% disp(Freq)
lamda=c/(Freq*1e6); % Calculate Wavelength
% disp(lamda)
TX_Ht=get(handles.edit3,'string'); % Get Carrier Frequency in MHz
TX_Ht= str2num(TX_Ht);
% disp(TX_Ht)
RX_Ht=get(handles.edit4,'string'); % Get Carrier Frequency in MHz
RX_Ht= str2num(RX_Ht);
% Hata Model Equation
PAR_H=3.2*((log10(11.75*RX_Ht))^2)- 4.97;
Hata_MOD=69.55+26.16*log10(Freq)- 13.82*log10(TX_Ht)- PAR_H+((44.9-6.55*log10(TX_Ht))
work varargout = URBANPtHLOSSMDLS(vargin)
URBANPATHLOSSMODELS M-petition for URBANPATHLOSSMODELS.fig
gui_Sinton = 1;
gui_St = strct('gui_Name', mfilename, ...
'gui_Sileton', gui_Singleton, ...
'gui_OpningFcn', @URBANPATHLOSSMODELS_OpeningFcn, ...
'gui_OutptFcn', @URBANPATHLOSSMODELS_OutputFcn, ...
'gui_LaytFcn', [] , ...
'gui_Callbck', []);
in the event that nargn && ischr(vargin{1})
gui_Stat.gui_Callback = str2func(varargin{1});
end
on the off chance that nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End instatement code - DO NOT EDIT
% - Executes just before URBANPATHLOSSMODELS is made noticeable.
work URBANPATHLOSSMODELS_OpeningFcn(hObject, eventdata, handles, varargin)
% This capacity has no yield args, see OutputFcn.
% hObject handle to figure
% eventdata held - to be characterized in a future form of MATLAB
% handles structure with handles and client information (see GUIDATA)
% varargin charge line contentions to URBANPATHLOSSMODELS (see VARARGIN)
% Choose default charge line yield for URBANPATHLOSSMODELS
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT influences URBANPATHLOSSMODELS to sit tight for client reaction (see UIRESUME)
% uiwait(handles.figure1);
% - Outputs from this capacity are come back to the summon line.
work varargout = URBANPATHLOSSMODELS_OutputFcn(hObject, eventdata, handles)
% varargout cell exhibit for returning yield args (see VARARGOUT);
% hObject handle to figure
% eventdata saved - to be characterized in a future variant of MATLAB
% handles structure with handles and client information (see GUIDATA)
% Get default charge line yield from handles structure
varargout{1} = handles.output;
work edit1_Callback(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata saved - to be characterized in a future variant of MATLAB
% handles structure with handles and client information (see GUIDATA)
% Hints: get(hObject,'String') returns substance of edit1 as content
% str2double(get(hObject,'String')) returns substance of edit1 as a twofold
% - Executes amid question creation, subsequent to setting all properties.
work edit1_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata held - to be characterized in a future form of MATLAB
% handles purge - handles not made until after all CreateFcns called
% Hint: alter controls generally have a white foundation on Windows.
% See ISPC and COMPUTER.
on the off chance that ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
work edit2_Callback(hObject, eventdata, handles)
% hObject handle to edit2 (see GCBO)
% eventdata held - to be characterized in a future rendition of MATLAB
% handles structure with handles and client information (see GUIDATA)
% Hints: get(hObject,'String') returns substance of edit2 as content
% str2double(get(hObject,'String')) returns substance of edit2 as a twofold
% - Executes amid protest creation, in the wake of setting all properties.
work edit2_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit2 (see GCBO)
% eventdata saved - to be characterized in a future variant of MATLAB
% handles exhaust - handles not made until after all CreateFcns called
% Hint: alter controls normally have a white foundation on Windows.
% See ISPC and COMPUTER.
in the event that ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
work edit3_Callback(hObject, eventdata, handles)
% hObject handle to edit3 (see GCBO)
% eventdata saved - to be characterized in a future adaptation of MATLAB
% handles structure with handles and client information (see GUIDATA)
% Hints: get(hObject,'String') returns substance of edit3 as content
% str2double(get(hObject,'String')) returns substance of edit3 as a twofold
% - Executes amid question creation, in the wake of setting all properties.
work edit3_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit3 (see GCBO)
% eventdata saved - to be characterized in a future adaptation of MATLAB
% handles discharge - handles not made until after all CreateFcns called
% Hint: alter controls for the most part have a white foundation on Windows.
% See ISPC and COMPUTER.
in the event that ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
work edit4_Callback(hObject, eventdata, handles)
% hObject handle to edit4 (see GCBO)
% eventdata saved - to be characterized in a future variant of MATLAB
% handles structure with handles and client information (see GUIDATA)
% Hints: get(hObject,'String') returns substance of edit4 as content
% str2double(get(hObject,'String')) returns substance of edit4 as a twofold
% - Executes amid question creation, subsequent to setting all properties.
work edit4_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit4 (see GCBO)
% eventdata held - to be characterized in a future form of MATLAB
% handles purge - handles not made until after all CreateFcns called
% Hint: alter controls ordinarily have a white foundation on Windows.
% See ISPC and COMPUTER.
on the off chance that ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% - Executes on catch press in pushbutton1.
work pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata saved - to be characterized in a future adaptation of MATLAB
% handles structure with handles and client information (see GUIDATA)
%% Free Space Model Simulation
% clear figure;
Dist=get(handles.edit1,'string');% Get Distance in Km
Dist= str2num(Dist);
Dist_m=Dist*1000; % Convert it into meters
Dist_Log_Km= log10(Dist); % Distance in Log Scale (for Km)
Dist_Log_Meter=log10(Dist_m); % Distance in Log Scale (FOr meters)
% disp(Dist)
% disp(Dist_m)
% disp(Dist_Log_Km)
% disp(Dist_Log_Meter)
c=3*1e8;
Freq=get(handles.edit2,'string'); % Get Carrier Frequency in MHz
Freq= str2num(Freq);
% disp(Freq)
lamda=c/(Freq*1e6); % Calculate Wavelength
% disp(lamda)
TX_Ht=get(handles.edit3,'string'); % Get Carrier Frequency in MHz
TX_Ht= str2num(TX_Ht);
% disp(TX_Ht)
RX_Ht=get(handles.edit4,'string'); % Get Carrier Frequency in MHz
RX_Ht= str2num(RX_Ht);
% disp(RX_Ht)
% The Path Loss for the free space when the recieving wires are solidarity pick up is given by,
FreeSpace=10*log10((Dist_m*pi*4).^2/lamda^2);
% disp(FreeSpace)
axes(handles.axes1);
handles.axes1=min(Dist_Log_Km):max(Dist_Log_Km);
plot(Dist_Log_Km,FreeSpace,'g-*');
% Equation (4.6) From "Remote COmmunication, Principles and Practice" By Theodore Rappaport
title('Pathloss forecast by Free space demonstrate for Urban Area');
xlabel('Distance log10(d)');
ylabel('Path misfortune (dB)');
legend('Free Space Loss');
% hang on
% - Executes on catch press in pushbutton2.
work pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata held - to be characterized in a future rendition of MATLAB
% handles structure with handles and client information (see GUIDATA)
%% Okumura Model
% clear figure;
Dist=get(handles.edit1,'string');% Get Distance in Km
Dist= str2num(Dist);
Dist_m=Dist*1000; % Convert it into meters
Dist_Log_Km= log10(Dist); % Distance in Log Scale (for Km)
Dist_Log_Meter=log10(Dist_m); % Distance in Log Scale (FOr meters)
% disp(Dist)
% disp(Dist_m)
% disp(Dist_Log_Km)
% disp(Dist_Log_Meter)
c=3*1e8;
Freq=get(handles.edit2,'string'); % Get Carrier Frequency in MHz
Freq= str2num(Freq);
% disp(Freq)
lamda=c/(Freq*1e6); % Calculate Wavelength
% disp(lamda)
TX_Ht=get(handles.edit3,'string'); % Get Carrier Frequency in MHz
TX_Ht= str2num(TX_Ht);
% disp(TX_Ht)
RX_Ht=get(handles.edit4,'string'); % Get Carrier Frequency in MHz
RX_Ht= str2num(RX_Ht);
OKU_LOSS=20*log10(lamda^2/(4*pi)^2*Dist_m)+5-20*log10(TX_Ht/200)- 10*log10(RX_Ht/3)- 9;
% Okumura Loss Model Equation
axes(handles.axes1);
handles.axes1=min(Dist_Log_Km):max(Dist_Log_Km);
plot(Dist_Log_Km,OKU_LOSS,'- *');
% Equation (4.6) From "Remote COmmunication, Principles and Practice" By Theodore Rappaport
title('Pathloss expectation by Okumura show for Urban Area');
xlabel('Distance log10(d)');
ylabel('Path misfortune (dB)');
legend('Okumura Model');
% hang on
% - Executes on catch press in pushbutton3.
work pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata saved - to be characterized in a future form of MATLAB
% handles structure with handles and client information (see GUIDATA)
%% HATA's model:
Dist=get(handles.edit1,'string');% Get Distance in Km
Dist= str2num(Dist);
Dist_m=Dist*1000; % Convert it into meters
Dist_Log_Km= log10(Dist); % Distance in Log Scale (for Km)
Dist_Log_Meter=log10(Dist_m); % Distance in Log Scale (FOr meters)
% disp(Dist)
% disp(Dist_m)
% disp(Dist_Log_Km)
% disp(Dist_Log_Meter)
c=3*1e8;
Freq=get(handles.edit2,'string'); % Get Carrier Frequency in MHz
Freq= str2num(Freq);
% disp(Freq)
lamda=c/(Freq*1e6); % Calculate Wavelength
% disp(lamda)
TX_Ht=get(handles.edit3,'string'); % Get Carrier Frequency in MHz
TX_Ht= str2num(TX_Ht);
% disp(TX_Ht)
RX_Ht=get(handles.edit4,'string'); % Get Carrier Frequency in MHz
RX_Ht= str2num(RX_Ht);
% Hata Model Equation
PAR_H=3.2*((log10(11.75*RX_Ht))^2)- 4.97;
Hata_MOD=69.55+26.16*log10(Freq)- 13.82*log10(TX_Ht)- PAR_H+((44.9-6.55*log10(TX_Ht))