syllabus ec 6512 – communication systems...

100
SYLLABUS EC 6512 – COMMUNICATION SYSTEMS LAB LTPC 0032 III B.E ECE – V SEMESTER (REGULATION 2013) LIST OF EXPERIMENTS 1. Signal Sampling and reconstruction 2. Time Division Multiplexing 3. AM Modulator and Demodulator 4. FM Modulator and Demodulator 5. Pulse Code Modulation and Demodulation 6. Delta Modulation and Demodulation 7. Observation (simulation) of signal constellations of BPSK, QPSK and QAM 8. Line coding schemes 9. FSK, PSK and DPSK schemes (Simulation) 10. Error control coding schemes - Linear Block Codes (Simulation) 11. Equalization – Zero Forcing & LMS algorithms(simulation) OBJECTIVE: To analyze analog, pulse and digital modulation techniques both using hardware components and using MATLAB.

Upload: dinhlien

Post on 17-Mar-2018

214 views

Category:

Documents


2 download

TRANSCRIPT

SYLLABUS

EC 6512 – COMMUNICATION SYSTEMS LAB LTPC 0032

III B.E ECE – V SEMESTER

(REGULATION 2013)

LIST OF EXPERIMENTS

1. Signal Sampling and reconstruction

2. Time Division Multiplexing

3. AM Modulator and Demodulator

4. FM Modulator and Demodulator

5. Pulse Code Modulation and Demodulation

6. Delta Modulation and Demodulation

7. Observation (simulation) of signal constellations of BPSK, QPSK and QAM

8. Line coding schemes

9. FSK, PSK and DPSK schemes (Simulation)

10. Error control coding schemes - Linear Block Codes (Simulation)

11. Equalization – Zero Forcing & LMS algorithms(simulation)

OBJECTIVE:

To analyze analog, pulse and digital modulation techniques both using hardware components and using MATLAB.

INDEX

Ex

NoDate Name of the Experiment Mark Instructor

Sign

1 SIGNAL SAMPLING AND RECONSTRUCTION

2 TIME DIVISION MULTIPLEXING

3 AMPLITUDE MODULATION AND DEMODULATION

4 FREQUENCY MODULATION AND DEMODULATION

5 PULSE CODE MODULATION AND DEMODULATION

6 DELTA MODULATION AND DEMODULATION

7 SIGNAL CONSTELLATIONS OF BPSK, QPSK

AND QAM USING MATLAB

8 LINE CODING SCHEMES

9 DIGITAL MODULATION & DEMODULATION – FSK, PSK and DPSK USING MATLAB

10 ERROR CONTROL CODING USING MATLAB

11 EQUALIZATION – ZERO FORCING & LMS ALGORITHMS USING MATLAB

ADDITIONAL EXPERIMENTS

12 DESIGN OF PROCESS CONTROL TIMER

13 DESIGN OF PSUEDO RANDOM SEQUENCE GENERATOR

BLOCK DIAGRAM:

EXPERIMENT NO. 1 DATE:

SIGNAL SAMPLING AND RECONSTRUCTION Aim:

To obtain the sampled version of given analog signal at different sampling frequency and reconstruct it using second, fourth and sixth order low pass filter. Equipments and Components required:

S.No Apparatus Range Quantity

1 DCLT 001 Trainer kit 1

2 Power Supply 1

3 Dual Trace Oscilloscope

1

4 Function Generator 1

5 Patch Card - -

Pre-lab questions:

1. What is the need for sampling? 2. Define sampling and aliasing effect. 3. Define Nyquist rate.

Theory:

Sampling is the reduction of a continuous signal to a discrete signal. A sample refers to a value or set of values at a point in time and/or space. Sampling can be done for functions varying in space, time, or any other dimension, and similar results are obtained in two or more dimensions.

For functions that vary with time, let s(t) be a continuous function (or "signal") to

be sampled, and let sampling be performed by measuring the value of the continuous function every T seconds, which is called the sampling interval. Thus, the sampled function is given by the sequence:

s(nT), for integer values of n. The sampling frequency or sampling rate fs is defined as the number of samples

obtained in one second (samples per second), thus fs = 1/T.

Reconstructing a continuous function from samples is done by interpolation algorithms. The Whittaker–Shannon interpolation formula is mathematically equivalent to an ideal low pass filter whose input is a sequence of Dirac delta functions that are modulated (multiplied) by the sample values. When the time interval between adjacent

CONNECTION DIAGRAM:

samples is a constant (T), the sequence of delta functions is called a Dirac comb. Mathematically, the modulated Dirac comb is equivalent to the product of the comb function with s(t). That purely mathematical function is often loosely referred to as the sampled signal. Types of sampling:

1. Natural sampling In natural sampling the pulse has a finite width. Natural sampling is sometimes called chopper sampling because the waveform of the sampled signal appears to be chopped off from the original signal waveform.

2. Flat-Top sampling This is also a practically possible sampling method. Natural sampling is little complex, but it is very easy to get flat top samples. The top of the samples remains constant and equal to instantaneous value of baseband signal x(t) at the start of sampling.

Tabulation:

Model graph:

Natural Sampling: Procedure:

1. Connect the 2 kHz 5Vp-p signal generated onboard to the ANALOG INPUT (S2). 2. Connect the sampling signal in the INTERNAL mode, by means of the shorting

pin provided. 3. Connect SAMPLE OUTPUT (S4) to the INPUT of the second, fourth and sixth

order low pass filter. Observations:

1. Observe the 2 kHz signal and sampling signal at TP28. 2. Observe the output of sampling amplifier at SAMPLE OUTPUT (TP32). 3. Observe the reconstructed signal at S11, S12 and S13.

Flat-Top Sampling:

1. Connect the 2 kHz 5Vp-p signal generated onboard to the ANALOG INPUT (S2). 2. Connect the sampling signal in the INTERNAL mode, by means of the shorting

pin provided. 3. Connect SAMPLE OUTPUT (S6) to the INPUT of the second, fourth and sixth

order low pass filter.

Observations:

1. Observe the output of sampling and hold amplifier at SAMPLE OUTPUT (TP34). 2. Observe the reconstructed signal at S11, S12 and S13.

Post lab questions:

1. What is zero order hold? 2. Define Nyquist sampling theorem. 3. What are the limitations of sampling?

Result: Thus given analog signal was sampled at different frequency and reconstructed successfully.

Particulars Marks

Allotted Marks

ObtainedPreparation (Pre-lab questions & Procedure)

20

Connection & Testing 20 Observation 20 Calculation & Graph 20 Viva – Voce (Post-lab questions)

10

Record 10 Total 100 Faculty Signature

EXPERIMENT NO. 2 DATE:

TIME DIVISION MULTIPLEXING Aim:

To perform Time division multiplexing and de-multiplexing using PAM signals. Equipment’s and Components required:

S.NO. APPARATUS RANGE QUANTITY

1 DCLT002 Trainer kit - 1

2 Power Supply - 1

3 Dual Trace Oscilloscope

- 1

4 Function Generator - 1

5 Patch card - -

Pre-lab questions:

1. In what order does synchronous time division multiplexing sample each of the incoming signals?

2. What would happen if a synchronous time division multiplexor sampled the incoming signals out of order?

3. How does a synchronous time division multiplexor stay synchronized with the de-multiplexer on the receiving end?

Theory: The method of combining several sampled signals in a definite time sequence is called time-division multiplexing (TDM).In a time division multiplexing (TDM) system, a single path and carrier frequency is used. TDM is a digital technology. Each user is assigned a unique time slot for their operation. A central switch or multiplexer, goes from one user to the next in a specific, predictable sequence and time.TDM system can be applied when the data rate capacity of the transmission medium is greater than the data rate required by the sending and receiving devices. TDM is more efficient than FDM, in that it does not require guard bands and it operate directly in digital form. In TDM, the transmission between the multiplexer is provided by a single high speed digital transmission line. Each connection produces a digital information flow that is then inserted into high speed line.

FIGURE: 1 CHANNEL MULTIPLEXING LOGIC Unity Gain Buffer CD 4016 Switch CH0 I0 O1

CH1 I1 O2

TXD CH2 I2 O3 CH3 I3 O4 C0 C1 C2 C3 TXCH0 Y0 Y1 Y2 Y3 CP 74LS128 A0 A1 TXCLOCK 74LS74 Delay flip -flops 74LS74 32KHz CP Q CP Q D Q D Q The two basic forms of TDM are:

1. Synchronous time division multiplexing Synchronous TDM assigns time slots of equal length to all

packets regardless whether or not anything is to be sent by each station with an assigned time slot.

2. Asynchronous time division multiplexing The total speed of the input lines can be greater than the

capacity of the path. This system is more complex but allows fro a means of reassigning time slots that are not in use. Its assign time slots only when they are to be used and delete them when they are idle.

Procedure: 1. Connect the 4 channel inputs of 250Hz, 500Hz, 1 KHz, 2 KHz to the Multiplexer inputs CH0, CH1, CH2, CH3 respectively. 2. Observe the time division multiplexed PAM waveform at the output of the Multiplexer. 3. Observe the four different signals placed in their respective time slots. 4. Vary each of the amplitude of each channel and see the effect on the TDM waveform. 5. Also observe the de-multiplexed signals.

FIGURE: 2 CHANNEL DEMULTIPLEXING LOGIC CD 4016 Switch I0 O1 RXCH0 I1 O2 RXCH1 RXD I2 O3 RXCH2 I3 O4 RXCH3 RXCH0 RXCH1 RXCH2 RXCH3 Y0 Y1 Y2 Y3 CP A0 A1 RXCLK 32KHz CP Q CP Q D MR Q D MR Q

RXCH0

Delay Flip-Flops

Tabulation:

Channels

Amplitude (Volts)

Time period (sec)

Input

De-multiplexed

Input

De-multiplexed

CH0

CH1

CH2

CH3 

Observation:

Observe that the four different signals are interleaved in their respective time slots without overlapping each other. Their positions and identification can be highlighted by reducing the other signal amplitudes to zero and then gradually increasing them to observe them occupying their positions.

Model graph:

Fig (a) The signal x (t) and its PAM signal (b) TDM of two PAM signals

Post lab questions:

1. In fig, the data rate for each input connection is 3kbps. If 1 bit at a time is multiplexed (1 unit is 1 bit), what is the duration of (a) each input slot, (b) each output slot, and (c) each frame?

2. Fig shows synchronous TDM with a data stream for each input and one data

stream for the output. The unit of data is 1 bit. Find (a) the input bit duration, (b) the output bit duration, (c) the output bit rate, and (d) the output frame rate.

3. Four 1 kbps connections are multiplexed together. A unit is 1 bit. Find (a) the

duration of 1 bit before multiplexing, (b) the transmission rate of the link, (c) the duration of a time slot, and (d) the duration of a frame.

Result:

Thus the four continuous-time signals were sampled and samples were multiplexed then transmitted at transmitter by channel multiplexing logic, then signals were reconstructed from the samples at the receiver by channel de-multiplexing logic.  

Particulars Marks

Allotted Marks

ObtainedPreparation (Pre-lab questions & Procedure)

20

Connection & Testing 20 Observation 20 Calculation & Graph 20 Viva – Voce (Post-lab questions)

10

Record 10 Total 100 Faculty Signature

EXPERIMENT NO. 3 DATE:

AMPLITUDE MODULATION AND DEMODULATION Aim:

To Verify and test the amplitude modulation and demodulation for different value of the modulation index. Equipments and Components required:

S.NO. APPARATUS RANGE QUANTITY

1 ACLT001 Trainer kit - 1

2 Power Supply - 1

3 Dual Trace Oscilloscope

- 1

4 Function Generator - 1

5 Patch Card - -

Pre-lab questions:

1. What is Amplitude Modulation? 2. Represent Amplitude Modulation via Mathematical Expressions 3. What will happen, if modulation index is greater than 100%?

Theory: The modulation is simply a method of combining two different signals and is used in the transmitter section of a communication system. The two signals that are used are the information signal and the carrier signal. Amplitude Modulation is the simplest form of signal processing in which the carrier amplitude is simply changed according to the amplitude of the information signal hence the name Amplitude modulation. When the information signals amplitude is increased the carrier signals amplitude is increased and when the information signals amplitude is decreased the carrier signals amplitude is decreased. The purpose of any detector or demodulator is to recover the original modulating signal with the minimum of distortion and interference. The simplest way of dealing with an AM signal is to use a simple half- wave rectifier circuit. If the signal were simply passed through a diode to a resistive load, the output would be a series of half-cycle pulses at carrier frequency. So the diode is followed by a filter, typically a capacitor and resistor in parallel. The capacitor is charged by the diode almost to the peak value of

the carrier cycles and the output therefore follows the envelope of the amplitude modulation. Procedure: Modulation

1. Refer to the connection diagram and carry out the following connections. 2. Connect the patch cord S1 RF output to modulated RF input S3. 3. Connect the patch cord AF output S2 to AF input S4. 4. Connect ground to ground SG1 to SG2. 5. Vary the RF generator and vary AF generator. 6. Observe the AM output on S5 or TP5 for different value of modulation index.

Demodulation

1. Refer to the connection diagram and carry out the following connections. 2. Connect the patch cords from S5 to S6. 3. Connect the patch cords from SG3 to SG4. 4. Observe the demodulation output at S7 or TP7 for different value of modulation

index.

Model graph: Amplitude Modulation:

Tabulation:

S. No

Carrier Signal Volts

Message Signal

Vm (p–p) Volts

Emax Volts

Emin Volts

Practical M= E max – E min E max + E min

%

Theoretical M= A max – A min A max + A min

%

Amplitude Demodulation:

Post lab questions:

1. The most efficient modulation is carried out when m=? 2. What is the band width for AM? 3. Sketch the AM signal for the periodic triangle signal m(t) shown in fig corresponding

to the modulation index a) μ=0.5 b) μ=1 c) μ=2 d) μ=∞

Result:

Thus Amplitude modulation and demodulation was verified and tested by AM

trainer kit and its output graph was drawn.

Particulars Marks

Allotted Marks

ObtainedPreparation (Pre-lab questions & Procedure)

20

Connection & Testing 20 Observation 20 Calculation & Graph 20 Viva – Voce (Post-lab questions)

10

Record 10 Total 100 Faculty Signature

Connection Diagram:

EXPERIMENT NO. 4 DATE:

FREQUENCY MODULATION AND DEMODULATION Aim:

To verify and test the frequency modulation and demodulation for different amplitude value of modulating signal. Equipments and Components required:

S.NO. APPARATUS RANGE QUANTITY

1 FM Trainer kit - 1

2 Power Supply 1

3 Dual Trace Oscilloscope

1

4 Function Generator 1

Pre-lab questions:

1. Calculate and plot the spectrum (in dB) of an FM signal centered at 122 KHz with a maximum deviation of 10 KHz and mf = 1 and mf = 2. For each case, determine the modulation frequency and the Carson’s bandwidth of the signal.

2. Which mathematical expression is used to decide the side band amplitudes in a FM signal?

Theory: Frequency modulation is also called as angle modulation. Frequency modulation is defined as changing the frequency of the carrier with respect to the message signal amplitude. Here the amplitude of the carrier remains fixed & timing parameter frequency is varied. When the modulating signal has zero amplitude, then the carrier has frequency of Fc as amplitude of the modulating signal increases. The frequency of the carrier increases, similarly, as the amplitude of the modulating signal decreases, the frequency of the carrier decreases.

The modulation index is defined as the ratio of the maximum frequency deviation to the modulating frequency. The maximum frequency deviation is the shift from center frequency fc when the amplitude of the modulating signal is maximum.

By Carlson’s rule BW = 2 (∆F+ fm (max)) Where

∆F = Maximum frequency deviation fm(max) = Maximum modulating frequency

Procedure: Modulation

1. Refer to the connection diagram and carry out the following connections. 2. Connect the patch cord S01 AF output to Modulating signal input S02. 3. Connect ground to ground SG1 to SG2. 4. Vary the modulation POT. 5. Observe the FM output on S04 or TP4.

Demodulation

1. Refer to the connection diagram and carry out the following connections. 2. Connect the patch cords from S04 to S05. 3. Connect the patch cords from GND to GND. 4. Observe the demodulation output at S06 or TR6.

Tabulation: Carrier signal: Amplitude (Ec) = …………..Vp-p & its frequency (fc) = ……….......KHz

Modulating signal

Amplitude Vm (p-p)

Volts

FM Signal Maximum frequency fmax (KHz)

FM Signal Minimum frequency fmin (KHz)

Modulation index

Practical Theoretical

Modulating signal frequency 500Hz

Modulating signal frequency 5KHz

Model graph: Frequency Modulation:

Frequency Demodulation:

Calculation for Theoretical Modulation index:

Post lab questions:

1. What will be the changes in the wave under FM when the amplitude or frequency of the modulating signal is increased?

2. The FM station has less noise while receiving the signal. Justify your answer. 3. What happens when a stronger signal and a weaker signal both overlap at the

same frequency in FM?

Result:

Thus frequency modulation and demodulation was verified and tested by FM trainer kit and its output graph was drawn.

Particulars Marks

Allotted Marks

ObtainedPreparation (Pre-lab questions & Procedure)

20

Connection & Testing 20 Observation 20 Calculation & Graph 20 Viva – Voce (Post-lab questions)

10

Record 10 Total 100 Faculty Signature

BLOCK DIAGRAM:

EXPERIMENT NO. 5 DATE:

PULSE CODE MODULATION AND DEMODULATION

Aim:

To perform the pulse code modulation and demodulation and to plot the waveforms for binary data at different frequencies.

Equipments and Components required:

S.no. Apparatus Range Quantity

1 DCLT003and DCLT004 Trainer kit

- 1

2 Power Supply - 1

3 Dual Trace Oscilloscope

- 1

4 Function Generator - 1

5 Patch Card - -

Pre-lab questions:

1. State sampling theorem. 2. What do you mean by quantizing process? 3. What will happen when sampling rate is less than Nyquist rate?

Theory:

Pulse code modulation is a process of converting an analog signal into digital. The voice or any data input is first sampled using a sampler (which is a simple switch) and then quantized. Quantization is the process of converting a given signal amplitude to an equivalent binary number with fixed number of bits. This quantization can be either mid-tread or mid-raise and it can be uniform or non-uniform based on the requirements. For example in speech signals, the higher amplitudes will be less frequent than the low amplitudes. So higher amplitudes are given less step size than the lower amplitudes and thus quantization is performed non-uniformly. After quantization the signal is digital and the bits are passed through a parallel to serial converter and then launched into the channel serially.

At the demodulator the received bits are first converted into parallel frames and each frame is de-quantized to an equivalent analog value. This analog value is thus equivalent to a sampler output. This is the demodulated signal.

In the kit this is implemented differently. The analog signal is passed through a ADC (Analog to Digital Converter) and then the digital code word is passed through a

parallel to serial converter block. This is modulated PCM. This is taken by the Serial to parallel converter and then through a DAC to get the demodulated signal. The clock is given to all these blocks for synchronization. The input signal can be either DC or AC according to the kit. The waveforms can be observed on a CRO for DC without problem. AC also can be observed but with poor resolution. Procedure:

1. Connect 500Hz to CH0 and 1 kHz to CH1. 2. Set the speed selection switch to fast mode. 3. Connect the scope to CH0 and ch1 fro observing the channel inputs. 4. Connect the scope to observe the sampling clocks at TP7 and TP8. 5. Observe the sampling &hold amplifier (PAM) output at TP12 w.r.t sampling clock. 6. Vary the amplitude level (0 to 4.9V) from DC source and observe the amplitude level of

the ADC input at TP12 using Oscilloscope. 7. Verify the ADC output at the LEDS and tabulate the LED display. (ON for logic ‘0’)

Notes: The multiplexed output shows the proper alignment of samples in their respective time slots. Also verify that the amplitude of the samples at any instant of time is equal to the amplitude of the sampled signal at that instant of time. Tabulation:

Model graph:

Post lab questions:

1. Determine the minimum line speed to transmit an audio signal (20 Hz to 20 kHz) as a 10-bit PCM signal.

2. A binary channel with bit rate Rb=36000 bits/sec is available for PCM voice transmission. Find the sampling rate, the quantizing level, and the binary bits n, assuming fm = 3.2 kHz.

3. An analog signal is sampled at the Nyquist rate fs and quantized into L levels. Find the time duration τ of 1 bit of the binary encoded signal.

Result:

Thus the PCM signal was obtained and the original signal was demodulated from PCM signal.

Particulars Marks

Allotted Marks

ObtainedPreparation (Pre-lab questions & Procedure)

20

Connection & Testing 20 Observation 20 Calculation & Graph 20 Viva – Voce (Post-lab questions)

10

Record 10 Total 100 Faculty Signature

BLOCK DIAGRAM: MODULATION:

DEMODULATION:

EXPERIMENT NO. 6 DATE:

DELTA MODULATION AND DEMODULATION Aim:

1. To perform the encoding and decoding process of linear delta modulation and to plot the corresponding waveforms.

2. To identify the slope overload and granular noise of the delta modulated signals.

Equipment’s and Components required:

S.no. Apparatus Range Quantity

1 DCLT008 Trainer kit - 1

2 Power Supply - 1

3 Dual Trace Oscilloscope

- 1

4 Function Generator - 1

5 Patch Card - -

Prelab questions:

1. What are two types of quantization errors? How to reduce the quantization noise that occurs in DM?

2. If the variation of the message signal is less than the step size what happens to the output signal. If the variation of the message signal is greater than the step size what happens to the output.

3. Write down the conditions to avoid slope overload.

Theory:

Delta modulation is an encoding process where the logic levels of the transmitted pulses indicate whether the decoded output should rise or fall at each pulse. The delta encoding process samples, quantizes and encodes the intelligence signal into a digital signal. The instantaneous voltage of an intelligence signal is compared to the feedback signal. The result of the comparison is quantized and encoded and appears as a logic 1 or logic 0, depending on which sample voltage is greater. The encoded logic levels make up the digital signal. Delta modulation requires simple hardware for encoding an intelligence signal. The encoding process consists of a digital sampler and an integrator as shown in figure.

CONNECTION DIAGRAM: MODULATOR:

The digital sampler consists of a comparator and a D- type flip-flop. The intelligence signal drives the non-inverting input of the comparator. The feedback signal from the integrator drives the inverting input of the comparator. During each clock signal the comparator compares the present sample voltage of the intelligence signal with the feedback signal. The feedback signal is an approximate voltage of the previous intelligence signal sample. If the intelligence signal is greater than the feedback signal, the comparator outputs logic 1 to the D input of the D-type flip-flop. If the intelligence signal is less than the feedback signal the comparator outputs a negative signal to the D-type flip flop. The Q output of the D-type flip-flop is 0v on the leading edge of the next clock pulse. The Q output of the D type flip-flop is the digital signal. The digital signal contains the information needed by an integrator to generate the approximate intelligence signal (feedback signal).

The integrator outputs an upward sloping ramp as the feedback signal when the digital signal is at logic 1. When the digital signal is at logic0, the integrator outputs a downward sloping ramp as the feedback signal. The digital signal is the difference between the intelligence and feedback signals. Procedure: Modulation:

1. Connect PLA1 to PLAA. 2. Connect channel m1 to CRO to TPA1/TPAA; adjust VR1 to minimum to get zero

level signals. 3. Connect channel 1 to TP1 to channel 2 to TPB1 and adjust VR2 to obtain square

wave half the frequency of the clock rate selected (output at TP1). 4. Connect channel 1 to TP2 and set voltage /div of channel 1 to mV range and

observe a triangle waveform, which is output of integrator. It can be observed that the clock rate is increased, amplitude of triangle waveform decreases. This is minimum step size.(clock rate can be changed by depressing SW1 switch).

5. Connect channel 1 to TPA1, TPAA; adjust VR1 in order to obtain a 1 KHz sine wave of 500 mVpp approximately.

6. Signal approximating 1 KHz is available at the integrator output (TP2); this signal is obtained by integrating the digital output resulting from delta modulation.

7. Connect channel 1 to TP2 and channel 2 to TPB1; it can be observed that the digital high makes the integrator output to go upwards and digital low makes the integrator output to go downwards.

8. With an oscilloscope displaying three traces, it is possible to simultaneously observe the input signal of the modulation, the digital output of the modulator and the signal obtained by the integration from the modulator digital output.

Notice that, when the output (feedback signal) is lower that the analog input the digital output is high, whenever it is low when the analog input is lower that the integrated output.

9. Increase the amplitude of 1 KHz sine wave by rotating VR1 to Vpp and observe that the integrator output follows the input signal.

DEMODULATOR:

10. Increase the amplitude of 1 KHz sine wave further high, and observe that the integrator output cannot follow the input signal. 11. Repeat the above-mentioned procedures with different signal sources and selecting different clock rates and observe the response of the linear delta modulator.

Demodulation:

1. Prearrange the connections of Linear Delta Modulator.

2. Connect PLBI (Digital output of Delta Modulator) to PLBB (input of Linear Delta modulator).

3. Connect PLC1 (Linear Delta Demodulator output) to either PLCA (input of fourth order LPF) or PLCB (input of Second order LPF).

Observations:

Observe the reconstructed output of the fourth order Low Pass Filter at TD1 and also observe the output of the second order filter at TPD2.

Slope Overload Noise:

Procedure:

1. Connect the 2 kHz signal source to the input of the linear delta modulator as

illustrated in the previous.

2. Set the experimental setup as previous.

3. Connect one channel of the oscilloscope to the point TPAA and the other channel to TP2.

Observations:

1. Observe that the slope of the integrated signal is less than the slope. 2. Observe the slope overload noise with different signals and at different clock

rates. 3. Observe the amplitude of the reconstructed signal and compare with the original

signal.

Granular Noise: Procedure:

1. Retain the experimental setup as in previous. 2. Connect the 1 kHz signal to the delta modulator input PLAA. 3. Connect one channel of the oscilloscope to the test point TPAA and the other

channel to the test point TP2. 4. Slowly reduce the amplitude of the input signal till the point occurs where the

slope of the ramp signal exceeds that of the input signal indicating almost a no-change region in the signal.

MODEL GRAPH:

Observations:

1. Observe the quantization noise at the point TP2. 2. Observe the reconstructed signal with different clock rates.

Tabulation:

SLOPE OVERLOAD NOISE:

GRANULAR NOISE:

Postlab questions:

1. Explain the meaning of “Delta” in the definition of Delta Modulation. Mention few applications of DM.

2. Discuss how the quantization step size affects quantization noise and slope overload noise and why?

3. Discuss how the quantization step size affects quantization noise and slope overload noise and why?

Result:

Thus the encoding and decoding process of linear delta modulation were performed and graphs were plotted.

Particulars Marks

Allotted Marks

ObtainedPreparation (Pre-lab questions & Procedure)

20

Connection & Testing 20 Observation 20 Calculation & Graph 20 Viva – Voce (Post-lab questions)

10

Record 10 Total 100 Faculty Signature

Program: % Setting up parameters for modulation type clc clear close all data = randi([0,1],1000,1); % generating binary data of 1000 bits with ones and zeros mod_type = input('Enter the modulation type[1 for BPSK,2 for QPSK,3 for 16QAM,4 for 64QAM]: '); norm_factor = [1.0;0.7071;0.3162;0.1543]; % normalization factors, 1.0:BPSK,0.7071:QPSK,0.3162:16QAM,0.1543:64QAM nc=[1;2;4;6]; % number of bits per subcarrier, 1:BPSK,2:QPSK,4:16QAM,6:64QAM input_seq = data; k = norm_factor(mod_type); mode = nc(mod_type); % Selecting constellation point as per modulation type switch mode case 1 b=k*[1 -1]; case 2 b=k*[1+1i -1+1i 1-1i -1-1i]; case 4 b=k*[1+1i 1+3i 1-1i 1-3i 3+1i 3+3i 3-1i 3-3i -1+1i -1+3i -1-1i -1-3i -3+1i -3+3i -3-1i -3-3i]; case 6 b=k*[3+3i 3+1i 3+5i 3+7i 3-3i 3-1i 3-5i 3-7i 1+3i 1+1i 1+5i 1+7i 1-3i 1-1i 1-5i 1-7i 5+3i 5+1i 5+5i 5+7i 5-3i 5-1i 5-5i 5-7i 7+3i 7+1i 7+5i 7+7i 7-3i 7-1i 7-5i 7-7i -3+3i -3+1i -3+5i -3+7i -3-3i -3-1i -3-5i -3-7i -1+3i -1+1i -1+5i -1+7i -1-3i -1-1i -1-5i -1-7i -5+3i -5+1i -5+5i -5+7i -5-3i -5-1i -5-5i -5-7i -7+3i -7+1i -7+5i -7+7i -7-3i -7-1i -7-5i -7-7i]; end count=1; count1=1; for i=1:(ceil(length(input_seq)/mode)) temp=0; for j=1:mode temp=bitor(temp,bitshift(input_seq(count),(j-1))); count=count+1; if(count>length(input_seq)) break; end end map_out(count1)=b(temp+1); count1=count1+1; end figure; plot(real(map_out),imag(map_out),'r.'); title('constellation');

EXPERIMENT NO. 07 DATE:

SIGNAL CONSTELLATIONS OF BPSK, QPSK AND QAM

USING MATLAB

Aim: To write the program in MATLAB for signal constellations of BPSK, QPSK and

QAM.

Equipments and Components required:

S.No. Apparatus Quantity

1 PC 1

2 Matlab – R2014b -

Algorithms: Initialization commands

Result:

Thus the program for signal constellations of BPSK, QPSK and QAM has been simulated in MATLAB and necessary graphs are plotted.

Particulars Marks Allotted

Marks Obtained

Preparation(Pre-lab questions & Procedure)

20

Program 40 Observation 20 Viva – Voce (Post-lab questions)

10

Record 10 Total 100 Faculty Signature

Model graph:

EXPERIMENT NO. 08 DATE:

LINE CODING SCHEMES

Aim:

To obtain the standard digital codes from the source coded signals using various techniques. Equipments and Components required:

S.no. Apparatus Range Quantity

1 DCLT005 Trainer kit - 1

2 Power Supply - 1

3 Dual Trace Oscilloscope

- 1

4 Function Generator - 1

5 Patch Card - -

Pre-lab questions:

1. What are the different types of coding techniques for digital data? 2. State the concept of Manchester coding. 3. Differentiate polar and bipolar.

Theory:

In digital systems, the electrical waveforms are coded representations of the original information. If the original information is an analog signal, this must be converted to a series of discrete values that can be transmitted digitally. The process of converting the original information into a data sequence is referred to as source coding.

The line coding is the process of converting source coded signals into standard digital

codes for the purpose of transmission over the channel. There are many possible ways of assigning the waveforms into the digital data. Simplest form of coding is ONOFF, where a ‘1’ is transmitted by a pulse and a ‘0’ is transmitted by no pulse. Generally the line coding is used in transmitter section while decoding in receiver section. The line decoding is the process of converting standard digital codes into source coded waveforms.

Tabulation:

S.No Coding techniques ON time OFF time

1. NRZ - L

2. NRZ - M

3. NRZ - S

4. URZ

5. BIϕ – L

6. BIϕ - M

7. BIϕ - S

8. AMI

Procedure:

1. Generate the different binary data format signals using DCLT005. 2. Tabulate the on time and off time.

Post lab questions:

1. Determine the minimum line speed to transmit an audio signal (20 Hz to 20 kHz) as a 10-bit PCM signal.

2. A binary channel with bit rate Rb=36000 bits/sec is available for PCM voice transmission. Find the sampling rate, the quantizing level, and the binary bits n, assuming fm = 3.2 kHz.

3. An analog signal is sampled at the Nyquist rate fs and quantized into L levels. Find the time duration τ of 1 bit of the binary encoded signal.

Result:

Thus the PCM signal was obtained and the original signal was demodulated from PCM signal.

Particulars Marks

Allotted Marks

ObtainedPreparation (Pre-lab questions & Procedure)

20

Connection & Testing 20 Observation 20 Calculation & Graph 20 Viva – Voce (Post-lab questions)

10

Record 10 Total 100 Faculty Signature

Program:

%FSK Modulation

clc;

clearall;

closeall;

%GENERATE CARRIER SIGNAL

Tb=1; fc1=2;fc2=5;

t=0:(Tb/100):Tb;

c1=sqrt(2/Tb)*sin(2*pi*fc1*t);

c2=sqrt(2/Tb)*sin(2*pi*fc2*t);

%generate message signal

N=8;

m=rand(1,N);

t1=0;t2=Tb;

fori=1:N

t=t1:(Tb/100):t2;

if m(i)>0.5

m(i)=1;

m_s=ones(1,length(t));

invm_s=zeros(1,length(t));

else

m(i)=0;

m_s=zeros(1,length(t));

invm_s=ones(1,length(t));

end

EXPERIMENT NO. 09 DATE:

DIGITAL MODULATION & DEMODULATION – FSK, PSK and DPSK USING

MATLAB

Aim: To write the program in MATLAB for ASK, FSK, BPSK and QPSK modulation

and demodulation

Equipments and Components required:

S.No. Apparatus Quantity

1 PC 1

2 Matlab software 1

Pre lab questions:

1. What is the disadvantage of ASK? 2. What is the difference between PSK and DPSK?

Algorithms: Initialization commands FSK modulation 1. Generate two carriers signal. 2. Start FOR loop 3. Generate binary data, message signal and inverted message signal 4. Multiply carrier 1 with message signal and carrier 2 with inverted message signal 5. Perform addition to get the FSK modulated signal 6. Plot message signal and FSK modulated signal. 7. End FOR loop. 8.Plot the binary data and carriers. FSK demodulation 1. Start FOR loop 2. Perform correlation of FSK modulated signal with carrier 1 and carrier 2 to get two

decision variables x1 and x2. 3. Make decision on x = x1-x2 to get demodulated binary data. If x>0, choose ‘1’ else

choose ‘0’. 4. Plot the demodulated binary data.

message(i,:)=m_s;

%Multiplier

fsk_sig1(i,:)=c1.*m_s;

fsk_sig2(i,:)=c2.*invm_s;

fsk=fsk_sig1+fsk_sig2;

%plotting the message signal and the modulated signal

subplot(3,2,2);axis([0 N -2 2]);plot(t,message(i,:),'r');

title('message signal');xlabel('t---->');ylabel('m(t)');grid on;holdon;

subplot(3,2,5);plot(t,fsk(i,:));

title('FSK signal');xlabel('t---->');ylabel('s(t)');grid on;holdon;

t1=t1+(Tb+.01); t2=t2+(Tb+.01);

end

holdoff

%Plotting binary data bits and carrier signal

subplot(3,2,1);stem(m);

title('binary data');xlabel('n---->'); ylabel('b(n)');grid on;

subplot(3,2,3);plot(t,c1);

title('carrier signal-1');xlabel('t---->');ylabel('c1(t)');grid on;

subplot(3,2,4);plot(t,c2);

title('carrier signal-2');xlabel('t---->');ylabel('c2(t)');grid on;

%FSK Demodulation

t1=0;t2=Tb;

fori=1:N

t=t1:(Tb/100):t2;

%correlator

x1=sum(c1.*fsk_sig1(i,:));

x2=sum(c2.*fsk_sig2(i,:));

x=x1-x2;

%decision device

if x>0

PSK modulation 1. Generate carrier signal. 2. Start FOR loop 3. Generate binary data, message signal in polar form 4. Generate PSK modulated signal. 5. Plot message signal and BPSK modulated signal. 6. End FOR loop. 7. Plot the binary data and carrier. PSK demodulation 1. Start FOR loop

Perform correlation of PSK signal with carrier to get decision variable 2. Make decision to get demodulated binary data. If x>0, choose ‘1’ else choose ‘0’ 3. Plot the demodulated binary data. DPSK modulation 1. Generate quadrature carriers. 2. Start FOR loop 3. Generate binary data, message signal(bipolar form) 4. Multiply carrier 1 with odd bits of message signal and carrier 2 with even bits of message

signal 5. Perform addition of odd and even modulated signals to get the DPSK modulated signal 6. Plot DPSK modulated signal. 7. End FOR loop. 8. Plot the binary data and carriers.

demod(i)=1;

else

demod(i)=0;

end

t1=t1+(Tb+.01);

t2=t2+(Tb+.01);

end

%Plotting the demodulated data bits

subplot(3,2,6);stem(demod);

title(' demodulated data');xlabel('n---->');ylabel('b(n)'); grid on;

t=t1:(Tb/100):t2;

%correlator

x1=sum(c1.*fsk_sig1(i,:));

x2=sum(c2.*fsk_sig2(i,:));

x=x1-x2;

%decision device

if x>0

% MATLAB Script for a Binary PSK with two Phases

Format long;

% Clear all variables and close all figures

Clear all;

Close all;

% The number of bits to send - Frame Length

N = 8;

% Generate a random bit stream

bit_stream = round(rand(1,N));

% Enter the two Phase shifts - in Radians

% Phase for 0 bit

P1 = 0;

% Phase for 1 bit

DPSK demodulation 1. Start FOR loop 2. Perform correlation of DPSK modulated signal with quadrature carriers to get two

decision variables x1 and x2. 3. Make decision on x1 and x2 and multiplex to get demodulated binary data.

If x1>0and x2>0, choose ‘11’. If x1>0and x2<0, choose ‘10’. If x1<0and x2>0, choose ‘01. If x1<0and x2<0, choose ‘00’.

End FOR loop Plot demodulated data

P2 = pi;

% Frequency of Modulating Signal

f = 3;

% Sampling rate - This will define the resoultion

fs = 100;

% Time for one bit

t = 0: 1/fs : 1;

% This time variable is just for plot

time = [ ];

PSK_signal = [ ];

Digital_signal = [ ];

for ii = 1: 1: length(bit_stream)

% The FSK Signal

PSK_signal = [PSK_signal (bit_stream(ii)==0)*sin(2*pi*f*t + P1)+...

(bit_stream(ii)==1)*sin(2*pi*f*t + P2)];

% The Original Digital Signal

Digital_signal = [Digital_signal (bit_stream(ii)==0)*...

zeros(1,length(t)) + (bit_stream(ii)==1)*ones(1,length(t))];

time = [time t];

t = t + 1; end

% Plot the PSK Signal

subplot(2,1,1);

plot(time,PSK_signal,'LineWidth',2);

xlabel('Time (bit period)');

ylabel('Amplitude');

title('PSK Signal with two Phase Shifts');

axis([0 time(end) -1.5 1.5]);

grid on;

% Plot the Original Digital Signal

subplot(2,1,2);

plot(time,Digital_signal,'r','LineWidth',2);

xlabel('Time (bit period)');

ylabel('Amplitude');

title('Original Digital Signal');

axis([0 time(end) -0.5 1.5]);

gridon;

%DPSK Modulation

Result:

Thus the program for FSK, PSK and DPSK modulation and demodulation has been simulated in MATLAB and necessary graphs were plotted.

Particulars Marks Allotted

Marks Obtained

Preparation(Pre-lab questions & Procedure)

20

Program 40 Observation 20 Viva – Voce (Post-lab questions)

10

Record 10 Total 100 Faculty Signature

Program: % Caption: Repetition Codes clc; clear all; close all; n = 5; % block of identical'n'bits k = 1; % one bit m = 1; % bit value = 1 I = eye (n-k,n-k); % Identity matrix P = ones (1,n-k); % coefficient matrix H = [I P']; % parity check matrix G = [P 1]; % generator matrix x = m*G; % code word disp(['The generator matrix is G = ' num2str(G)]); disp('The parity check matrix is H = '); disp (H); disp('The code word is x = '); disp (x); % Caption: Hamming Codes clc; clear all; close all; k = 4; % message bits length n = 7; % block length m = n-k; % Number of parity bits I = eye(k,k); % identity matrix disp (' The identity matrix Ik = ') disp (I); P =[1 1 0; 0 1 1;1 1 1;1 0 1]; % coefficient matrix disp (' The coefficient matrix P = '); disp(P); G = [P I]; % generator matrix disp (' The generator matrix G = '); disp(G); % message bits for i = 1:2^k for j = k:-1:1 if rem(i-1,2^(-j+k+1))>=2^(-j+k) m(i,j)=1; else m(i,j)=0; end end end disp ('The Possible message words m = '); disp(m); x1 = m*G; x = mod(x1,2); disp ('The Possible Codewords of (7,4) Hamming code x = '); disp(x);

EXPERIMENT NO. 10 DATE:

ERROR CONTROL CODING USING MATLAB

Aim:

To write the program in MATLAB for the following error control coding

techniques.

1. Linear Block Codes- Repetition, Hamming and Cyclic codes 2. Convolutional Codes

Apparatus Required:

S.NO. APPARATUS QUANTITY

1 PC 1

2 Matlab software 1

Pre-Lab Questions:

1. What are the functions of generator and parity check matrix? 2. What is the purpose of minimum Hamming distance? 3. What is difference between systematic and non-systematic codes?

Theory:

Errors in data transmission/storage systems can come from many different sources: random noise, interference, channel fading, or physical defects, just to name a few. These channel errors must be reduced to an acceptable level to ensure the quality of data transmission/storage. To combat the errors, we normally use two strategies, either stand-alone or combined. The first one is the automatic repeat request (ARQ). An ARQ system attempts to detect the presence of errors in the received data. If any errors are found, the receiver notifies the transmitter of the existence of errors. The transmitter then resends the data until they are correctly received. The second strategy, known as the forward error correction (FEC), not only detects but also corrects the errors, so that data retransmission can be avoided. In many practical applications retransmission may be difficult or not even feasible at all. For example, it is impossible for any receiver in a real-time broadcasting system to request data to be resent. In this case, FEC is the only viable solution.

Program: d_min = min(sum((x(2:2^k,:))')); disp(['The Minimum Hamming Distance dmin for given Block Code is = ' num2str(d_min)]); % Code Word r = input('Enter the Received Code Word:'); H = [eye(n-k,n-k) P']; % parity check matrix disp (' The parity check matrix H = '); disp (H'); s = mod(r*H',2); disp(['Syndrome of a Given Codeword is = ' num2str(s)]); for i = 1:1:size(H) if(H(i,1:3)==s) r(i) = 1-r(i); break; end end disp(['The Error is in bit = ' num2str(i)]); disp(['The Corrected Codeword is = ' num2str(r)]); % Caption: Convolutional Encoding Time domain approach % Convolutional Code Generation Time Domain Approach clc ; close all; clear all g1 = input('Enter the input Top Adder Sequence = '); g2 = input('Enter the input Bottom Adder Sequence = '); m = input('Enter the message sequence = '); x1 = round(conv(g1 ,m)); x2 = round(conv(g2 ,m)); x1 = mod(x1 ,2); x2 = mod(x2 ,2); N = length(x1); for i =1:length(x1) x(i,:) =[x1(N-i +1) ,x2(N-i +1)]; end c = char(x); disp(c); % Matlab Code for RS coding and decoding n=7; k=3; % Codeword and message word lengths m=3; % Number of bits per symbol msg = gf([5 2 3; 0 1 7;3 6 1],m) % Two k-symbol message words % message vector is defined over a Galois field where the number must %range from 0 to 2^m-1 codedMessage = rsenc(msg,n,k) % Two n-symbol codewords dmin=n-k+1 % display dmin t=(dmin-1)/2 % diplay error correcting capability of the code % Generate noise – Add 2 contiguous symbol errors with first word; % 2 discontiguous symbol errors with second word and 3 distributed symbol

Either way, error control codes (ECC) are used for detecting the presence of errors and correcting them. It first adds redundancy to the message to be sent; this process is called encoding and is carried out at the transmitter. It then corrects errors based on the redundancy in a process called decoding that is performed at the receiver. The output of the encoding process is a code word that contains both the message and the redundancy (explicitly or implicitly). The redundancy is referred to as the parity check, or simply the parity. Algorithm:

1. Get the input binary sequence. 2. Calculate the redundancy bits for the corresponding code. 3. Transmit the signal that contains message bits+redundancy bits added at the end. 4. Calculate the redundancy bits once again for the received bits. 5. If the redundancy bits=’0’ then no error in the transmission otherwise some error

in the transmission.

% errors to last word noise=gf([0 0 0 2 3 0 0 ;6 0 1 0 0 0 0 ;5 0 6 0 0 4 0],m) received = noise+codedMessage %dec contains the decoded message and cnumerr contains the number of %symbols errors corrected for each row. Also if cnumerr(i) = -1 it indicates %that the ith row contains unrecoverable error [dec,cnumerr] = rsdec(received,n,k) % print the original message for comparison msg % Given below is the output of the program. Only decoded message, cnumerr and original % message are given here (with comments inline) % The default primitive polynomial over which the GF is defined is D^3+D+1 (which is 1011 -> 11 in decimal). dec = GF(2^3) array. Primitive polynomial = D^3+D+1 (11 decimal) % BCH encoder and decoder m = 4; n = 2^m-1; % Codeword length k = 5; % Message length nwords = 10; % Number of words to encode msg = gf(randi([0 1],nwords,k)); % Find t, the error-correction capability. [genpoly,t] = bchgenpoly(n,k); % Define t2, the number of errors to add in this example. t2 = t; % Encode the message. code = bchenc(msg,n,k); % Corrupt up to t2 bits in each codeword. noisycode = code + randerr(nwords,n,1:t2); % Decode the noisy code. [newmsg,err,ccode] = bchdec(noisycode,n,k); if ccode==code disp('All errors were corrected.') end if newmsg==msg disp('The message was recovered perfectly.') end

Result:

Thus the error control coding techniques were executed using MATLAB

programs.

Particulars Marks

Allotted Marks

Obtained

Preparation 20

Program 40 Observation 20

Viva – Voce 10

Record 10 Total 100 Faculty Signature

Program:

% Zero forcing equalizer. T = 1; % Bit period tau = 1; % Time constant of channel dt = 0.01; % Sampling time in simulation N = 100; % Number of bits to generate clear t1 t2 c x y % Create output pulse: rectangular pulse convolved with first-order % low-pass filter impulse response. t1 = (dt:dt:T)'; c(1:100,1) = 1 - exp(-t1/tau); t2 = (T+dt:dt:T+5*tau)'; c(101:100+length(t2),1) = c(100)*exp(-(t2-T)/tau); figure(1) plot([t1; t2], c) xlabel('Time (sec)') ylabel('c(t)') title('Smeared pulse c(t)') % Generate bit stream b = rand(N,1); z0 = find(b < 0.5); z1 = find(b >= 0.5); b(z0) = -1*ones(size(z0)); b(z1) = +1*ones(size(z1)); % Create received signal with ISI nT = T/dt; nc = length(c); nx = N*nT; x = zeros(nx, 1); for n=1:N i1 = (n-1)*nT; y = [zeros(i1,1); b(n)*c; zeros(N*nT-i1-nc,1)]; x = x + y(1:nx); end % Plot eye diagram figure(2) t3 = dt:dt:2; plot(t3, x(1:200)); hold on for n=3:2:N plot(t3, x((n-1)*nT+1:(n+1)*nT));

EXPERIMENT NO. 11 DATE:

EQUALIZATION – ZERO FORCING & LMS ALGORITHMS USING MATLAB

Aim: To write the program in MATLAB for Zero forcing and LMS equalization.

Equipments and Components required:

S.No. Apparatus Quantity

1 PC 1

2 Matlab software -

Algorithms: Initialization commands

end hold off xlabel('Time (sec)') title('EYE DIAGRAM WITH NO EQUALIZATION') % Compute number of bit errors xT = x(nT:nT:nx); dz0 = find(xT < 0); dz1 = find(xT >= 0); db = b; db(dz0) = -1*ones(size(dz0)); db(dz1) = +1*ones(size(dz1)); err = find(db ~= b); fprintf('No equalizer: %d bits out of %d in error\n', length(err), N); % Define length of zero-forcing equalizer Ne = 5*tau/T; % Get samples of c(t) to solve for ZF equalizer weights cT = c(nT:nT:nc); csamp = [zeros(2*Ne,1); cT; zeros(2*Ne+1-length(cT),1)]; % Construct the matrix on the left side of ZF equalizer equation C = zeros(2*Ne+1,2*Ne+1); for ne = 1:2*Ne+1 C(ne,:) = csamp(2*Ne+ne:-1:ne)'; end % Right side of ZF equalizer weight equation r = [zeros(Ne,1); 1; zeros(Ne,1)]; % Solve for ZF equalizer weights w = C \ r; % Process the received signal with the ZF equalizer nw = length(w); z99 = [1; zeros(nT-1,1)]; hzf = kron(w, z99); % Impulse response of equalizer yall = conv(x, hzf); % Do the equalization filtering y = yall((Ne*nT+1):(length(yall)-(Ne+1)*nT)+1); % Eye diagram of equalized signal

figure(3) plot(t3, y(1:200)); hold on for n=3:2:N plot(t3, y((n-1)*nT+1:(n+1)*nT)); end hold off xlabel('Time (sec)') title('EYE DIAGRAM AFTER ZF EQUALIZER') % Compute number of bit errors yT = y(nT:nT:nx); dz0 = find(yT < 0); dz1 = find(yT >= 0); db = b; db(dz0) = -1*ones(size(dz0)); db(dz1) = +1*ones(size(dz1)); err = find(db ~= b); fprintf('ZF equalizer: %d bits out of %d in error\n', length(err), N); % Adaptive equalizer based on LMS algorithm. clc clear close all T = 1; % Bit period tau = 3; % Time constant of channel SNR = 100; % Ratio of signal power to noise power (NOT in dB) dt = 0.01; % Sampling time in simulation N = 250; % Number of training bits to generate Ndata = 100; % Number of data bits to generate clear t1 t2 c x y % Create output pulse: rectangular pulse convolved with first-order % low-pass filter impulse response. t1 = (dt:dt:T)'; c(1:100,1) = 1 - exp(-t1/tau); t2 = (T+dt:dt:T+5*tau)'; c(101:100+length(t2),1) = c(100)*exp(-(t2-T)/tau); % The following channel is different from RC LPF % c(101:100+length(t2),1) = c(100)*exp(-(t2-T)/tau).*(1+((t2-T-dt).^2)/20);

figure(1) plot([t1; t2], c) xlabel('Time (sec)') ylabel('c(t)') title('Smeared pulse c(t)') % Generate bit stream b = rand(N,1); z0 = find(b < 0.5); z1 = find(b >= 0.5); b(z0) = -1*ones(size(z0)); b(z1) = +1*ones(size(z1)); % Create received signal with ISI nT = T/dt; nc = length(c); nx = N*nT; x = zeros(nx, 1); for n=1:N i1 = (n-1)*nT; y = [zeros(i1,1); b(n)*c; zeros(N*nT-i1-nc,1)]; x = x + y(1:nx); end % Add noise of the specified level sp = sum(x.*x)/length(x); % Signal power np = sp/SNR; % Noise power noise = sqrt(np) * randn(length(x),1); x = x + noise; % Plot eye diagram figure(2) t3 = dt:dt:2; plot(t3, x(1:200)); hold on for n=3:2:N plot(t3, x((n-1)*nT+1:(n+1)*nT)); end hold off xlabel('Time (sec)') title('EYE DIAGRAM WITH NO EQUALIZATION') % Define length of equalizer Ne = 5*tau/T; % Get samples of c(t) to solve for ZF equalizer weights cT = c(nT:nT:nc); csamp = [zeros(2*Ne,1); cT; zeros(2*Ne+1-length(cT),1)];

% Construct the matrix on the left side of ZF equalizer equation C = zeros(2*Ne+1,2*Ne+1); for ne = 1:2*Ne+1 C(ne,:) = csamp(2*Ne+ne:-1:ne)'; end % Right side of ZF equalizer weight equation r = [zeros(Ne,1); 1; zeros(Ne,1)]; % Solve for ZF equalizer weights wzf = C \ r; % LMS algorithm to estimate the equalizer weights in real-time % using the training data mu = 0.2; xT = x(nT:nT:nx); w = zeros(2*Ne+1,1); % Initialize weights to zero wold = w; wrec = w; for k=(Ne+1):(N-Ne) xk = xT((k+Ne):-1:(k-Ne)); yk = w'*xk; ek = b(k) - yk; w = wold + mu*ek*xk; wrec = [wrec, w]; wold = w; end % Process the received signal with the LMS equalizer nw = length(w); z99 = [1; zeros(nT-1,1)]; hzf = kron(wzf, z99); % Impulse response of ZF equalizer yall = conv(x, hzf); % Do the equalization filtering yzf = yall((Ne*nT+1):(length(yall)-(Ne+1)*nT)+1); h = kron(w, z99); % Impulse response of LMS equalizer yall = conv(x, h); % Do the equalization filtering y = yall((Ne*nT+1):(length(yall)-(Ne+1)*nT)+1); % Eye diagrams of equalized signal figure(3) plot(t3, yzf(1:200)); hold on for n=3:2:N plot(t3, yzf((n-1)*nT+1:(n+1)*nT)); end hold off xlabel('Time (sec)')

title('EYE DIAGRAM AFTER ZF EQUALIZER') figure(4) plot(t3, y(1:200)); hold on for n=3:2:N plot(t3, y((n-1)*nT+1:(n+1)*nT)); end hold off xlabel('Time (sec)') title('EYE DIAGRAM AFTER LMS EQUALIZER') figure(5) plot(wrec') xlabel('TRAINING SAMPLE NUMBER') ylabel('WEIGHT VALUE') title('EVOLUTION OF LMS EQUALIZER WEIGHTS') % Now that training is over, do data transmission. % Generate bit stream b = rand(Ndata,1); z0 = find(b < 0.5); z1 = find(b >= 0.5); b(z0) = -1*ones(size(z0)); b(z1) = +1*ones(size(z1)); % Create received signal with ISI nx = Ndata*nT; x = zeros(nx, 1); for n=1:Ndata i1 = (n-1)*nT; y = [zeros(i1,1); b(n)*c; zeros(Ndata*nT-i1-nc,1)]; x = x + y(1:nx); end % Add noise of the specified level noise = sqrt(np) * randn(length(x),1); x = x + noise; % Perform equalization yall = conv(x, hzf); % ZF yzf = yall((Ne*nT+1):(length(yall)-(Ne+1)*nT)+1); yall = conv(x, h); % Wiener y = yall((Ne*nT+1):(length(yall)-(Ne+1)*nT)+1); % Compute number of bit errors xT = x(nT:nT:nx);

dz0 = find(xT < 0); dz1 = find(xT >= 0); db = b; db(dz0) = -1*ones(size(dz0)); db(dz1) = +1*ones(size(dz1)); err = find(db ~= b); fprintf('No equalizer: %d bits out of %d in error\n', length(err), N); yT = yzf(nT:nT:nx); dz0 = find(yT < 0); dz1 = find(yT >= 0); db = b; db(dz0) = -1*ones(size(dz0)); db(dz1) = +1*ones(size(dz1)); err = find(db ~= b); fprintf('ZF equalizer: %d bits out of %d in error\n', length(err), Ndata); yT = y(nT:nT:nx); dz0 = find(yT < 0); dz1 = find(yT >= 0); db = b; db(dz0) = -1*ones(size(dz0)); db(dz1) = +1*ones(size(dz1)); err = find(db ~= b); fprintf('LMS equalizer: %d bits out of %d in error', length(err), Ndata); fprintf(' (with %d training bits)\n', N);

Result:

Thus the program for Zero forcing and LMS equalization has been simulated in MATLAB and necessary graphs were plotted.

Particulars Marks

Allotted Marks

ObtainedPreparation (Pre-lab questions & Procedure)

20

Program 40 Observation 20 Viva – Voce (Post-lab questions)

10

Record 10 Total 100 Faculty Signature

Circuit Diagram:

EXPERIMENT NO. 12 DATE:

DESIGN OF PROCESS CONTROL TIMER

Aim:

To design sequential timer to switch ON and OFF at least three delays in a particular sequence using IC 555 timer. Equipments and Components required:

S.NO. APPARATUS RANGE QUANTITY

1 IC 555 3

2 Bread Board 1

3 Resistors 33k 3

100k 3

220 3

4 RPS 1

5 Connecting wires As required

6 Capacitors 10f 3

0.01f 6

7 LED 3

Theory:

Sequential timer is the simplest form of the process control timer in which many

timing operations carried out sequentially one by one. Each timing operation is kept in active condition for a predefined amount of time and then goes to off condition. Similarly the controller activates all the operations as per the defined timings.

This type of sequential controller is required for injection moulding machine, back sealing experiments where it required to activate solenoids, relays other activating mechanism for a predefined time sequentially one by one.

Sequential timer is used for control process. The timer IC 555 is operated in monostable mode. The mode monostable multivibrator circuit is useful for generating single output pulse of adjustable data form in response to a trigger signal. The width of the output pulse depends only on external component connected to the op-amp. The output of first multivibrator is given to the trigger input of the second one. Similarly it is connected in sequential order. The time period of each timer determine the triggering period of LED.

Pin diagram:

Model graph:

Observation: LED 1 ON Time =

LED 2 ON Time =

LED 3 ON Time =

Design: This relay should be energised for 1 sec. ON Time TH=1.1*R*C Here we design for 1 sec. By choosing the value of R=100kohm The value of C approximated to C=10microf Similarly we have RA=RB=RC=R=100kohm CA=CB=CC=C=10microf

Procedure:

1. The circuit connections were given as shown in circuit diagram. 2. The triggering is given to pin 2 of timer 1. 3. When the trigger pulse is given the LED glows one by one sequentially.

Result: Thus the circuits for sequential timer was designed, constructed and outputs

were verified.

Particulars Marks

Allotted Marks

ObtainedPreparation 20 Connection & Testing 20 Observation 20 Calculation & Graph 20 Viva – Voce 10 Record 10 Total 100 Faculty Signature

Circuit diagram:

Truth Table:

EXPERIMENT NO. 13 DATE:

DESIGN OF PSUEDO RANDOM SEQUENCE GENERATOR Aim:

To generate the pseudo random sequence using linear feedback shift register and verify the output using truth table. Components required:

1. DFF(IC 7474) 2. XOR (IC 7486) 3. Digital Trainer kit 4. Connecting wires

Procedure:

1. Connections are made as per the circuit diagram. 2. Logic inputs are given as per the circuit diagram. 3. Observe the output and verify the truth table.

Result:

Thus the pseudo random sequence was generated using linear feedback shift register and the output was verified using truth table.

Particulars Marks

Allotted Marks

ObtainedPreparation 20 Connection & Testing 20 Observation 20 Calculation & Graph 20 Viva – Voce 10 Record 10 Total 100 Faculty Signature