Professional Documents
Culture Documents
LABORATORY MANUAL
(R13) III B. Tech., II-Semester
ECE
Index
S. No. Name of the Experiment
GE NERAL INSTRUCTIONS:
1. The experiments have been designed to be performed within the 3-hour
laboratory time.
2. To successfully complete the experiment in one lab turn, come prepared to
the laboratory.
3. Read the experiment in advance.
4. List and collect the components for the experiment.
5. Be sure that the specifications and values of the components are as per
design.
6. Follow the experimental steps judiciously.
7. Record stepwise observations using proper test instruments.
8. Get the observation signed by the instructor.
9. Always take safety precautions while performing experiments.
Objective:
Theory in brief
Result
EQUIPMENT REQUIRED:
THEORY:
In TDM each input signal is first passed through low pass filter in order to
restrict the bandwidth. The pre alias filter is then applied to a commutator, which
is usually implemented using electronic switching circuitry. The function of
commutator is twofold: (1) To take a narrow sample of each of the N input
messages at a rate that is slightly higher than 2 , where is the cutoff
frequency of the pre alias filter, and (2) To sequentially interleave these N samples
inside a sampling interval = 1/ . Indeed, this latter function is the essence of the
time division multiplexing operation. The multiplexed signal is then appl ied to a
Pulse Amplitude Modulator, the purpose of which is to transform the multiplexed
signal into a form suitable for transmission over the communication channel.
CIRCUIT DIAGRAMS:
PROCEDURE:
Multiplexer:
WAVEFORMS:
Note1: After setting the clock frequency and input signals to desire values
put storage scope in STOP mode so that you can view stable display of
waveforms.
Note2: Sample wave forms given in Figures are drawn at 1 kHz sampling
clock, you can take at any clock frequency.
Similarly you can observe and plot the TDM waveforms for different inputs i.e. DC
signals alone, AC & DC instead of AC signals.
Note2: You can use even normal scope, when you observe the TDM wave
form for DC inputs.
De-multiplexer:
Disconnect clock from multiplexer (AET-55M) and connect to local oscillator (i.e.,
clock generator output from AET-55D) with remaining setup as it is. Observe CH 1
and CH 2 outputs and compare them with the previous results. These signals are
little bit distorted in shape. This is because lack of synchronization between clock
at multiplexer and clock at de -multiplexer. You can get further perfection in output
wave forms by adjusting the locally generated clock.
RESULT:
VIVA QUESTIONS:
1. Define Multiplexing.
2. Define bandwidth.
3. Define synchronization.
4. What is the purpose of pre alias filter?
5. What is the purpose of commutator?
6. Define Nyquist rate.
7. Define cross talk.
8. What is the purpose of reconstruction filters?
9. What are the applications of Time Division Multiplexing?
10. Define equalization in TDM.
EQUIPMENT REQUIRED:
THEORY:
PCM: In pulse code modulation (PCM) only certain discrete values are allowed for
the modulating signals. The modulating signal sampled, as in other forms of pulse
modulation. But any sample falling within a specified range of values is assigned a
discrete value. Each value is assigned a pattern of pulses and the signal
transmitted by means of this code. The electronic circuit that produces the coded
pulse train from the modulating waveform is termed a coder or encoder. A suitable
decoder must be used at the receiver in order to extract the original information
from the transmitted pulse train.
PROCEDURE:
1. Connect the trainer (Modulator) to the mains and switch on the power
supply.
2. Observe the output of the AF generator using CRO; it should be a Sine wave
of 200 Hz frequency with 3 amplitude.
3. Verify the output of the DC source with multimeter / scope, output should
vary from 0 to +5 V.
4. Observe the output of the Clock generator using CRO, they should be 64
kHz and 4 kHz frequency of square wave with 5 amplitude.
CIRCUIT DIAGRAMS:
WAVEFORMS:
Note: These clock signals are internally connected the circuit so no external
connections are required.
5. Connect the trainer (De Modulator) to the mains and switch on the power
supply.
6. Observe the output of the clock generator using CRO; it should be 64 kHz
square wave with 5 amplitude.
MODULATION:
1. Set DC source to some value say 1 V with the help of multimeter and
connect it to the A/D converter input and observe the output LEDs.
2. Note down the digital code i.e., output of the A/D converter and compare
with the theoretical value.
Theoretical value can be obtained by:
Keep CRO in dual mode. Connect one channel to 4 kHz signal ( which is connected
to the shift register) and another channel to the PCM output. Observe the PCM
output with respect to the 4 kHz signal and sketch the waveforms. Compare them
with the given waveforms
Note: From this wave form you can observe that the LSB bit enters the output first.
DEMODULATION:
1. Connect PCM signal to the demodulators (S-P Shift register) from the PCM
modulator with help of coaxial cable (supplied with the trainer).
2. Connect clock signal (64 kHz) from the transmitter to the receiver using
coaxial cable.
3. Connect transmitter clock to the timing circuit.
4. Observe and note down the S-P shift register output data and compare it
with the transmitted data (i.e., output A/D converter at transmitter.
notice that the output of the S-P shift register is following the A/D converter
output in the modulator. Observe D/A converter output (demodulated
output) using multimeter /scope and compare it with the original signal and
you can observe that there is no loss in information in process of conversion
and transmission.
5. Similarly you can try for different values of modulating signal voltage.
1. Modulating signal : 1V
2. A/D output (theoretical) : 00 11 00 11(2)
3. A/D output (practical) : 00 11 00 11(2)
4. S-P output : 00 11 00 11(2)
5. D/A Converter output : 1 V(Demodulation output)
MODULATION:
DEMODULATION:
1. Connect PCM signal to the demodulator input (S-P shift register) from the
PCM modulator with the help of coaxial cable (supplied with the trainer)
2. Connect clock signal (64 kHz) from the transmitter to the receiver using
coaxial cable
3. Connect transmitter clock to the timing circuit.
4. Keep CRO in dual mode. Connect CH 1 input to the sample and hold output
and CH 2 input of the D/A converter output.
5. Observe and sketch the D/A output.
6. Connect D/A output to the LPF input.
9. Disconnect clock from transmitter and connect to local oscillator (i.e., clock
generator output from Demodulator) with remaining setup as it is. Observe
D/A output and compare it with the previous result. This signal is little bit
distorted in shape. This is because lack of synchronization between clock at
transmitter and clock at receiver.
Note: You can take modulating signals from external sources. Maximum amplitude
should not exceed 4 V in case of DC and 3 in case of AC (AF)
signals.
RESULT:
VIVA QUESTIONS?
1. Define modulation.
2. What are three different processing steps in PCM?
3. Define signal to noise ratio.
4. Define quantization error.
5. Define overload level.
6. What is ternary code?
7. What are advantages of PCM?
8. Define White Gaussian noise.
9. Define channel and Quantization noise.
10. What are three basic functions of Regenerative repeaters?
EQUIPMENT REQUIRED:
Differential PCM is quite similar to ordinary PCM. However, each word in this
system indicates the difference in amplitude, positive or negative, between this
sample and the previous sample. Thus the relative value of each sample is
indicated rather than, the absolute value as in normal PCM.
PROCEDURE:
MODULATION:
1. Keep CRO in dual mode. Connect one channel to 8 kHz signal (one which is
connected to the Shift register) and another channel to the DPCM output.
2. Observe the DPCM output with respect to the 8 kHz signal and sketch the
waveforms.
Note: Form this waveform you can observe that the LSB bit enters the output first.
CIRCUIT DIAGRAM:
WAVEFORMS:
DEMODULATION
1. Connect DPCM signal to the demodulator (S-P register) from the DPCM
modulator with the help of coaxial cable (supplied with the trainer).
2. Connect clock signal (64 kHz) from the transmitter to the receiver using
coaxial cable.
3. Connect transmitter clock to the timing circuit.
4. Observe and note down the S-P shift register output data and compare it
with the transmitted data (i.e. output A/D converter at transmitter) notice
that the output of the S-P shift register is following the A/D converter output
in the modulator.
5. Observe D/A converter output (demodulated output) using
multimeter/scope and compare it with the original signal and can observe
that there is no loss in information in process of conversion and
transmission.
DPCM OPERATION (WITH AC INPUT):
MODULATION:
2. The output of the summer is internally connected to the sample and hold
circuit
3. Keep CRO in dual mode. Connect one channel to the AF signal and another
channel to the Sample and Hold output. Observe and sketch the sample &
hold output
4. Connect the Sample and Hold output to the A/D converter and observe the
DPCM output using oscilloscope.
5. Observe DPCM output by varying AF signal voltage.
DEMODULATION:
1. Connect DPCM signal to the demodulator input (S-P shift register) from the
DPCM modulator with the help of coaxial cable.
2. Connect clock signal (64 kHz) from the transmitter to the receiver using
coaxial cable.
4. Keep CRO in dual mode. Connect one channel to the sample & hold output
and another channel to the D/A converter output.
6. Connect D/A output to the LPF input and observe the output of the LPF.
8. Disconnect clock from transmitter and connect to the local oscillator (i.e.,
clock generator output from De-Modulator) with remaining setup as it is.
Observe D/A output and compare it with the previous result. This signal is
little bit distorted in shape. This is because lack of synchronization between
clock at transmitter and clock at receiver.
RESULT:
VIVA QUESTIONS:
1. Define modulation.
2. Define DPCM.
3. What is advantage of DPCM over PCM?
4. What is the purpose of predictor in DPCM?
5. Define quantizing.
6. Define encoding.
7. What are the applications of DPCM?
8. Define Signal to noise ratio.
9. Define prediction error
10. Define Nyquist rate.
EQUIPMENT REQUIRED:
1. DM Modulator & Demodulator trainer
2. Storage Oscilloscope
3. Digital multimeter.
4. 2 Nos co-axial cables (standard accessories with trainer)
Note: Storage oscilloscope is desired for satisfactory observation of DM wave forms
THEORY:
Delta modulation is almost similar to differential PCM. In this, only one bit is
transmitted per sample just to indicate whether the present sample is larger or
smaller than the previous one. The encoding, decoding and quantizing process
become extremely simple but this system cannot handle rapidly varying samples.
This increases quantizing noise. It has also not found wide acceptance.
PROCEDURE:
DM Modulator:
1. Study the theory of operation.
2. Connect the trainer (DM Modulator) to the mains and switch on the power
supply.
3. Observe the output of the AF generator using CRO; it should be a Sine wave
of 100 Hz frequency with 3 amplitude.
4. Verify the output of the DC source with multimeter/scope; output should
vary 0 to +4 V.
5. Observe the output of the Clock generator using CRO, they should be 4 kHz
frequency of square wave with 5 amplitude.
CIRCUIT DIAGRAM:
WAVEFORMS:
RESULT:
VIVA QUESTIONS?
1. Define modulation.
2. Define Delta modulation.
3. What are two unique features of Delta modulation?
4. What are the applications of Delta modulation?
5. What is the purpose of accumulator in DM?
6. What are differences between DM and DPCM?
7. What is the purpose of low pass filter?
8. Define bandwidth.
9. Define quantization noise.
10. Define slope overload distortion.
EQUIPMENT REQUIRED:
THEORY:
PROCEDURE:
1. Connect output of the logic source to data input of the FSK Modulator.
2. Set logic source switch in 0 positions.
3. Connect FSK modulator output to Oscilloscope as well as frequency counter.
4. Set the output frequency of the FSK modulator as per your desire (say 1.2
kHz) with the help of control F0 which represents logic 0.
5. Set logic source switch in 1 position.
CIRCUIT DIAGRAMS:
6. Set the output frequency of the FSK modulator as per your desire (say 2.4
kHz) with the help of control F1 which represents logic 1.
Note: We have chosen F0 as 1.2 kHz and F1 as 2.4 kHz for ease of operation;
in fact you may set any value.
7. Now connect data input of the FSK modulator to the output of the data
signal generator.
8. Keep CRO in dual mode connect CH1 input of the oscilloscope to the input
of the FSK modulator and CH2 input to the output of the FSK modulator.
9. Observe the FSK signal for different data signal frequencies and plot them.
By this we can observe that the carrier frequency is shifting between two
predetermined frequencies as per the data signal i.e. 1.2 kHz when data
signal is 0 and 2.4 kHz when data input is 1 in this case.
10. Compare these plotted wave forms with the theoretically drawn in figure.
FSK Demodulation:
1. Again connect input of the FSK modulator to the logic source and put data
source switch in 0 positions.
2. Connect the frequency counter to the output of the FSK modulator output.
3. Set FSK output frequency to 2025 Hz with the help of FO control.
4. Now put data source switch in 1 position and set the FSK output frequency
to 2225 Hz with the help of F1 control without disturbing the F0.
Note: As per one of the standards, for proper demodulation of FSK signal the F0
should be 2025 Hz and F1 should be 2225 Hz.
1. Disconnect the FSK input of the modulator from logic source and connect
to the data signal generator.
2. Observe the output of the modulator using CRO and compare them with
given waveforms in figure.
3. Now connect the FSK modulator output to the FSK input of the
demodulator.
4. Connect CH1 input of the Oscilloscope to the data signal at modulator and
CH2 input to the output of the FSK demodulator (keep CRO in dual mode).
5. Observe and plot the output of the FSK demodulator for different
frequencies of data signal. Compare the original data signal and
demodulated signal; by this we can observe that there is no loss in process
of FSK modulation and de-modulation.
WAVEFORMS:
RESULT:
VIVA QUESTIONS:
1. What is meant by digital modulation technique?
2. Define FSK.
3. What is other name for binary FSK?
4. What are coherent FSK and non coherent FSK?
5. Define M ary modulation.
6. What is VCO and what is the purpose of VCO in FSK?
7. Which component refers LM 565?
8. What are applications of FSK?
9. What are the advantages of FSK over ASK?
10. What is the difference between FSK and MSK?
EQUIPMENT REQUIRED:
1. Phase Shift keying trainer
2. Dual trace Oscilloscope
3. Digital multimeter
4. Patch chords
THEORY:
Phase Shifting Keying (PSK) is a modulating / Data transmitting technique
in which phase of the carrier signal is shifted between two distinct levels. In a
simple PSK (i.e., Binary PSK) un-shifted carrier is transmitted to indicate a
1 condition, and the carrier shifted by i.e., is transmitted to indicate
a 0 condition. Wave forms are shown in Figure PSK Modulating & Demodulating
circuitry can be developed in number of ways; one of the simple circuits is used in
this trainer.
PROCEDURE:
1. Study the theory of operation.
2. Connect the trainer to mains and switch on the power supply.
3. Measure the output of the regulated power supply i.e. +5 V and -5 V with the
help of digital multimeter.
4. Observe the output of the carrier generator using CRO, it should be an 8 kHz
Sine with amplitude.
5. Observe the various data signals (1 kHz, 2 kHz and 4 kHz) using CRO.
MODULATION
1. Connect carrier signal to carrier input of the PSK Modulator.
2. Connect data signal say 4 kHz from data source to data input of the
modulator.
3. Keep CRO in dual mode.
4. Connect CH1 input of the CRO to data signal and CH2 to the output of the
PSK modulator
5. Observe the PSK output Signal with respect to data signal and plot the wave
forms. Compare the plotted waveforms with given wave forms.
CIRCUIT DIAGRAMS:
DEMODULATION:
1. Connect the PSK output to the PSK input of the demodulator.
2. Connect carrier to the carrier input of the PSK demodulator
Note: In actual communication system reference carrier is generated at receiver.
3. Keep CRO in dual mode.
4. Connect CH1 to the data signal (at Modulator) and CH2 to the output of the
demodulator.
5. Compare the demodulated signal with original data signal; by this we can
notice that there is no loss in modulation and demodulation process.
6. Repeat the steps 7 to 15 with different data signals i.e., 2 kHz and 1 kHz.
WAVEFORMS:
7.
RESULT:
VIVA QUESTIONS:
1. Define PSK.
2. What is the name for the combination for ASK and PSK?
3. What is meant by coherent and non coherent binary PSK?
4. Define QPSK.
5. Write the truth table for XOR gate?
6. Which components refer CD4052 and TL 084?
7. What are the applications of PSK?
8. Define Mary PSK.
9. Define Bandwidth efficiency.
10. Define Intersymbol Interference.
EQUIPMENT REQUIRED:
1. Differential Phase Shift Keying Kits
2. C.R.O
3. Digital multimeter.
4. Nos of coaxial cables (standard accessories with trainer)
THEORY:
DPSK: Phase Shift Keying requires a local oscillator at the receiver which is
accurately synchronized in phase with the un-modulated transmitted carrier, and
in practice this can be difficult to achieve. Differential Phase Shift Keying
(DPSK) over comes the difficult by combining two basic operations at the
transmitter (1) differential encoding of the input binary wave and (2) phase shift
keying hence the name differential phase shift keying. In other words DPSK is a
non - coherent version of the PSK.
DPSK DEMODULATOR: Fig shows the DPSK modulator. This consists of PSK
modulator and differential encoder. PSK Modulator: IC CD 4052 is a 4 channel
analog multiplexer and is used as an active component in this circuit. One of the
control signals of 4052 is grounded so that 4052 will act as a two channel
multiplexer and other control is being connected to the binary signal i.e., encoded
data. Un shifted carrier signal is connected directly to CH1 and carrier shifted by
1800 is connected to CH2. Phase shift network is a unity gain inverting amplifier
using Op-Amp (TL084).
When control signal is at high voltage, output of the 4052 is connected to
CH1 and un-shifted (or 0 phase) carrier is passed on to output. Similarly when
control signal is at zero voltage output of 4052 is connected to CH2 and carrier
shifted by 1800 is passed on to output.
Differential encoder: This consists of 1 bit delay circuit and an X-NOR Gate. 1 bit
delay circuit is formed by a D-Latch. Data signal i.e., signal to be transmitted is
connected to one of the input of the X-NOR gate and other one being connected to
out of the delay circuit. Output of the X-NOR gate and is connected to control
input of the multiplexer (IC 4052) and as well as to input of the D-Latch. Output of
the X-NOR gate is 1 when both the inputs are same and it is 0 when both the
inputs are different.
CIRCUIT DIAGRAMS:
DPSK DEMODULATOR: Second fig shows the DPSK Demodulator. This consists
of 1 bit delay circuit, X-NOR Gate and a signal shaping circuit. Signal shaping
circuit consists of an Op-amp based zero crossing detector followed by a D-latch.
Receiver DPSK signal is converted to square wave with the help of zero crossing
and this square wave will pass through the D-Latch. So output of the D-latch is an
encoded data. This encoded data is applied to 1 bit delay circuit as well as to one
of the inputs of X-NOR gate. And output of the delay circuit is connected to
another input of the X-NOR gate. Output of the X-NOR gate is 1 when both the
inputs are same and it is 0 when both the inputs are different.
PROCEDURE:
MODULATION:
1. Connect carrier signal to carrier input of the PSK Modulator.
2. Connect data signal from data input of the X-NOR gate.
3. Keep CRO in dual mode.
4. Connect CH1 input of the CRO to data signal and CH2 input to the encoded
data (which is nothing but the output of the X-NOR gate)
5. Observe the encoded data with respect to data input. The encoded data will
be in a given sequence.
6. Now connect CH2 input of the CRO to the DPSK output and CH1 input to
the encoded data. Observe the input and output waveforms and plot the
same.
7. Compare the plotted waveforms with the given waveforms in fig.
Note: Observe and plot the waveforms after perfect triggering. Better to keep
the encoded data more than 4 cycles for perfect triggering.
DEMODULATION:
1. Connect DPSK signal to the input of the signal shaping circuit from DPSK
transmitter with the help of coaxial cable (supplied with trainer).
2. Connect clock from the transmitter (i.e. DPSK Modulator) to clock input of
the 1 bit delay circuit using coaxial cable.
3. Keep CRO in dual mode. Connect CH1 input to the encoded data (at
modulator) and CH2 input to the encoded data (at demodulator).
WAVEFORMS:
4. Observe and plot both the waveforms and compare it with the given
waveforms. You will notice that both the signals are same with one bit
delay.
5. Keep CRO in dual mode. Connect CH1 input to the data signal (at
modulator) and CH2 input to the output of the demodulator.
6. Observe and plot both the waveforms and compare it with the given
waveforms. You will notice that both the signals are same with one bit delay.
7. Disconnect clock from transmitter and connect to local oscillator clock (i.e.,
clock generator output from De Modulator) with remaining setup as it is.
Observe demodulator output and compare it with the previous output. This
signal is little bit distorted. This is because lack of synchronization between
clock at modulator and clock at demodulator. You can get further perfection
in output waveform by adjusting the locally generated clock frequency by
varying potentiometer.
RESULT:
VIVA QUESTIONS:
1. Define DPSK.
2. What is the difference between PSK and DPSK?
3. What are the operations of DPSK?
4. What are the applications of DPSK?
5. Write the truth table for XNOR gate?
6. What is meant by encoded data?
7. What is the error probability for DPSK?
8. COMPANDING
Introduction
Companding is a compressing and expanding technique used in digital
communication systems. With this technique we can improve noise performance at low level
signals and improve the dynamic range of the signal that can be handled by the channel.
The student observes the improvement in dynamic range and the noise performance with
companding and records the same.
Specification
The kit is implemented with 16 bit micro controller giving lot of flexibility in experimenting
Full signal chain implementation i.e 16 bit A/D , Compress coder, Decoder, 16 bit D/A.
Facility to observe the signal chain without companding and with companding and noting
the difference
Theory
While coding the signal we give higher resolution at low levels and and lower resolution at
higher levels. This makes the signal compresed in the code domain.
By applying the reverse mapping at the decoding end we get back the original signal.
By allocating more bits at lower signal levels we can reduce the quantization noise ( the
noise created by the LSB),
The -law and A-law algorithms encode 14-bit and 13-bit signed linear PCM samples
(respectively) to logarithmic 8-bit samples. Thus, the G.711 encoder will create a 64 kbit/s
bitstream for a signal sampled at 8 kHz.[1]
G.711 -law tends to give more resolution to higher range signals while G.711 A-law
provides more quantization levels at lower signal levels.
The companding curve for A law and u law, note that for low level input ( x axis) variation
in the chalnnel code high ( f(x), where as at higher levels variation in is smaller.
Please note that in the above tables the letters abcd in the input table and output table , that
means whatever bit is there in place of a the same bit appears in the o/p in place of a , the
same for bcd.
DAC Code
0000_0000_0000 0 0.000
0000_0001_0000 16 0.012
0000_0001_1111 31 0.023
0000_0010_1110 46 0.034
0000_0011_1110 62 0.045
0000_0110_0000 96 0.070
The 13 th bit is the sign bit, when 0 the value is positive, when 1 the value is negative.
The reason for choosing unequal steps and more values at the lower level is to observe the
variation properly at low levels, where as at higher levels there will not be much difference
when values chosen are closer.
Signal Generator:
The kit generates -3 to +3 DC Voltage at the input by using the UP/DOWN keys in DC
mode.
The kit also generates a fixed ac waveform when the switch is in AC Mode.
A/D Convertor:
This is a 16 bit A/D convertor, for commanding we need the following sizes of A/D , for
linear 8 bit, for A law 13 bit, for u law 14 bit. the most significant bit is used for signal sign ,
bit is 1 means negative from the 16 bit convertor we get the sign bit and 15 bit magnitude.
for linear case we take the most significant 7 bits from the magnitude and the sign bit to sign
bit.
for A law we take sign bit sign bit, most significant 12 bit as magnitude of the input.
for u law we are showing only the magnitude bits on LEDS. the sign bit is not shown.
The compressor:
these 7 bits along with the sign bit go out on the channel of communication.
The Expander:
The expander converts the 7 coded magnitude back to the original 12 bit magnitude ( A
law).
D/A:
The D/A is 16 bit implementation, the expander output sign bit gets loaded as sign bit , the
magnitude 12 bits get loaded to the most significant 12 bits of the D/A.
Procedure:
Use the Fluke87V (4 digit) multi meter for observing the dc levels or any other suitable
dc volt meter with 0.05% accuracy, which can distinguish 1mv, since the we need to observe
the errors in dc level in the range of 0.001 volts/ i.e., 1 mv . if you are using 31/2 digit DMM
it should have 0-200 mv range to measure 000.0 to 199.9 mv
6. Observe the quality improvement of a companded channel for a low level asc
signal given by the kit itself in AC mode.
Experiment Procedure
DECOMPRESSOR+PCM
COMPRESSOR/PCM CODER TRCHL DECODER
* * *
16
I/P 16 BIT * CODER * DECODER * BIT O/P
* * *
* LEDS-8 *
LEDS- LEDS-
13 13
UP
SIGNAL
FROM
MODE
MICRO
DC/SINE AC/DC NRM/COMPAND
DN
Coder Chl Code Decoder Error Err/Sign Chl Decoder Error Err/Sign
I/P O/P al Code O/P al
7 bit Digital Digital
12 bit 12 bit 7 bit 12 bit
as the channel is fixed bandwidth ( i.e., it accomadates 8 bits for sample one bit for sign and
7 bits for magnitude)
if we do not use companding , then the lower 5 magnitude bits are truncated and only the
most significant 7 bits are taken from the input to be carried in the channel.
With companding, at lower levels the even the lower bits are carried in the channel code as
per the coding tables given for A law and u law.
Note-1: for u law note down 13 bits at A/D o/p and D/A i/p ( for A law it is 12 bit)
Example Values
Coder Chl Code Decoder Error Err/Sign Chl Decoder Error Err/Sign
I/P O/P al Code O/P al
7 bit Digital Digital
12 bit 12 bit 7 bit 12 bit
Lower 5
bits get Lower 5
bits are 0s
coutout
=0.304
From filling the above observation table please note that Err/Signal ratio has improved a
lot for lower signal levels and for higher levels as Err/S is already low , there is not
significant difference.
Decoding is the reverse process to get back the full source information.
In every day we employ this in transferring big files, particularly image/voice files by
zipping them and transferring to the destination and unzipping at the destination.
Theory
When we have to transmit a set of symbols over a communication channels, normally
choose no of bits to accommodate all the symbols for example 8 symbols can be coded using
3 bits, because 3 bits give us 2^3=8 combinations. With this type of normal binary
representation we can transfer any combination of symbols in any order. However if our
information to be transmitted has a set of symbols but the occurrence of symbols with
different frequencies we can employ a coding technique whereby we choose less no of bits
for the frequently occurring symbol and more bits for the less occurring symbol this way we
can represent our information which is a sequence of symbols with less no.of bits i.e.
reduced size.
Huffman coding is based on the frequency of occurrence of a data item (pixel in images).
The principle is to use a lower number of bits to encode the data that occurs more
frequently. Codes are stored in a Code Book which may be constructed for each image or a
set of images. In all cases the code book plus encoded data must be transmitted to enable
decoding.
A bottom-up approach
1. Initialization: Put all nodes in an OPEN list, keep it sorted at all times (e.g., ABCDE).
2. Repeat until the OPEN list has only one node left:
(a) From OPEN pick two nodes having the lowest frequencies/probabilities,
create a parent node of them.
(b) Assign the sum of the children's frequencies/probabilities to the parent node
and insert it into OPEN.
(c) Assign code 0, 1 to the two branches of the tree, and delete the children from
OPEN.
A 15 1.38 0 15
B 7 2.48 100 21
C 6 2.70 101 18
D 6 2.70 110 18
E 5 2.96 111 15
TOTAL (# of bits): 87
The following points are worth noting about the above algorithm:
Decoding for the above two algorithms is trivial as long as the coding table (the
statistics) is sent before the data. (There is a bit overhead for sending this, negligible
if the data file is big.)
Unique Prefix Property: no code is a prefix to any other code (all symbols are at the
leaf nodes) -> great for decoder, unambiguous.
If prior statistics are available and accurate, then Huffman coding is very good.
In the above example:
-----------------------------------------------------------
Let us take an example that we wish to transmit a word ABRAKADABRA , which has 5
types of symbols A,B,R,C,D
However by employing Hoffman source coding as below we can transmit the information
using only 23 bits.
Coding Process
PBK1 LED-1
NORM/CODE DEMO
RESET
Observations
ABRAKADABRA
DABRAKAABRA
The decoding process is just the reverse process ( table look up process) i.e if we receive a
pattern 1010 its is decoded as letter C , however one important point is to be noticed that if
the input symbols are concatenated i.e put in continuous sequence we should be able to
distinguish the no of bits corresponding to each symbol, this is possible only if the code is
chosen such that the confusion does not arise,
Let us pick the first bit which 0 is there a symbol for only one bit as 0 ? yes there is a symbol
A for this code so let us separate this as one symbol so it becomes 0,100 then further there is
no symbol with single bit 1 , there is no symbol with 2 bits 10 going further we take 100 yes
there is a symbol B assigned for 100 so we separate this as 0,100, we continue like this and
decode the whole pattern. if there are errors in the received sequence the we can not decode
all the subsequent symbols following the error.
Experiment Procedure
Student has to observer the signal chain.
Then verify how many bits are taken to transmit ABRAKADABRA in normal
and source coded mode
To send an input symbol , push any one of the input symbol keys, to transmit
a letter A , student has to press the key marked A
Observer how many bits are being transmitted for this key. And the bit code
for the same. , and noted down the bits being transmitted on the LEDS (
1=Red,0=Green)
Observe if the corresponding output LED is glows corresponding to the
symbol pressed at the input
Pushing Demo mode switch will give a brief description of implementation of
KIT
Note the difference in the length of bits required without coding and with coding.
This topic comes under channel coding techniques which are employed for the purpose of
detecting and correcting errors occurring in the communication channel. When information
is represented in blocks of k bits we can add few extra bits increasing the block size to n bits
and employ block coding techniques to detect and correct errors in the reception.
Specification
The kit is implemented with 16 bit micro controller giving lot of flexibility in experimenting
Facility to observe the status of decoding i.e. error detected and error corrected status on
LEDS
Easy verification of where error is injected and what is the corresponding output.
Theory
We can add a few extra bits to the information bits i.e. provide some redundancy and detect
/ correct the errors from the received data.
More redundancy we provide more correction we can have. By using hamming coding
technique with given no. of extra bits we can extract maximum advantage of detection and
correction.
Hamming code (n,k) places symbols represented by n bits having k information bits
at a maximum distance from each other allowing us to detect more errors and correct more
errors.
The decoder if it finds the errors which cannot be corrected, it shows the O/P but
indicates that the same with error LED at the output. Normally if in applications using
command and control the decoded O/P having errors is not used it is discarded.
mbols used
if Y is the received data then the Syndrome S should be all zeros/null vector if there are no
errors , if there are errors in the received data S will not be null , then we check which
column in HT has same values as S then that co
S=YHT
/* code matrix 2nd, 3rd, and 4th MSB define parity bits */
0111000
1010100
1100010
1110001
where P[4*3]=
011
101
110
111
where I[4*4]=
1000
0100
0010
0001
Parity Check Sub Matrix P=( bits indicate which bits a parity bit represents)
0111
1011
1101
1000111
0101011
0011101
1110001
example
X=[1010]
Y=XG= [1010][g]=1011010
now if Y gets some errors in it at position say 0 then errored channel data
Y=1011011
H=PT :I
PT =
100
010
001
011
101
110
111
HT =
011
101
110
111
100
010
001
The Syndrome depends on particular error pattern only , it does not depend on the input
data.
[1011011]*[
011
101
110
111
100
010
001 ]
=001
S=E*HT=
[0000001] * [
011
101
110
111
100
010
001 ]
=001
so the last row matching syndrome indicates that the last bit in Y is in error.
like wise if S matches the nth row of HT from one ed,we have to correct nth bit of Y from
the same end.
for more than one error this correction logic does not work , only we can say if syndrome
exist then there are errors in the data.
------------------------------------------------------------------------------
0x00, /* syndrome = 0 0 0 */
0x10, /* syndrome = 0 0 1 */
0x20, /* syndrome = 0 1 0 */
0x08, /* syndrome = 0 1 1 */
0x40, /* syndrome = 1 0 0 */
0x04, /* syndrome = 1 0 1 */
0x02, /* syndrome = 1 1 0 */
0x01 /* syndrome = 1 1 1 */
};
0111000
1010100
1100010
1110001
where P[4*3]=
011
101
110
111
where I[4*4]=
1000
0100
0010
0001
Experiment Procedure
CHANNEL CODER
CHANNEL
CODE
LED PAIR-15*
I/P O/ P
MESSAGE LED PAIR-14* MESSAGE
DECODE
LEDPAIR-7* CODER LED PAIR-13* R LEDPAIR-7*
( Hamming
LEDPAIR-6* 7,4) LED PAIR-12* LEDPAIR-6*
LEDPAIR-5
LED-
1 0 CODE A BIT* LEDPAIR-4 ERRDET
LED-DONE LEDPAIR-2
LEDPAIR-1 DECODE
LEDPAIR-0
BITSE ERRSE
L T
NORM
/COD
RESETKIT E DEMO
Procedure:
Observe the signal chain , i.e. the input stage, coding stage, transmission stage and
the decode stage
Put the mode selection switch in NORMAL mode and see the process and observe
output
Student selects input message that is to be coded, by shifting the bits 0/1 by means
of pressing the keys 0, 1, CLEAR.
Student codes this input message by pushing the key CODE A BIT or by pushing
CODEALL.
Now the message is coded and displayed in the transmission path. Student can now
introduce an error in the transmission channel by means of pressing the keys
BITSEL and ERRSET. On every push of the BITSEL one bit is selected in the channel
code, the selected bit will be completely in OFF mode at this stage, if the student
presses ERRSET key, the OFF mode bit will be inverted to make it as an error.
Now the student pushes the DECODE key, the channel code is decoded and
displayed as the Output message. If an error is detected in the channel code
ERRDETECTED LED glows, if an error is corrected from channel code then the
ERRCORRECTED LED glows in the decoder Output stage.
Now put mode selection in CODE mode and repeat the process and observe the
output changes.
Observe how the error detection and correction in code mode and hence the
implementation of Linear Block encoder and decoder.
Pushing Demo mode switch will give a brief description of implementation of KIT
In this experiment hamming code (7.4) is employed. the input data is limited to 4 bits, once
it is coded the input data is placed in channel data positions 1..4(d0-d3), parity bits are place
in positions 5,6,7 (d4-d6) this is a systematic code. To set errors in a different position for the
same input data, press code-all key once, then it will be recoded and shown on channel
data and o/p gets cleared waiting for decode key once again.
Observations Table
I/P Data ChlCode ChlCode O/p data Err Err
From the above observations, we can conclude and record the following points.
Errors in the transmission channel can be detected and corrected with linear block coding in
7,4 hamming code we can detect and correct single bit error in any position, we can detect 2
errors but with 2 errors we can not correct.
Specification
The kit is implemented with 16 bit micro controller giving lot of flexibility in experimenting
Facility to observe the status of decoding i.e. error detected and error corrected status on
LEDS
Easy verification of where error is injected and what is the corresponding output.
Theory
A linear code is called cyclic code if every cycle shift of code vector produces some other
code vector i.e. the cycle shift to the data in an array should also represent the data in the
same array.
Example: arr{(0000),(0101),(1010),(1111)}
k is data length
Experiment Procedure
Let us consider an example for implementation of the experiment
Q) Design the encoder for the Systematic (7,4) cyclic code generated by a polynomial G(p)
= p3 + p + 1 and decode the data transferred by syndrome decoding procedure for
knowing input.
The implementation of cyclic encoding and decoding kit is based on the same example as
per Reference 1. The encoded data output will be M 3 M2 M1 M0C2C1C0 which is can be
obtained from Systematic coding procedure and the decoding the data will be done by
syndrome decoding procedure to re generate input and correct the data received from any
noisy channel.
Procedure:
Observe the signal chain , i.e. the input stage, coding stage, transmission stage and
the decode stage
Put the mode selection switch in NORMAL mode and see the process and observe
output
Student selects input message that is to be coded, by shifting the bits 0/1 by means
of pressing the keys 0, 1, CLEAR.
Student codes this input message by pushing the key CODE A BIT or by pushing
CODEALL.
Now the message is coded and displayed in the transmission path. Student can now
introduce an error in the transmission channel by means of pressing the keys
BITSEL and ERRSET. On every push of the BITSEL one
CHANNEL
CODE
LED PAIR-15*
I/P
MESSAGE LED PAIR-14* O/ P MESSAGE
LEDPAIR-5
LED-
1 0 CODE A BIT* LEDPAIR-4 ERRDET
LED-DONE LEDPAIR-2
LEDPAIR-1 DECODE
LEDPAIR-0
BITSEL ERRSET
NORM
bit is selected in the channel code, the selected bit will be completely in OFF mode at this
stage, if the student presses ERRSET key, the OFF mode bit will be inverted to make it as an
error.
Now the student pushes the DECODE key, the channel code is decoded and
displayed as the Output message. If an error is detected in the channel code
ERRDETECTED LED glows, if an error is corrected from channel code then the
ERRCORRECTED LED glows in the decoder Output stage.
Now put mode selection in CODE mode and repeat the process and observe the
output changes.
Observe how the error detection and correction in code mode and hence the
implementation of Binary Cyclic encoder and decoder.
Pushing Demo mode switch will give a brief description of implementation of KIT
Observations Table
**xyz (as per our discussion C 2C1C0 ) in the channel data above indicates the
hamming encoded bits of corresponding data.
This topic comes under channel coding techniques which are employed for the purpose of
detecting and correcting errors, occurring in the communication channel.
Unlike a block coder, a convolution coder is a memory based device. Even though a
convolution coder accepts a fixed number of message symbols and produces a
fixed number of code symbols, its computations depend not only on the current set of input
symbols but on some of the previous input symbols.
Where,
n= no of output bits
m= no of message bits
Terms:
Specification
The kit is implemented with 16 bit micro controller giving lot of flexibility in experimenting
Facility to observe the status of decoding i.e. error detected and error corrected status on
LEDS
Easy verification of where error is injected and what is the corresponding output.
Theory
(a) Rate : Ratio of the number of input bits to the number of output bits. In this
example, rate is 1/2 which means there are two output bits for each input bit.
(b) Constraint length : The number of delay elements in the convolutional coding. In
this example, with there are two delay elements.
(c) Generator polynomial : Wiring of the input sequence with the delay elements to
the FSM
Viterbi Decoding
Please note the order of the memory bits and the state bits,
any conventions is OK, our state diagram and the trellis diagram should follow the same
convention.
The branch metric is used for hard decision decoding. In this example, the receiver
gets the parity bits 00.
The trellis is a convenient way of viewing the decoding task and understanding the
time evolution of the state machine.
Decoding Process using Trellis diagram and minimum hamming distance method:
The figures shown are for the implemented coder in this kit.
The Viterbi decoder in action. The decoded message is shown. To produce this
message, start from the final state with smallest path metric and work backwards, and then
reverse the bits. At each state during the forward pass, it is important to remember the arc
that got us to this state, so that the backward pass can be done properly.
The Viterbi decoder in action. This picture shows 4 time steps. The bottom-most
picture is the same as the one just before it, but with only the survivor paths shown. We can
observe from the above figures that, that state machine can come to a current state from one
of the 2 previous states only. There will be a branch metric if it has come from previous state
x, another branch metric if it has come from previous state y. these two branch metrics
translate to two accumulated path metrics if we add the accumulate the metric of all the
allowed previous paths. Then we retain only one previous state which has lower path
metric.
Experiment Procedure
CHANNEL
CODE
LED PAIR-15
I/P MESSAGE LED PAIR-14 O/ P MESSAGE
DECODE
LEDPAIR-7 CODER LED PAIR-13 R LEDPAIR-7
LEDPAIR-6 LED PAIR-12 LEDPAIR-6
LEDPAIR-5 LED PAIR-11 LEDPAIR-5
LEDPAIR-4 LED PAIR-10 LEDPAIR-4
LEDPAIR-3 LED PAIR-9 LEDPAIR-3
LEDPAIR-2 LED PAIR-8 LEDPAIR-2
LEDPAIR-1 LEDPAIR-7 LEDPAIR-1
LEDPAIR-0 LEDPAIR-6 LEDPAIR-0
LEDPAIR-5
1 0 LED-DONE LEDPAIR-4 LED-ERRDET
CLEAR CODE ALL LEDPAIR-3 LED-ERCOR
LEDPAIR-2
LEDPAIR-1 DECODE
LEDPAIR-0
BITSE
L ERRSET
RESETKI
T
*Code A Bit and Code All are having same functionality
Observations Table
NORMAL SYSTEM WITHOUT CODING
I/P data Set Normal Transmission Errors in Transmission
Chal O/P Chal O/P
data Data data Data
Note-1: Channel input increases such that the memory states should become Zeros
Experiment Procedure:
Observe the signal chain , i.e. the input stage, coding stage, transmission stage and the
decode stage
Put the mode selection switch in NORMAL mode and see the process and observe output
Student selects input message that is to be coded, by shifting the bits 0/1 by means of
pressing the keys 0, 1, CLEAR.
Student codes this input message by pushing the key CODE A BIT or by pushing
CODEALL. Note that after pressing this the input data gets shifted up and two 00 bits are
added at lower end. This is required in the convolution decoding process, the last tw o bits
should always be zero , the state should come back to 0 , to decode hence this automatic 0
addition.
Now the message is coded and displayed in the transmission path. Student can now
introduce an error in the transmission channel by means of pressing the keys BITSEL and
ERRSET. On every push of the BITSEL one bit is selected in the channel code, the selected bit
will be completely in OFF mode at this stage, if the student presses ERRSET key, the OFF
mode bit will be inverted to make it as an error.
Now the student pushes the DECODE key, the channel code is decoded and displayed as
the Output message. If an error is detected in the channel code ERRDETECTED LED glows,
if an error is corrected from channel code then the ERRCORRECTED LED glows in the
decoder Output stage.
Now put mode selection in CODE mode and repeat the process and observe the output
changes.
Observe how the error detection and correction in code mode and hence the implementation
of convolution encoder and decoder.
Pushing Demo mode switch will give a brief description of implementation of KIT
Coding Theory Back Ground Information
Terminology
Systematic / non-systematic codes
In coding theory, a systematic code is any error-correcting code in which the input data is
embedded in the encoded output. Conversely, in a non-systematic code the output does not
contain the input symbols.
Linear Code
In coding theory, a linear code is an error-correcting code for which any linear
combination of codewords is also a codeword. Linear codes are traditionally partitioned
into block codes and convolutional codes, although turbo codes can be seen as a hybrid of
these two types.[1]Linear codes allow for more efficient encoding and decoding algorithms
than other codes (cf. syndrome decoding).
Block code
In coding theory, block codes refers to the large and important family of error-correcting
codes that encode data in blocks. There is a vast number of examples for block codes, many
of which have a wide range of practical applications. The main reason why the concept of
block codes is so useful is that it allows coding theorists, mathematicians, and computer
scientists to study the limitations of all block codes in a unified way. Such limitations often
take the form of bounds that relate different parameters of the block code to each other, such
as its rate and its ability to detect and correct errors.
Examples of block codes are ReedSolomon codes, Hamming codes, Hadamard
codes, Expander codes, Golay codes, and ReedMuller codes. These examples also belong to
the class of linear codes, and hence they are called linear block codes.
Convolution code
In telecommunication, a convolutional code is a type of error-correcting code in which
each m-bit information symbol (each m-bit string) to be encoded is transformed into an n-bit
symbol, where m/n is the code rate (n m) and the transformation is a function of the
last k information symbols, where k is the constraint length of the code.
Convolution codes are used extensively in numerous applications in order to achieve
reliable data transfer, including digital video, radio, mobile communication, and satellite
communication. These codes are often implemented in concatenation with a hard-decision
code, particularly Reed Solomon. Prior to turbo codes, such constructions were the most
efficient, coming closest to the Shannon limit.
Turbo code
Syndrome decoding
Viterbi decoding
1 COMPANDING
Aim: To implement of -law compression and expansion of a signal.
Equipment Required:
TMS 320XXXX DSP Trainer Kit
PC with MATLAB, CCS
Power supply.
Theory:
At the telephone transmitter, microphone converts human speech to analog
signals. For digital transmission, this analog signal is converted to a digital signal,
which has a fixed precision. To provide higher voice quality at a lower cost, the
analog signals may be converted to digital signals using Pulse Code Modulation
(PCM).
Note that at low amplitudes the slope is larger than at large amplitudes. A signal
transmitted through such a network will have compressed output. To undo the
signal distortion at the receiver side we pass the signal through an expander. The
expander network has input-output characteristics, which is the inverse of the
characteristics of compressor. Thus the process of compressing and expending
combindly called companding
The variation of signal to noise ratio with respect to signal level without companding
and with companding is shown in below.
A-Law Compander
0 <1
1+ln
F(x) =
(1+ln ) 1
1+ln () 1
(1 + ln )
|| < 1 1 + ln
1 = ()
exp
( 1 + ln 1) 1
1 + ln < 1
-Law Compander
-law is the CCITT recommended Companding standard used across United States
and Japan. The -law compression as
ln 1 + )
= 0 1
ln
(1 + )
where is the compression parameter (=255 for the U.S. and Japan), and x is the
normalized integer to be compressed.
1 = 1 ((1 + ) -1) -1 y 1
Applications:
Procedure:
o Open Code Composer Studio, make sure the DSP kit is turned on.
o Load program following location.
Here we generated a sample 1KHz sine wave from sin function available in C.
When you run the program, it will ask to enter amplitude level. Enter
amplitude level say 5V.
So generated sine wave will have amplitude from -5V to 5V
To view Original signal
Select tool _ graph _ single time
Graph setting & graph
Compressed signal:
Expanded signal:
Program:
#include<stdio.h>
#include<math.h>
#define Mu 255
float original[100], x[100],y[100], com[100], ex[100];
void main()
{
int i;
float amp;
int sgn[100], sgn_y[100];
FILE *fp;
fp=fopen("D:\\Mu-law_companding.txt","wr");
fprintf(fp,"\nINPUT SINE\tCOMPANDING\tOUTPUT SINE\n");
{
sgn_y[i] = -1;
y[i]=com[i]*(-1);
}
else
if(com[i] == 0.0)
sgn_y[i] = 0;
}
}
for(i=0; i<100; i++)
{
ex[i] = (sgn_y[i]*(pow((1+Mu),y[i])-1)/Mu);
}
for(i=0; i<100; i++)
{
fprintf(fp,"%f\t%f\t%f\n", original[i],com[i],ex[i]);
}
}
Observations:
Viva Questions:
% ASK Demodulation
t1=0;
t2=Tb;
for i=1:N
t=[t1:Tb/100:t2]
%CORRELATOR
x=sum(c.*ask_sig(i,:));
%DECISION DEVICE
if x>0
demod(i)=1;
else
demod(i)=0;
end
t1=t1+(Tb+.01);
t2=t2+(Tb+.01);
end
Model Graphs:
Result:
In MSK the difference between the higher and lower frequency is identical to
half the bit rate. Consequently, the waveforms used to represent a 0 and 1 bit differ
by exactly half a carrier period. Thus, the maximum frequency deviation is =
0.25 fm where fm is the maximum modulating frequency. As a result, the modulation
index m is 0.5. This is the smallest FSK modulation index that can be chosen such
that the waveforms for 0 and 1 are orthogonal. A variant of MSK called GMSK is
used in the GSM mobile phone standard.
In addition to this MSK has advantages over other forms of PSK and as a result it is
used in a number of radio communications systems.
When looking at a plot of a signal using MSK modulation, it can be seen that
the modulating data signal changes the frequency of the signal and there are no
phase discontinuities. This arises as a result of the unique factor of MSK that the
frequency difference between the logical one and logical zero states is always equal
to half the data rate. This can be expressed in terms of the modulation index, and it is
always equal to 0.5.
Algorithm:
Initialization commands
MSK modulation:
1. Generate carrier signal.
2. Start FOR loop
3. Generate binary data, message signal (on-off form)
4. Generate MSK modulated signal.
5. Plot message signal and MSK modulated signal.
MSK Demodulation:
1. Start FOR loop
2. Perform correlation of MSK signal with carrier to get decision variable
3. Make decision to get demodulated binary data. If x>0, choose 1 else
choose 0
4. Plot the demodulated binary data.
for i = 1:n
if (b(i) == 0)
u(i) = -1;
else
u(i) = 1;
end
for j = i:0.1:i+1
bw(x(i*100:(i+1)*100)) = u(i);
if (mod(i,2) == 0)
bw_o(x(i*100:(i+1)*100)) = u(i);
bw_o(x((i+1)*100:(i+2)*100)) = u(i);
else
bw_e(x(i*100:(i+1)*100)) = u(i);
bw_e(x((i+1)*100:(i+2)*100)) = u(i);
end
if (mod(n,2)~= 0)
bw_o(x(n*100:(n+1)*100)) = -1;
bw_o(x((n+1)*100:(n+2)*100)) = -1;
end
end
end
bw = bw(100:end);
bw_e = bw_e(100:(n+1)*100);
bw_o = bw_o(200:(n+2)*100);
wo = 2*pi*t*(5/4);
Wt = 2*pi*t/(4*1);
st = bw_o.*sin(wo+(bw_e.*bw_o).*Wt);
subplot(4,1,1);
plot(t,bw);
xlabel('Time ---->'); ylabel('Amplitude ---->');
title('Input Bit Stream'); grid on; axis([0 n -2 +2]);
subplot(4,1,2);
plot(t,bw_o);
xlabel('Time ---->'); ylabel('Amplitude ---->');
title('Odd Sequence'); grid on; axis([0 n -2 +2]);
subplot(4,1,3);
plot(t,bw_e);
xlabel('Time ---->'); ylabel('Amplitude ---->');
title('Even Sequence'); grid on; axis([0 n -2 +2]);
subplot(4,1,4);
plot(t,st);
xlabel('Time ---->'); ylabel('Amplitude ---->');
title('MSK Modulated Wave'); grid on; axis([0 n -2 +2]);
Model Graphs:
Input data: [1 0 1 1 0 1 0 0 1 1 0 1]
Results:
clc;
clear all;
close all;
%GENERATE CARRIER SIGNAL
Tb=1; fc=10;
t=0:Tb/100:1;
c=sqrt(2/Tb)*sin(2*pi*fc*t);
%GENERATE MESSAGE SIGNAL
N=8;
m=rand(1,N);
t1=0;t2=Tb
for i=1:N
t=[t1:.01:t2]
if m(i)>0.5
m(i)=1;
m_s=ones(1,length(t));
else
m(i)=0;
m_s=zeros(1,length(t));
end
message(i,:)=m_s;
%PRODUCT OF CARRIER AND MESSAGE
ask_sig(i,:)=c.*m_s;
t1=t1+(Tb+.01);
t2=t2+(Tb+.01);
%PLOT THE MESSAGE AND ASK SIGNAL
subplot(5,1,2);axis([0 N -2 2]);
plot(t,message(i,:),'r');
title('message signal');
xlabel('t--->'); ylabel('m(t)'); grid on
hold on
subplot(5,1,4);
plot(t,ask_sig(i,:));
title('ASK signal');
xlabel('t--->'); ylabel('s(t)'); grid on
hold on
end
hold off
%PLOT THE CARRIER SIGNAL AND INPUT BINARY DATA
subplot(5,1,3);
plot(t,c);
title('carrier signal');
xlabel('t--->'); ylabel('c(t)'); grid on
subplot(5,1,1);
stem(m);
clc;
clear all;
for i = 1:2^k
for j = k:-1:1
if rem(i-1,2^(-j+k+1))>=2^(-j+k)
u(i,j)=1;
else
u(i,j)=0;
end
end
end
u;
disp('The Possible Codewords are :')
c = rem(u*g,2)
disp('The Minimum Hamming Distance dmin for given Block Code is= ')
d_min = min(sum((c(2:2^k,:))'))
% Code Word
r = input('Enter the Received Code Word:')
p = [g(:,n-k+2:n)];
h = [transpose(p),eye(n-k)];
disp('Hammimg Code')
ht = transpose(h)
disp('Syndrome of a Given Codeword is :')
s = rem(r*ht,2)
for i = 1:1:size(ht)
if(ht(i,1:3)==s)
r(i) = 1-r(i);
break;
end
end
disp('The Error is in bit:')
i
disp('The Corrected Codeword is :')
r
G=
The Order of Linear block Code for given Generator Matrix is:
n=
7
k=
4
The Possible Codewords are :
c=
0000000
0001011
0010110
0011101
0100111
0101100
0110001
0111010
1000101
1001110
1010011
1011000
1100010
1101001
1110100
1111111
The Minimum Hamming Distance dmin for given Block Code is=
d_min =
r=
1000100
Hammimg Code
ht =
101
111
110
011
100
010
001