Академический Документы
Профессиональный Документы
Культура Документы
This Wireless and Mobile Communication Systems laboratory workbook covers those practicals
that are very knowledgeable and quite beneficial in grasping the core objective of the subject.
These practical solidify the theoretical and practical concepts that are very essential for the
engineering students. This work book comprise of practical covering on the topics of wireless
and mobile communication systems that are designed to develop on Matlab software. Above all
this workbook contains a relevant documentation of the laboratory sessions.
Laboratory 1
Simulation of Wireless Communication Systems
The tradeoff between higher data rates and higher susceptibility to noise at higher orders of
modulation (like 64QAM).
randint();
stem();
hist();
Questions:
Generate and record the stem plot for the first 50 bits
Generate complex white Gaussian noise whose power is 2 watts, across a load of 60 ohms.
Modulation Terminology
Modulation is a process by which a carrier signal is altered according to information in a message
signal. The frequency of the carrier signal is usually much greater than the highest frequency of
the input message signal. The Nyquist sampling theorem requires that the simulation sampling
rate, fs, should be greater than two times the sum of the carrier frequency and the highest
frequency of the modulated signal in order for the demodulator to recover the message correctly.
Modulating a Signal
The basic procedure for modulating a signal with MPSK and MQAM involves these steps:
1 Construct a modulator object depending on your modulation type.
2 Adjust properties of the modulator object, if necessary, to tailor it to your needs. For example,
you can change the phase offset or symbol order.
5
3 Modulate your signal by applying the modulate method of the modulator object, as described in
the following section.
Modem Modulation Method
Modulator objects have a method modulate that is used to modulate signals. The syntax is y =
modulate (h, x), where h is the handle to a modulator object and x is a signal. When mapping
input bits to symbols, the first bit is interpreted as the most significant bit. For h.inputtype = `bit'
(i.e., x represents binary input), nBits consecutive elements in each channel or column represent a
symbol, where nBits =log2(M). For h.inputtype = `integer' (i.e., x represents symbol input),
elements of x must be in the range [0, M-1].
Demodulating a Signal
The basic procedure for demodulating a signal with MPSK and MQAM involves these steps:
1 Construct a demodulator object depending on your modulation type.
2 Adjust properties of the demodulator object, if necessary, to tailor it to your needs. For
example, you can change the phase offset or symbol order.
3 Demodulate your signal by applying the demodulate method of the demodulator object, as
described in the following section.
Modem Demodulation Method
Demodulator objects have a method demodulate that is used to demodulate signals. The syntax is
y = demodulate (h, x), where h is the handle to a demodulator object and x is a signal. This
syntax processes the binary words (bits) or symbols (integers) in signal x with the PSK or QAM
demodulator object and output the baseband signal y. The demodulator objects property
DecisionType should be set depending on whether you want hard or soft decisions. To allow for
soft decisions, the demodulator objects property OutputType must be set to 'bit'.
In the next section we will see the principle of QAM modulation. Similar analysis is done for
PSK modulations.
Generally we use the modulation object that we have shown in the tables above to modulate the
signal. In this case, we can change the property of the modulation parameters according to our
design specifications.
QAM Modulator (QAMMOD)
H = modem.qammod (M) constructs a QAM modulator object H for M-ary modulation.
H = modem.qammod (property1, value1, ...) constructs a QAM modulator object H with
properties as specified by property/value pairs.
7
The properties that are unique to the QAM modulator object are set to default values. A QAM
modulator object has the following properties. All the properties are writable except for the ones
explicitly noted otherwise.
Type - Type of modulation object ('QAM Modulator'). This property is not
writable. M - M-ary value.
PhaseOffset - Phase offset of ideal signal constellation in radians.
Constellation- Ideal signal constellation. This property is not writable and is automatically
computed based on M and PhaseOffset properties.
SymbolOrder- Type of mapping employed for mapping symbols to ideal constellation points.
The choices are:
SymbolMapping - Symbol mapping is a list of integer values from 0 to M-1 that correspond to
ideal constellation points. This property is writable only when SymbolOrder is
set to 'user-defined'; otherwise it is automatically computed.
InputType - Type of input to be processed by QAM modulator object. The choices are:
For instance the syntax H = MODEM.QAMMOD constructs a QAM modulator object H with
default properties. It constructs a modulator object for 16-QAM modulation and is equivalent
to: H = modem.qammod ('M', 16, 'phaseoffset', 0, 'symbolorder', 'binary', 'InputType', 'integer')
Example:
% Construct an object to modulate binary data using 64-QAM modulation.
% The constellation has Gray mapping.
h = modem.qammod('M', 64, 'SymbolOrder', 'Gray', 'InputType', 'Bit')
Es / N0 (dB) = 10log10 (0.5Tsym / Tsamp ) + SNR (dB) , for real input signals
where Tsym is the signals symbol period and Tsamp is the signals sampling period. For
example, if a complex baseband signal is oversampled by a factor of 4, then Es/N0 exceeds the
corresponding SNR by 10 log10(4).
Eye Diagram Plots
An eye diagram is a simple and convenient tool for studying the effects of intersymbol
interference and other channel impairments in digital transmission. To construct an eye diagram,
plot the received signal against time on a fixed time interval axis. At the end of the fixed time
interval, wrap around to the beginning of the time axis. The resulting diagram consists of many
overlapping curves.
Questions
10
k = log2(M);
n = 3e4;
nsamp=1
% Oversampling rate
figure(1)
stem(x(1:40),'filled');
title('Random Bits');
xlabel('Bit Index');
ylabel('Binary Value');
%-------------------------------------------------------------------------------------------------------------%% Binary Bit to Symbol Mapping
% Used to convert the bits in x into k-bit symbols.
% Reshape(x,m,n) returns the m-by-n matrix whose elements are taken column wise from x.
% An error results if X does not have M*N elements.
xsym = bi2de(reshape(x,k,length(x)/k).','left-msb');
11
plot(y);
xlabel('Inphase component');
ylabel('Quadrature component');
title ('Modulated signal');
figure(7)
eyediagram(yrx,8);
%-----------------------------------------------------------------------------%% Scatter Plot of the original and noisy signal
% Create scatter plot of noisy signal and transmitted
% signal on the same axes.
figure(4)
h = scatterplot(yrx(1:nsamp*5e3),nsamp,0,'g.');
hold on;
scatterplot(ytx(1:5e3),1,0,'k*',h);
title('Received Signal');
legend('Received Signal','Signal Constellation');
axis([-5 5 -5 5]); % Set axis ranges.
hold off;
%-----------------------------------------------------------------------------------------%% Demodulation of the received signal
% Demodulate the signal using 16-QAM.
zsym = demodulate(modem.qamdemod(M),yrx);
%-------------------------------------------------------------------------------------------%% Symbol-to-Bit Mapping
% Undo
the
bit-to-symbol
mapping
performed
earlier. z = de2bi(zsym,'left-msb');
% Convert integers to bits.
% Convert z from a matrix to a vector.
z = reshape(z.',prod(size(z)),1);
%---------------------------------------------------------------------------------------%% Compute the BER the system
% Compare x and z to obtain the number of errors and
% the bit error rate.
[number_of_errors,bit_error_rate] = biterr(x,z);
% end of the program
%---------------------------------------------------------------------------------------------------------13
14