Sie sind auf Seite 1von 9

POZAR chapter 14: RF MICROWAVE SYSTEMS. Example 06 __ 05/11/2020 13:10:08.

EXAMPLE 14.6
Click any to open the MATLAB script solving this exercise. Run script to read question and calculate solution.
On 1st run, the exercise is solved and the results are stored in .mat file. Parameters can be modified to solve
exercise variations. MATLAB student licences are cheap and there is a type that does not even require to be
registered in any university or college. All comments welcome.
To download and install MATLAB as well as review help on specific commands click any MATLAB icon:

The question for this example in [POZAR] pg683 does not reveal carrier frequency, thus  cannot be calculated and the example couldn't be solved.

Add input f0=1.598895232000000e+10 to question.

_____________________________________________________________________________________________________________________________ _
John Bofarull Guix jgb2012@sky.com jgb2014@live.co.uk 1/9
POZAR chapter 14: RF MICROWAVE SYSTEMS. Example 06 __ 05/11/2020 13:10:08.

pozar_14_example_06.m

c0=299792856; % [m/s] light speed


f0=1.598895232000000e+10 % [Hz] missing carrier frequency in f0 = 1.598895232000000e+10
question header

k_boltz=1.380649e-23; % [J/K] Boltzmann constant k_boltz_dB = -2.285991671732177e+02


k_boltz_dB=10*log10(k_boltz)
R= 940000
R=940e3 % [m] distance mod =
'QPSK'
mod='QPSK' % used modulation Ptx =
80
Ptx=80 % [W] transmit power Ptx_dB =
Ptx_dB=10*log10(Ptx) 19.030899869919434
Ptx_dBm=Ptx_dB+30 Ptx_dBm =
49.030899869919438
Gtx_dB=20 % [dB] transmitter antenna gain Gtx_dB =
Gtx=10^(Gtx_dB/10) 20
Gtx =
Grx_dB=1 % [dB] receiver handset antenna gain 100
Grx=10^(Grx_dB/10) Grx_dB =
1
Grx = 1.258925411794167
Te=750 % [Kelvin] receiver equivalent noise temperature Te = 750
Latm_dB=2 % [dB] atmospheric attenuation Latm_dB = 2
LM_dB=10 % [dB] required Link Margin LM_dB = 10
BER=.01 % [] Bit Error Rate to achieve BER = 0.010000000000000

Received signal power

lambda0=c0/f0 lambda0 =
0.018750000000000
L0=4*pi*R/lambda0 L0 =
6.299940467998732e+08
L0_dB=20*log10(L0) L0_dB =
1.759867289111611e+02
Prx_dBm=Ptx_dBm+Gtx_dB-L0_dB-Latm_dB+Grx_dB Prx_dBm =
-1.079558290412417e+02

Adding Link Margin

Prx_target_dBm=Prx_dBm-LM_dB Prx_target_dBm =
-1.179558290412417e+02
Prx_target=10^((Prx_target_dBm-30)/10) % [W] Prx_target =
1.601094980064552e-15

We aim at building a system with Px_target, not Prx because of fading, interference and atmosphere factors that cannot be controlled.

So what EbN0 to build signals so that BER requirements are met? Too much power and radiation regulations may be breached incurring fines and
endangering inadvertent users and public. Not enough power and the applications running on such channels will falter, customers will suffer reduced
Quality of Service, and like trust, convincing customers to purchase mobile phones takes expensive marketing campaigns, yet it may be lost really quickly
when health and safety issues go public, problems that should be caught and solve before prototypes reach production lines.

[POZAR] simplifies with a 'conservative' reading of the supplied BER(EbN0) graph, rounding up to 5dB, which is also reasonable, given tight Link Margins
that systems have to be built upon otherwise putting too much budget on back-off may turn a waste of investment and even the reason why a product
doesn't sell, because price too high compared to less robust system, yet getting in with the right price.

EbN0_dB=5; % graph reading


EbN0=10^(EbN0_dB/10) EbN0 =
3.162277660168380
N0=k_boltz*Te
% [b/s] bps bits/second fastest possible data rate sustaining target BER
rb=1/EbN0*Prx_target/(k_boltz*Te) rb =
4.889591187203380e+04
_____________________________________________________________________________________________________________________________ _
John Bofarull Guix jgb2012@sky.com jgb2014@live.co.uk 2/9
POZAR chapter 14: RF MICROWAVE SYSTEMS. Example 06 __ 05/11/2020 13:10:08.

Theoretical BER(EbN0)
BER(EbN0) functions are probability Density Distributions that are modulation and channel dependent.

Also, probability density functions only resemble what is really happens, happened, or is going to happen, beside the obvious if-enough-samples, when
there's enough signal level, enough Watts, even for CDMA and spread spectrum signals, or/and symbols spaced wide enough for errors not to happen 'too
often'.

M=[2 8 16] % b/q/16-psk

EbN0dB = [-4:.1:18]; % Eb/N0 range in dB for simulation


EbN0lin = 10.^(EbN0dB/10);

c1=['b' 'g' 'r']

figure;
ax1=gca
for k=1:1:numel(M)
theoreticalBER = 0.5*erfc(sqrt(EbN0lin*sin(pi/M(k))));
semilogy(EbN0dB,theoreticalBER,c1(k),'LineWidth',1.5);
hold(ax1,'on');
end

title('Probability of Bit Error for QPSK modulation');


xlabel('E_b/N_0(dB)');ylabel('Probability of Bit Error - P_b');
legend({'M=2' 'M=8' 'M=16'});grid on;

[POZAR] searches for 'rayleigh' and 'rician' return a handful of chapters not related to wireless channel models. I also checked for 'rician', and all have to
do with basics of device electromagnetic noise and one left for radar.

There is good literature including MATLAB scripts to simulate digital modulations.

AWGN is the mildest of the wireless channels that base stations and mobile phones use, if lucky to come across one.

Simulating BPSK over AWGN Channel

From [1] bpsk_over_awgn.m

_____________________________________________________________________________________________________________________________ _
John Bofarull Guix jgb2012@sky.com jgb2014@live.co.uk 3/9
POZAR chapter 14: RF MICROWAVE SYSTEMS. Example 06 __ 05/11/2020 13:10:08.

Simulating BPSK over Rayleigh Channel

bpsk_over_rayleigh.m

Simulating BPSK iver Rician Channel


bpsk_over_riican.m

_____________________________________________________________________________________________________________________________ _
John Bofarull Guix jgb2012@sky.com jgb2014@live.co.uk 4/9
POZAR chapter 14: RF MICROWAVE SYSTEMS. Example 06 __ 05/11/2020 13:10:08.

Simulating QPSK over AWGN Channel


qpsk_wfm_sim.m

BPSK/QPSK based modulations allow less signal power to achieve same (low enough) BER compared to FSK and ASK, thus 'protecting' payload in carrier
phase instead of on amplitude of frequency is the preferred choice in most modern systems that have to stand noise interference jamming eavesdropping
and the lot real problems of real communications scenarios.

References

[1] Digital Modulations using MATLAB, build simulation models from scratch
author: Mathuranathan Viswanathan

[2] Wireless Communication Systems in MATLAB


author Mathuranathan Viswanathan

[4] MIMO-OFDM Wireless Communications with MATLAB


authors: Y.Cho J.Kim W.Yang C.Kang

_____________________________________________________________________________________________________________________________ _
John Bofarull Guix jgb2012@sky.com jgb2014@live.co.uk 5/9
POZAR chapter 14: RF MICROWAVE SYSTEMS. Example 06 __ 05/11/2020 13:10:08.

Attachments: support files


bpsk_over_awgn.m author of this script: Mathuranathan Viswanathan

%% BPSK over AWGN channel


% Demonstration of Eb/N0 Vs SER for baseband BPSK modulation scheme
% from book same author: Digital Modulations using MATLAB

clear all;clc;
%---------Input Fields------------------------
N=1000000;%Number of symbols to transmit
EbN0dB = -4:2:20; % Eb/N0 range in dB for simulation

%-----------------Transmitter---------------------
a= randi([0,1],1,N); %uniformly distributed random 1's and 0's
s = 2*a-1; %BPSK Mapping

SER = zeros(length(EbN0dB),1); %Place holder for SER values for each Eb/N0
EbN0lin = 10.^(EbN0dB/10); %Converting Eb/N0 from dB to linear scale
for i=1:1:length(EbN0dB),
%Compute and add channel noise for given Eb/N0
Esym=sum(abs(s).^2)/(length(s)); %calculate actual symbol energy from generated samples
N0=Esym/EbN0lin(i); %find the noise spectral density
noiseSigma = sqrt(N0/2); %standard deviation for AWGN Noise
n = noiseSigma*(randn(1,N)+1i*randn(1,N));
y=s+n;%received signal = signal+awgn noise
%---------------Receiver--------------------
acap=(y>=0);%threshold detection
SER(i)=sum((a~=acap))/N;%------ Symbol Error Rate Computation-------
end
%------Theoretical Symbol Error Rate-------------
theoreticalSER = 0.5*erfc(sqrt(EbN0lin));
%-------------Plotting---------------------------
semilogy(EbN0dB,SER,'k*'); hold on;
semilogy(EbN0dB,theoreticalSER,'r-');
set(gca,'XLim',[-4 12]);set(gca,'YLim',[1E-6 1E0]);set(gca,'XTick',-4:2:12);
title('Probability of Symbol Error for BPSK signals');
xlabel('E_b/N_0 (dB)');ylabel('Probability of Symbol Error - P_s');
legend('Simulated', 'Theoretical');grid on;

_____________________________________________________________________________________________________________________________ _
John Bofarull Guix jgb2012@sky.com jgb2014@live.co.uk 6/9
POZAR chapter 14: RF MICROWAVE SYSTEMS. Example 06 __ 05/11/2020 13:10:08.

bpsk_over_rayleigh author of this script: Mathuranathan Viswanathan

% Demonstration of Eb/N0 Vs BER for baseband BPSK modulation scheme over Rayleigh Fading
clear all; clc;
%---------Input Fields------------------------
N=1000000;%Number of symbols to transmit
EbN0dB = -4:2:20; % Eb/N0 range in dB for simulation
M=2; %2-PSK

%-----Initialization of various parameters----


EbN0lin = 10.^(EbN0dB/10); %Converting to linear scale
BER_rayleigh = zeros(length(EbN0lin),1); %Place holder for BER values for each Eb/N0
BER_awgn = zeros(length(EbN0lin),1); %Place holder for BER values for each Eb/N0

%-----------------Transmitter---------------------
a= randi([0,1],1,N); %uniformly distributed random 1's and 0's
s = 2*a-1; %BPSK Mapping

for i=1:1:length(EbN0lin),
%----------------Channel---------------------
%Adding noise with variance according to the required Es/N0
Esym=sum(abs(s).^2)/(length(s)); %Calculate actual symbol energy from generated samples
N0=Esym/EbN0lin(i); %Find the noise spectral density
noiseSigma = sqrt(N0/2); %Standard deviation for AWGN Noise
n = noiseSigma*(randn(1,N)+1i*randn(1,N));%computed noise

h=1/sqrt(2)*(randn(1,N)+1i*randn(1,N)); %Rayleigh Flat Fading - single tap

y_rayleigh=h.*s+n;%received signal through Rayleigh flat Fading and AWGN Noise


y_awgn=s+n;%received signal through AWGN Channel

%---------------Receiver--------------------
yRayleighEqualized=y_rayleigh./h;%Equalizer for Rayleigh Channel
aCapRayleigh=(yRayleighEqualized>=0); %BPSK detection for signal through Rayleigh channel
aCapAWGN=(y_awgn>=0); %BPSK detection for signal through AWGN channel

%------ Bit Error Rate Computation-------


BER_rayleigh(i)=sum((a~=aCapRayleigh))/N;
BER_awgn(i)=sum((a~=aCapAWGN))/N;
end
%------Theoretical Bit Error Rate-------------
theoretical_rayleigh=0.5*(1-sqrt(EbN0lin./(1+EbN0lin)));
theoretical_awgn = 0.5*erfc(sqrt(EbN0lin));
%-------------Plotting---------------------------
figure();set(gcf,'Color',[1 1 1]);
semilogy(EbN0dB,theoretical_rayleigh,'r-');hold on;semilogy(EbN0dB,BER_rayleigh,'k*');
semilogy(EbN0dB,theoretical_awgn,'g-');semilogy(EbN0dB,BER_awgn,'b*'); grid on;
set(gca,'XLim',[-4 12]);set(gca,'YLim',[1E-6 1E0]);set(gca,'XTick',-4:2:12);
title('Probability of Bit Error for BPSK signals over Rayleigh and AWGN Channels','fontsize',12);
xlabel('E_b/N_0 (dB)');ylabel('Probability of Bit Error - P_b');
h_legend=legend( 'Rayleigh fading-theoretical','Rayleigh fading-simulated','AWGN channel-theoretical','AWGN channel-simulated');

_____________________________________________________________________________________________________________________________ _
John Bofarull Guix jgb2012@sky.com jgb2014@live.co.uk 7/9
POZAR chapter 14: RF MICROWAVE SYSTEMS. Example 06 __ 05/11/2020 13:10:08.

bpsk_over_rician author of this script: Mathuranathan Viswanathan

%Eb/N0 Vs BER for BPSK over Rician Fading Channel with AWGN noise
clc; clear all;
%--------Inputs-------------------------------------------------
N=10^6; %Number of data samples to send across the Rician Channel
EbN0dB=0:2:20; %Eb/N0 in dB overwhich the performance has to be simulated
K_factors=[0 2 5 10 20 30 10000]; %a list of Ricial K factors to simulate
%--------------------------------------------------------------

a=rand(1,N)>0.5; %data generation


s=2*a-1; %BPSK modulation

simBER_ricean=zeros(1,length(EbN0dB));%Place holder for BER values for each Eb/N0

plotStyle={'b*-','ro-','kx-','gs-','md-','cp-','yv-'};
for index =1:length(K_factors)

kappa=K_factors(index);
S=sqrt(1/(kappa+1));%power of scattered components
A=sqrt(kappa/(kappa+1));%power of LOS components

for i=1:length(EbN0dB)
g_t=1/sqrt(2)*(randn(1,N)+1i*randn(1,N)); %Rayleigh Fading - complex Gaussian RV
h=(A+S*g_t); %Rician Fading from Rayleigh Fading

%Adding noise with variance according to the required Es/N0


Esym=sum(abs(s).^2)/(length(s)); %actual symbol energy from generated samples
N0=Esym/10^(EbN0dB(i)/10); %Find the noise spectral density
noiseSigma = sqrt(N0/2); %Standard deviation for AWGN Noise
n = noiseSigma*(randn(1,N)+1i*randn(1,N)); %Add noise in IQ plane.

y_ricean=h.*s+n; %received signal through Rician channel

%---------------Receiver--------------------
y_ricean_cap=y_ricean./h; %Equalizer - assuming that h is known at the receiver accurately
r_ricean=real(y_ricean_cap)>0; %threshold detector for BPSK
simBER_ricean(i)=sum(xor(a,r_ricean));%calculate total bit Errors
end
simBER_ricean=simBER_ricean/N;%Bit Error rates;
semilogy(EbN0dB,simBER_ricean,plotStyle{index},'LineWidth',1.0);hold on
legendInfo{index} = ['K = ' num2str(K_factors(index))];
end
axis([0 20 10^-5 10^0]);legend(legendInfo);
title('Performance of BPSK over Rician Channels with AWGN noise');
xlabel('Eb/N0(dB)');ylabel('Pb -Bit Error Rate');

_____________________________________________________________________________________________________________________________ _
John Bofarull Guix jgb2012@sky.com jgb2014@live.co.uk 8/9
POZAR chapter 14: RF MICROWAVE SYSTEMS. Example 06 __ 05/11/2020 13:10:08.

qpsk_wfm_sim.m author of this script: Mathuranathan Viswanathan

% Demonstration of Eb/N0 Vs BER for QPSK (waveform simulation)


clear all;clc;
N=100000;%Number of bits to transmit
EbN0dB = -4:2:10; % Eb/N0 range in dB for simulation
fc=10e9;%carrier frequency in Hertz
OF =8; %oversampling factor, sampling frequency will be fs=OF*fc

EbN0lin = 10.^(EbN0dB/10); %converting dB values to linear scale


BER = zeros(length(EbN0dB),1); %For BER values for each Eb/N0

a = rand(N,1)>0.5; %random bits - input to QPSK


[s,t] = qpsk_mod(a,fc,OF);%QPSK modulation

for i=1:length(EbN0dB),
Eb=OF*sum(abs(s).^2)/(length(s)); %compute energy per bit
N0= Eb/EbN0lin(i); %required noise spectral density from Eb/N0
n = sqrt(N0/2)*(randn(1,length(s)));%computed noise
r = s + n;%add noise
a_cap = qpsk_demod(r,fc,OF); %QPSK demodulation
BER(i) = sum(a~=a_cap.')/N;%Bit Error Rate Computation
end
%------Theoretical Bit Error Rate-------------
theoreticalBER = 0.5*erfc(sqrt(EbN0lin));%Theoretical bit error rate
%-------------Plot performance curve------------------------
figure;semilogy(EbN0dB,BER,'k*','LineWidth',1.5); %simulated BER
hold on; semilogy(EbN0dB,theoreticalBER,'r-','LineWidth',1.5);
title('Probability of Bit Error for QPSK modulation');
xlabel('E_b/N_0 (dB)');ylabel('Probability of Bit Error - P_b');
legend('Simulated', 'Theoretical');grid on;

Where is the whole collection of exercises?

This exercise is part of the collection of exercises Microwave Engineering POZAR 4th ed solved with MATLAB available in this website:
https://jgb2012.wixsite.com/microwave-eng-matlab

How can one get the main literature reference?

For instance from:


https://www.amazon.co.uk/Microwave-Engineering-David-M-Pozar/dp/0470631554

What about the solutions manual?

It's freely available https://www.scribd.com/doc/176505749/Microwave-engineering-pozar-4th-Ed-solutions-manual

For educational purposes only: https://www.copyrightuser.org/understand/exceptions/education/

_____________________________________________________________________________________________________________________________ _
John Bofarull Guix jgb2012@sky.com jgb2014@live.co.uk 9/9

Das könnte Ihnen auch gefallen