Docsity

Wireless Communicatin Network, Study notes of Wireless Communication Systems

Toggle sidebar
bg1
1
INDEX
Exp. No.
Name of the experiment
Date
Sign.
1
Introduction to basic digital baseband communication through
MATLAB simulations
2
Bluetooth voice transmission: effect of AWGN and 802.11b
interference
3
Developing a mobile application for wireless technology using
an online app-builder wizard
4
Line coding techniques
5
Binary Amplitude Shift Keying (BASK)
6
Binary Phase Shift Keying (BPSK)
7
Quadrature Phase Shift Keying (QPSK)
8
Delta Modulation (DM)
9
Adaptive Delta Modulation (ADM)
10
Direct Sequence Spread Spectrum (DSSS)
11
WSN node position and LED blink
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c

Partial preview of the text

Download Wireless Communicatin Network and more Study notes Wireless Communication Systems in PDF only on Docsity!

INDEX

Exp. No. Name of the experiment Date Sign.

1 Introduction to basic digital baseband communication through

MATLAB simulations

2 Bluetooth voice transmission: effect of AWGN and 802.11b

interference

3 Developing a mobile application for wireless technology using

an online app-builder wizard

4 Line coding techniques

5 Binary Amplitude Shift Keying (BASK)

6 Binary Phase Shift Keying (BPSK)

7 Quadrature Phase Shift Keying (QPSK)

8 Delta Modulation (DM)

9 Adaptive Delta Modulation (ADM)

10 Direct Sequence Spread Spectrum (DSSS)

11 WSN node position and LED blink

Experiment No. 1

Aim: To simulate a basic digital baseband communication link (source, line coder, AWGN channel, matched-

filter receiver) in MATLAB and to measure its bit error rate (BER).

Software required: MATLAB R2018a or later with the Communications Toolbox (for awgn).

Theory: In baseband transmission the data waveform is sent directly over the channel without a carrier. Each

binary digit is mapped to a pulse of duration Tb; with polar NRZ signalling, bit 1 becomes +A and bit 0 becomes

  • A.

The channel adds white Gaussian noise n(t), so the receiver sees r(t) = s(t) + n(t). The optimum receiver is a matched filter,

which for a rectangular pulse is an integrate-and-dump circuit: r(t) is integrated over one bit period and the result is compared

with a threshold (0 for equiprobable polar signals).

For polar NRZ signalling in AWGN the theoretical error probability is ๐‘ƒ

๐‘’

๐‘

0

), where Eb is the energy per bit

and N0 the noise power spectral density. A higher SNR gives a lower BER.

Procedure

  1. Open MATLAB and create a new script (File > New > Script); save it as exp1_baseband.m.
  2. Generate N random bits with randi and map them to a polar NRZ waveform using repelem.
  3. Pass the waveform through the AWGN channel with awgn at the chosen SNR.
  4. Reshape the received samples bit by bit and integrate each bit (matched filter), then compare with the threshold 0.
  5. Count the errors to compute the BER and plot the input bits, transmitted signal, received signal and recovered bits.
  6. Run the script (F5) and note the Command Window output and the figure.

Program

Experiment No. 2

Aim: To simulate Bluetooth-type voice transmission using MATLAB and to observe the effect of AWGN and of

802.11b (Wi-Fi) interference on the received bit stream.

Software required: MATLAB R2018a or later with the Communications Toolbox; Simulink (optional, for the

block-diagram version).

Theory: Bluetooth works in the 2.4 GHz ISM band, which is divided into 79 channels of 1 MHz and uses

frequency hopping at 1600 hops per second. Voice (SCO link) is carried as 64 kb/s PCM, and Basic Rate

Bluetooth uses Gaussian frequency shift keying (GFSK) with a modulation index of about 0.32 (deviation around

160 kHz at 1 Msym/s, i.e. mega symbols per second), so the modulation index is

๐‘ 

2 ร— 160 kHz

1 Msym/s

An IEEE 802.11b network uses direct-sequence spread spectrum in the same 2.4 GHz band with a bandwidth of about 22

MHz. A Wi-Fi burst that overlaps a Bluetooth hop acts as strong wideband noise and causes bit errors, so the packet may

be lost.

In this simulation the voice signal is quantized to 8-bit PCM and sent as binary FSK (fskmod). The channel is first AWGN

only, and then AWGN plus bursts of wideband noise that occupy 30 % of the time at an SIR of 0 dB, which models 802.11b

interference. The BER is measured against SNR for both cases. A Simulink version uses the blocks: Sine Wave > Quantizer

> FSK Modulator > AWGN Channel (+ interference source) > FSK Demodulator > Error Rate Calculation.

Procedure

  1. Create a new script and save it as exp2_bluetooth.m.
  2. Generate a test voice signal (300 Hz + 900 Hz tones) and quantise it to 8-bit PCM.
  3. Generate random bits and modulate them with fskmod (2 tones, 320 kHz spacing, 8 samples per symbol).
  4. Add AWGN with awgn for each SNR value from - 10 dB to 12 dB.
  5. Add wideband noise bursts (30 % duty cycle, SIR = 0 dB) to model the 802.11b interferer.
  6. Demodulate with fskdemod, compute the BER for both cases and plot BER versus SNR on a log scale.
  7. Compare the two curves; for the Simulink model, connect the blocks listed in the theory and run the model.

Program

Output

Result: The BER falls as the SNR increases. With 802.11b interference present the BER is higher at every SNR

and the curve flattens at high SNR, so interference rather than noise limits the link.

Precautions

  1. Keep the sampling frequency at least twice the highest frequency present.
  2. Use enough bits per SNR point (at least 10^4) for a stable BER.
  3. Make sure the interference power is defined relative to the signal power (SIR).
  4. Initialise the BER arrays or clear old variables before every run.
  5. Check that the Communications Toolbox is installed before using fskmod.

Output

Result: A mobile application on wireless technology was developed with the online wizard and tested in the

preview emulator. Its Home, Wi-Fi Standards and Contact Us pages worked as designed.

Precautions

  1. Use correct and verified technical data in the content pages.
  2. Keep the menu simple, with clear button names and readable font sizes.
  3. Check the app on different screen sizes in the preview before publishing.
  4. Do not enter personal passwords or private data in the demo app.
  5. Keep the internet connection stable while saving and previewing.

Experiment No. 4

Aim: To simulate the line coding techniques unipolar NRZ, polar NRZ, unipolar RZ, AMI and Manchester in

MATLAB and to observe their waveforms.

Software required: MATLAB R2018a or later (Simulink optional for a block-diagram version).

Theory: Line coding converts a binary data sequence into a digital waveform that suits the channel. A good line

code has no DC component, enough transitions for clock recovery, small bandwidth and some error-detection

ability.

Code Rule Remark

Unipolar NRZ 1 = +A, 0 = 0 for the whole bit Simple, has a DC component

Polar NRZ 1 = +A, 0 = - A No DC for equal 1s and 0s, long runs lose

timing

Unipolar RZ 1 = +A for half the bit, then 0; 0 = 0 Gives transitions on every 1

AMI (bipolar) 0 = 0; 1s alternate between +A and - A No DC, detects single errors

Manchester 1 = low to high, 0 = high to low (IEEE

Transition in every bit, no DC, needs twice

the bandwidth

In Simulink the same waveforms can be produced with a Bernoulli Binary Generator, a Gain/Bias block for the level shift,

and a Scope.

Procedure

  1. Create a script exp4_linecoding.m and define the input bits [1 0 1 1 0 0 1 0].
  2. Generate unipolar NRZ and polar NRZ by repeating each bit fs times with repelem.
  3. Generate unipolar RZ by multiplying the NRZ signal with a half-bit pulse.
  4. Generate AMI using a loop that flips the polarity at every 1.
  5. Generate Manchester by multiplying the polar bits with the pattern [-1 +1] in every bit period.
  6. Plot the five waveforms in subplots and run the program.

Output

Result: The line codes for the sequence 10110010 were generated and plotted. Manchester coding shows a

transition in every bit, and AMI alternates the polarity of successive 1s.

Precautions

  1. Keep fs even so that half a bit period contains an integer number of samples.
  2. Check that all waveform vectors have the same length before plotting.
  3. Reset the AMI polarity variable before every run.
  4. Use ylim so that all levels are visible on the plot.
  5. Label each subplot clearly.

Experiment No. 5

Aim: To simulate the modulation and coherent demodulation of Binary Amplitude Shift Keying (BASK) using

MATLAB and Simulink.

Software required: MATLAB R2018a or later with the Communications Toolbox; Simulink.

Theory: In BASK the amplitude of a high-frequency carrier is switched between two values by the binary data.

In its simplest form (on-off keying) a 1 is sent as a burst of the carrier and a 0 is sent as no carrier:

๐‘ (๐‘ก) = ๐ด sin( 2 ๐œ‹๐‘“

๐‘

๐‘ก) for bit 1, ๐‘ (๐‘ก) = 0 for bit 0

The bandwidth of BASK is about 2Rb. Coherent demodulation multiplies the received signal by a locally generated carrier

and integrates over one bit; the average of A sin

2

(wt) is A/2, so the decision threshold is set to

๐ด

2

4

(0.25 for A = 1). BASK is

simple but sensitive to noise and fading because the information is in the amplitude.

Simulink model: Pulse Generator (data) x Sine Wave (carrier) > AWGN Channel > Product with carrier > Integrate and

Dump > Relational Operator (threshold).

Procedure

  1. Create the script exp5_bask.m and define the bit sequence, carrier frequency (5 Hz), and sampling rate.
  2. Generate the message signal with repelem and the carrier with sin.
  3. Multiply the message and the carrier to obtain the BASK signal.
  4. Add AWGN (SNR = 15 dB) using awgn.
  5. Multiply the received signal with the carrier, integrate over each bit, and compare with the threshold 0.25.
  6. Plot the message, carrier, modulated signal and the demodulated bits, then run the program.

Program

Experiment No. 6

Aim: To simulate the modulation and coherent demodulation of Binary Phase Shift Keying (BPSK) using

MATLAB and Simulink and to find its bit error rate.

Software required: MATLAB R2018a or later with the Communications Toolbox; Simulink.

Theory: In BPSK the phase of the carrier is switched between two values, 0 and 180 degrees, according to the

data bit. The two signals are antipodal:

1

= ๐ด sin( 2 ๐œ‹๐‘“

๐‘

bit 1

0

= โˆ’๐ด sin( 2 ๐œ‹๐‘“

๐‘

bit 0

BPSK is generated by multiplying the polar NRZ data (+1 / - 1) with the carrier. It needs a coherent receiver: the received

signal is multiplied by a synchronised carrier and integrated over one bit, and the sign of the result gives the bit (threshold

0). The bandwidth is 2Rb, and the error probability in AWGN is

๐‘’

๐‘

0

which is the best among binary schemes at the same Eb/N0. Because of the antipodal signals BPSK is 3 dB better than

coherent BASK or FSK. The Simulink model uses: Random Integer Generator > BPSK Modulator Baseband > AWGN

Channel > BPSK Demodulator Baseband > Error Rate Calculation.

Procedure

  1. Create the script exp6_bpsk.m and define the data bits, carrier frequency and sampling rate.
  2. Generate the message and carrier signals.
  3. Multiply the carrier with (2*message - 1) to get the BPSK signal.
  4. Pass the signal through an AWGN channel with SNR = 10 dB.
  5. Demodulate coherently: multiply by the carrier, integrate over each bit, and use threshold 0.
  6. Calculate the BER with biterr, plot the five waveforms and run the program.
  7. For the Simulink model, build the blocks listed above, set the simulation time and run.

Program

Output

Experiment No. 7

Aim: To simulate QPSK modulation and demodulation in an AWGN channel using MATLAB and Simulink, to

plot the constellation and to compare the simulated BER with the theoretical BER.

Software required: MATLAB R2018a or later with the Communications Toolbox; Simulink.

Theory: QPSK sends two bits per symbol by using four carrier phases (45, 135, 225 and 315 degrees). The bit

stream is split into an in-phase (I) and a quadrature (Q) stream, each of which modulates one of two carriers that

are 90 degrees apart:

โˆš 2

[๐ผcos( 2 ๐œ‹๐‘“

๐‘

๐‘ก) โˆ’ ๐‘„sin( 2 ๐œ‹๐‘“

๐‘

๐‘ก)], ๐ผ, ๐‘„ โˆˆ {+ 1 , โˆ’ 1 }

Because two bits share one symbol, the bandwidth is half of that of BPSK at the same bit rate (null-to-null bandwidth Rb

instead of 2Rb). With Gray coding, adjacent symbols differ by only one bit, and the bit error rate in AWGN is the same as

for BPSK:

๐‘

๐‘

0

The constellation diagram shows the four points on a circle; noise scatters the received points around them, and a symbol

error occurs when a point crosses a decision boundary (the I and Q axes). Simulink model: Random Integer Generator (M

= 4) > QPSK Modulator Baseband > AWGN Channel > QPSK Demodulator Baseband > Error Rate Calculation, with a

Constellation Diagram block.

Procedure

  1. Create the script exp7_qpsk.m and set the number of symbols (10^5) and the Eb/N0 range 0 to 10 dB.
  2. Generate random integers 0 to 3 and modulate them with pskmod(data,4,pi/4,'gray').
  3. For every Eb/N0, add AWGN (Es/N0 = Eb/N0 + 3 dB), demodulate with pskdemod and count bit errors with biterr.
  4. Compute the theoretical BER with qfunc.
  5. Plot the transmitted constellation, the received constellation at 8 dB, and the BER curves.
  6. Run the program and note the BER at 6 dB.

Program

Output

Result: QPSK was simulated in an AWGN channel. The simulated BER agrees closely with the theoretical curve

(about 2.5 x 10^-3 at Eb/N0 = 6 dB) and falls rapidly as Eb/N0 increases.

Precautions

  1. Use enough symbols (at least 10^5) to measure small BER values reliably.
  2. Convert Eb/N0 to Es/N0 correctly (add 10 log10 of the bits per symbol).
  3. Use the same phase offset and mapping at the modulator and demodulator.
  4. Do not plot only a few received points when judging the spread; use a few hundred.
  5. Do not take log of a zero BER on the semilog plot.

Program

Output

Result: Delta modulation was simulated. With delta = 0.2 (800 V/s, above the limit of 628 V/s) the staircase

follows the sine wave; with delta = 0.05 (200 V/s) slope overload distortion appears.

Precautions

  1. Sample at a rate much higher than the Nyquist rate of the input.
  2. Choose the step size by the slope-overload condition.
  3. Start the accumulator at zero at both modulator and demodulator.
  4. Define local functions at the end of the script (R2016b or later) or save them in separate files.
  5. Use the same step size in the encoder and the decoder.