You are on page 1of 46

HINDUSTHAN

COLLEGE OF ENGINEERING AND TECHNOLOGY


COIMBATORE-641 032

DEPARTMENT OF ELECTRONICS AND COMMUNICATION


ENGINEERING

EL7111-COMMUNICATION AND SIGNAL PROCESSING


LABORATORY

NAME OF THE STUDENT

REGISTER NUMBER

CLASS/BRANCH

YEAR/SEMESTER

HINDUSTHAN
COLLEGE OF ENGINEERING AND TECHNOLOGY
COIMBATORE-641 032
Certified that this is the bonafide record of work done
By

in the
ELECTRONICS AND COMMUNICATION ENGINEERING LABORATARY-1
of this Department of ELECTRONICS AND COMMUNICATION ENGINEERING for the
First Semester during the academic year 2012-2013
Place:
Date:
Staff in-charge

Head of the Department

University Register No.:..

Submitted for the practical examination of the Anna University, Chennai


Conducted on ..

Internal Examiner

External Examiner

SL.NO DATE
1
2
3
4
5
6
7
8

EXPERIMENT
Channel equalizer design using
MATLAB(LMS,RLS)
Transform based compression
techniques
Antenna radiation pattern
measurement
Transmission line parametersMeasurements using network
analyzer
Performance evaluation of digital
modulation schemes
Implementation of linear and cyclic
codes
OFDM transceiver design using
MATLAB
Performance evaluation of digital
data transmission through fiber optic
link

PAGE TOTAL STAFF


NO MARKS INITIAL

CHANNEL EQUALIZER DESIGN ( LMS, RLS )


AIM
To simulate the LMS (Least Mean Squares) and the RLS (Recursive Least-Squares)
algorithms for the design of adaptive transversal filters for channel equalisation.

APPARATUS REQUIRED:
1.Personal computer
2.MATLAB R2010a

THEORY:
Discrete-time (or digital) filters are used to achieve desired spectral characteristics of a signal, to
reject unwanted signals, like noise or interferers, to reduce the bit rate in signal transmission, etc.
The notion of making filters adaptive, i.e., to alter parameters (coefficients) of a filter according
to some algorithm, tackles the problems that we might not in advance know, e.g., the
characteristics of the signal, or of the unwanted signal, or of a systems influence on the signal
that we like to compensate. Adaptive filters can adjust to unknown environment, and even track
signal or system characteristics varying over time.
Adaptive Transversal Filters.
In a transversal filter of length N, as depicted in fig. 1, at each time n the output sample y[n] is
computed by a weighted sum of the current and delayed input samples x[n], x[n 1], . . .

Here, the ck[n] are time dependent filter coefficients. we use the complex conjugated coefficients
c*k [n] so that the derivation of the adaption algorithm is valid for complex signals, too). This
equation re-written in vector form, using x[n] = [x[n], x[n 1], . . . , x[n N + 1] T ,the tapinput vector at time n, and c[n] = [c0[n], c1[n], . . . , cN1[n]]T ,the coefficient vector at time n, is
y[n] = cH[n]x[n]
Both x[n] and c[n] are column vectors of length N, cH[n] = (c)T [n] is the Hermitian of vector
c[n]. Here each element is conjugated *, and the column vector is transposed T into a row vector.

Transversal Filter With Time Dependent Coefficients


When the coefficients c[n] are not time dependent, then the transversal filter structure is an FIR
filter of length N. Here, the filter coefficients are assumed variable, and are adapted by suitable
adaptation algorithm.
LMS Adaptation Algorithm
The LMS (Least Mean Squares) algorithm is an approximation of the steepest descent algorithm
which uses an instantaneous estimate of the gradient vector of a cost function. The estimate of
the gradient is based on sample values of the tap-input vector and an error signal. The algorithm
iterates over each coefficient in the filter, moving it in the direction of the approximated gradient.
For the LMS algorithm it is necessary to have a reference signal d[n] representing the desired
filter output. The difference between the reference signal and the actual output of the transversal
filter is the error signal:
e[n] = d[n] cH[n]x[n]
A schematic of the learning setup is depicted in the following figure:

The task of the LMS algorithm is to find a set of filter coefficients c that minimize the
expected value of the quadratic error signal. The squared error and its expected value are
e2 = (d cHx)2 = d2 2d cHx + cHxxHc,
E(e2) = E(d2) E(2d cHx) + E(cHx xHc)
= E(d2) cH 2E(dx) + cH E(x xH)c
Note, that the squared error e2 is a quadratic function of the coefficient vector c, and
the only global minimum theoretical value could be found from the known expected values in
the above equation. The gradient descent approach demands that the position on the error surface
according to the current coefficients should be moved into the direction of the steepest descent,

i.e., in the direction of the negative gradient of the cost function J = E(e2) with respect to the
coefficient vector. The expected values in this equation is the cross-correlation vector between
the desired output signal and the tap-input vector and E(x xH) is the auto-correlation matrix of the
tap-input vector.In the LMS algorithm short-term estimate is used by only taking into account the
current samples.
Here, the step-size parameter is introduced, which controls the distance to be moved along
the error surface. In the LMS algorithm the update of the coefficients is performed at every time
instant n, c[n + 1] = c[n] + e*[n] x[n]. The step-size parameter controls how far we move
along the error function is moved along the surface at each update step. It is necessary that > 0
. It should not also be too large, since in the LMS algorithm uses a local approximation for
computation of the gradient of the cost function, and thus the cost function at each time instant
may differ from an accurate global cost function. Furthermore, too large a step-size causes the
LMS algorithm to be instable. the upper bound for for stable behavior depends on the signal
power. For stable adaptation behavior the step-size has to be

RLS Adaptation Algorithm


The RLS (recursive least squares) algorithm is another algorithm for determining the coefficients
of an adaptive filter. In contrast to the LMS algorithm, the RLS algorithm uses information from
all past input samples (and not only from the current tap-input samples) to estimate the (inverse
of the) autocorrelation matrix of the input vector. To decrease the influence of input samples
from the far past, a weighting factor for the influence of each sample is used. This weighting
factor is introduced in the cost function

where the error signal e[i, n] is computed for all times 1 _ i _ n using the current filter
coefficients c[n]: e[i, n] = d[i] cH[n]x[i]. When = 1 the squared error for all sample times i up
to current time n is considered in the cost function J equally. If 0 < < 1 the influence of past
error values decays exponentially. is called the forgetting factor. Similar to the case of LMS
algorithm, we find the gradient of the cost function with respect to the current weights. The
weights update equation is
c[n] = c[n 1] + k[n]d*[n] xH[n]c[n 1]
This equation is solved at each time-step n in the RLS algorithm. The RLS algorithm is
computationally more complex than the LMS algorithm. However, due to the recursive updation,
the RLS algorithm shows a faster convergence as compared to the LMS algorithm.
LMS Algorithm
% Implementation of LMS Algorithm
clc;
clear all;

close all;
order = input('order of the filter = ');% order of the filter
no_of_symbols =input('enter number of symbols = '); %length of input symbols
x = sign(randn(no_of_symbols,1)); % Input to the filter, BPSK Signal
h = fir1(order,0.5); % FIR system to be identified
noise = 0.1*randn(no_of_symbols,1); % Uncorrelated noise signal
d = filter(h,1,x)+noise; % Desired signal = output of H with input x+ Uncorrelated noise signal
w = zeros (order+1, 1); % Initially filter weights are zero
for n = order : no_of_symbols-1
u = x(n+1:-1:n+1-order);
y(n+1)= w' * u; % output of the adaptive filter
e(n+1) = d(n+1) - y(n+1); % error signal = desired signal - adaptive filter output
mu=0.008;
w = w + mu * u * e(n+1); % filter weights update
end
hold on
plot(d,'g')
plot(y,'m');
semilogy((abs(e)),'r');
title('System output') ;
xlabel('Samples')
ylabel('True and estimated output, error')
legend('Desired','Output','Error')
figure
plot(h', 'k+')
hold on
plot(w', 'r*')
legend('Actual weights','Estimated weights')
title('Comparison of the actual weights and the estimated weights') ;
h
w
difference_in_weigths=h-w'
mean_square_error= mean(e.^2)
Sample Input Values:
Enter the filter length= 4
Enter the number of symbols= 1000

Out Put

RLS ALGORITHM
% Implementation of RLS ALGORITHM
clc
close all
clear all
N=input('length of input sequence N = ');
t=[0:N-1];
ita=10^4;
I=ones(1,N);
R=ita*I;
w0=0.001; phi=0.1;
d=sin(2*pi*[1:N]*w0+phi);
x=d+randn(1,N)*0.5;
w=zeros(1,N);

for i=1:N
y(i) = w(i)' * x(i);
e(i) = d(i) - y(i);
z(i) = R(i) * x(i);
q = x(i)' * z(i);
v = 1/(1+q);
zz(i) = v * z(i);
w(i+1) = w(i) + e(i)*zz(i);
R(i+1) = R(i) - zz(i)*z(i);
end
for i=1:N
yd(i) = sum(w(i)' * x(i));
end
subplot(221),plot(t,d),ylabel('Desired Signal'),
subplot(222),plot(t,x),ylabel('Input Signal+Noise'),
subplot(223),plot(t,e),ylabel('Error'),
subplot(224),plot(t,yd),ylabel('Adaptive Desired output');
Sample Input Values
length of input sequence N = 1000

Output

RESULT:
The LMS and RLS algorithms for channel equalisation were simulated using MATLAB codes.
The simulation outputs for both the algorithms have been recorded. The efficacies of both the
algorithms have also been compared.

IMPLEMENTATION OF LINEAR AND CYCLIC CODES.


AIM:
To implement a cyclic code generator and syndrome calculator and to verify the same for the
given polynomial.
EQUIPMENT REQUIRED:
IC 7495
IC 7486
Trainer kit
Connectivity wires
THEORY:
Cyclic code:
Cyclic code from a subclass of linear block codes an advantage of cyclic code over most other
types of codes is that are easy to encode further more cyclic codes posses a well defined
mathematical structure, which has led to the development of very efficient decoding schemes. A
binary code is said to be a cyclic code if it exhibits two fundamental properties
1.linear property:
The sum of two code words is also a code word.
2.cyclic property:
Any cyclic shift of a code word is also a code word
The gate is switched on hence the M message bits are shifted into channel as soon as the K
message bits have entered the shift register, the resulting (n-k) bits in the register from the parity
bits.
The gate is switched OFF there by berating the feedback connection the contents of the shift
register are shifted out into the channel the polynomial for the message (1001) is given by
g(t).The contents of the shift register are modified by the incoming message bits as in tables,
after A shifts the parity bits are (011), according appending these parity bits to the message bits
(1001),we get the code word(0111001).

SYNDROME CALCULATOR BLOCK DIAGRAM:

SYNDROME CIRCUIT DIAGRAM:

SYNDROME CALCULATOR:
Suppose if the code word (X0,X1,X2,X3Xn) is transmitted over the noisy channel and
received word (Y0,Y1.Y2,Y3..Yn) the syndrome is calculated for error, if syndrome contain
zero there is an error and if non zero is present it contains error.
In case of cyclic code, the received word be represented by polynomial of degree (n-1) as
Yn=a(n).g(n) + s(d)S.T
The remainder S(n) is syndrome polynomial of degree n-k-1 or less. Its co-efficients are
making up the (n-k) by -1 syndrome S once we know S, we can determine the corresponding
error pattern and there by mate the approximate correction.
The cyclic code generation includes the following steps:
1. Multiplication of the message polynomial D(x) by X(n-k).

2. Division of X(n-k) by D(x) by the generator polynomial G(x) to obtain the remainder.
3. Addition of the remainder to X(n-k) D(x) to form the desired code polynomial.
The given polynomial is,
G(x) = 1+X+X3 for(7,4 cyclic code)
So the code word is 0111011.
The above steps are implemented by means of flip-flops, multipliers, adders,
wholly as linear feedback shift register and an external clock controls the operation of Flipflops.
Let the transmitted code word be (0111001) and the received word (0111001)
and the received word (0110001) and the received word be (0110001) that is the middle bits is
in error as the received bits are fed into ht shift register initially set to zero its content are
modified as in table at the end of seventh shift register as 110. Since the syndrome is non zero
the received word is in error pattern corresponding to this syndrome is inn the middle bits of
the received word.
CODE GENERATOR BLOCK DIAGRAM:

CIRCUIT DAGRAM FOR CODE CONVERTER

CODE GENERATOR
Message
IO
0
1
0
0
1

P0

P1

P2

0
0
1
0
1

0
1
1
1
1

0
0
1
1
1

RESULT:
The cyclic code was designed for generating word where message a = 1001 and parity bit
generating was 011. The circuit was executed and output table was verified.The syndrome
calculator circuit was designed first for the class where no error occurred and if one bit error was
occurring . Both the output flipflop for these cases were verified and observation were written.

OFDM TRANSCEIVER DESIGN USING MATLAB


AIM:

To design an OFDM transceiver using MATLAB and to


evaluate the result.

TOOLS REQUIRED:
MATLAB 7.3

THEORY
Orthogonal Frequency Division Multiplexing (OFDM) is a multi-carrier modulation technique
which divides the available spectrum into many carriers. OFDM uses the spectrum efficiently
compared to FDMA by spacing the channels much closer together and making all carriers
orthogonal to one another to prevent interference between the closely spaced carriers. The main
advantage of OFDM is its robustness to channel fading in wireless environment. Use of
reconfigurable architecture makes the system more flexible to the design requirements.
In early multicarrier transmission systems subcarriers were non-overlapping to prevent intercarrier interference which can greatly degrade performance of a system. Individual subcarriers
were separated by guard bands which constituted wasted bandwidth.
The reason why Orthogonal Frequency Division Multiplexing (OFDM) has become the most
popular technique of multicarrier transmission is that subcarriers overlap in frequency and 8
therefore bandwidth utilization increases by up to 50%. Overlapping subcarriers is allowed
because in OFDM modulation subcarriers are orthogonal to each other.

OFDM TRANSCEIVER BLOCK DIAGRAM:

CODING:
clc;
clear all;
close all;
%------------------Message sequence------------%
m1=randint(1,19200);
BER=[];
for num=1:192:19200
m=m1(num:num+191);
%------------------Transmission----------------%

msg=reshape(m,48,4);
msgd=[];X=[];
msgd=msg;
msgd(:,2)=msg(:,3);
msgd(:,3)=msg(:,2);
ys=bi2de(msgd,'left-msb');
mod=qammod(ys,16); % modulation
YS=[];
YS=reshape(mod,1,48);
pilot=1+i;
X=[pilot YS(1:12) pilot YS(13:24) pilot YS(25:36) pilot YS(37:48)];% adding pilot carrier
B(1:6)=X(1:6);
B(7:58)=X(1:52);
B(59:64)=X(47:52);
C=ifft(B);%transmitted sequence
%------------------Reception-----------------%
n=0;
for k=0:2:50
q=awgn(C,k,'measured');%adding noise
R=fft(q);
S=R(7:58);
SX=[S(2:13) S(15:26) S(28:39) S(41:52)];
RX=qamdemod(SX,16);
YX=de2bi(RX,'left-msb');
% YX=YX(:,1:4);

Z=YX;
Z(:,2)=YX(:,3);
Z(:,3)=YX(:,2);
P=msg-Z;
Px=abs(P);
%------------BER Calculation----------------%
count=length(Px(Px>0));
n=n+1;
BERn(n)=count/48;
end
BER=[BER;BERn];
end
ber=mean(BER);
figure;
SNR_db=0:2:50;
semilogy(SNR_db,ber,'o-');

OUTPUT:

RESULT:
Thus the OFDM transceiver has been designed using MATLAB and the output has been verified.

TRANSFORM BASED COMPRESSION TECHNIQUES

AIM:
To implement transform based compression techniques using MATLAB.

TOOLS REQUIRED:
MATLAB 7.3

THEORY:
Image compression may be lossy or lossless. Lossless compression is preferred for archival
purposes and often for medical imaging, technical drawings, clip art, or comics. Lossy
compression methods, especially when used at low bit rates, introduce compression artifacts.
Lossy methods are especially suitable for natural images such as photographs in applications
where minor (sometimes imperceptible) loss of fidelity is acceptable to achieve a substantial
reduction in bit rate. The lossy compression that produces imperceptible differences may be
called visually lossless.
The best image quality at a given bit-rate (or compression rate) is the main goal of image
compression, however, there are other important properties of image compression schemes:
Scalability generally refers to a quality reduction achieved by manipulation of the bitstream or
file (without decompression and re-compression). Other names for scalability are progressive
coding or embedded bitstreams. Despite its contrary nature, scalability also may be found in
lossless codecs, usually in form of coarse-to-fine pixel scans. Scalability is especially useful for
previewing images while downloading them (e.g., in a web browser) or for providing variable
quality access to e.g., databases.

MATLAB CODE:

clc;
clear all;
close all;
X=imread('peppers.png');

%image read

S=rgb2gray(X);
imshow(S);

%display image

%-------------DWT---------------%
[LL LH HL HH]=dwt2(S,'haar');
[LL1 LH1 HL1 HH1]=dwt2(LL,'haar');
for i=1:96
for j=1:128
if abs(LH1(i,j))<0
LH1(i,j)=0;
end
if abs(HL1(i,j))<0
HL1(i,j)=0;

End
if abs(HH1(i,j))<0
HH1(i,j)=0;
end
end
end
for i=1:192
for j=1:256
if abs(LH(i,j))<0
LH(i,j)=0;
end
if abs(HL(i,j))<0
HL(i,j)=0;
end
if abs(HH(i,j))<0
HH(i,j)=0;
end
end
end
L1=idwt2(LL1,LH1,HL1,HH1,'haar');
L=idwt2(LL,LH,HL,HH,'haar');
imwrite(L,'pep.jpg');
figure;
imshow(uint8(L))
imfinfo('pep.jpg')

%---------------DCT---------------%
D=dct2(S);
for i=1:384
for j=1:512
if (abs(D(i,j))<25)
M(i,j)=0;
else
M(i,j)=D(i,j);
end
end
end
I=idct2(M);
imwrite(I,'Pep1.jpg');
figure;
imshow(uint8(I))
imfinfo('Pep1.jpg');

OUTPUTS:
OUTPUT1:

++

OUTPUT 3:

OUTPUT2:

RESULT:
Thus transform based compression techniques have been implemented using MATLAB and the
results has been verified successfully.

ANTENNA RADIATION PATTERN MEASUREMENT

AIM:

To plot the radiation pattern of basic antennas in E plane and H plane on log scale polar plot
and to measure the bandwidth and directivity.

EQUIPMENTS REQUIRED:

1.
2.
3.
4.
5.
6.
7.

Antenna transmitter and receiver.


Stepper motor controller.
Yagi-Uda Antenna.
Dipole antenna
Polarization connector.
Antenna tripod
Stepper rod.

PROCEDURE:

1. To perform the self-test to check the system integrity.


2. Connect dipole antenna to tripod and set the transmitter frequency to 850MHz and the
attenuator downwards to avoid receiving saturation. Adjust the dipole frequency at
850MHz
3. Now connect Yagi-Uda antenna or end fire antenna or dipole antenna or monopole
antenna to the stepper tripod and set the receiver to 850MHz. Set the attenuator upwards
for maximum sensitivity and the length of antenna.
YAGI-UDA ANTENNA
Keep the transmitter and receiver antenna in the horizontal direction.
ARRAY ANTENNA
Keep the transmitter and receiver antenna in the vertical direction using
connector.

polarization

DIPOLE ANTENNA
Keep the transmitter and receiver antenna in the horizontal direction.
LOOP ANTENNA
Keep the transmitter and receiver antenna in the vertical direction.

4. Set the distance between the antennas to be around 1meter.Remove any object around the
antenna, especially the line of sight. Avoid unnecessary movements while taking
readings.
5. Now rotate the antenna around its axis in steps of 5 degree using stepper motor controller.
Take the degree readings of receiver at each step and note down.
6. Note down the maximum readings out of the whole set of readings. This will form of 0dB
reference reading and note down. Now subtract all the readings from reference reading
and note down. Then use this new set of readings draw the plot.
7. Plot the readings on the polar plane with log scale on the graph.
8. This plot shall form an E-plane plot.
9. Now without disturbing the setup, rotate the transmitter and the receiver antenna.
YAGI-UDA ANTENNA
Keep the transmitter and receiver antenna in the vertical direction.

ARRAY ANTENNA
Keep the transmitter and receiver antenna in the horizontal direction using polarization
connector.
DIPOLE ANTENNA
Keep the transmitter and receiver antenna in the vertical direction.
LOOP ANTENNA
Keep the transmitter and receiver antenna in the horizontal direction.

10. Set the distance between the antennas to be around 1meter.Remove any object around the
antenna, especially the line of sight. Avoid unnecessary movements while taking
readings.
11. Now rotate the antenna around its axis in steps of 5 degree using stepper motor controller.
Take the degree readings of receiver at each step and note down.
12. Note down the maximum readings out of the whole set of readings. This will form of 0dB
reference reading and note down. Now subtract all the readings from reference reading
and note down. Then use this new set of readings draw the plot.
13. Plot the readings on the polar plane with log scale on the graph.
14. This plot shall form an H-plane plot.
15. Measures the bandwidth and directivity
I. From E-plane and H-plane radiation pattern find the following,
II. The -3dB or half power beam width is defined as the width ln log at the points on
the either side of the main beam where radiated level is 3dB lower than the
maximum lobe level.
III. From the plot measure the angle where 0dB reference is there. This shall also be
direction of main lobe.
IV. Measure the angle difference between the angular positioning of the 3dB points and
the beam width of the receiving antenna.
V. Calculate the directivity, by using bandwidth of E-plane and bandwidth of H-plane.
Directivity = 41000 / (HP HP)

VI. Take the log of this value and multiply by 10 for reading in dB sec. This
formula gives approximated value of directivity.

YAGI-UDA ANTENNA
E-plane beam width HP =
H-plane beam width HP =
Directivity = 41000 / (HP HP)
ARRAY ANTENNA
E-plane beam width HP =
H-plane beam width HP =
Directivity = 41000 / (HP HP)
LOOP ANTENNA
E-plane beam width HP =
H-plane beam width HP =
Directivity = 41000 / (HP HP)

DIPOLE ANTENNA
E-plane beam width HP =
H-plane beam width HP =
Directivity = 41000 / (HP HP)

RESULT:

Thus the radiation pattern of yagi-uda antenna, array antenna, dipole antenna, loop antenna in E
and H plane on log scale polar plot has been plotted and beamwidth, directivity of these antennas
were measured.

PERFORMANCE EVALUATION OF DIGITAL DATA


TRANSMISSION
THROUGH OPTICAL FIBRE LINK

AIM:
To evaluate the performance of digital data transmission through the fibre optic links and to
measure the losses in an optical fibre communication.

EQUIPMENTS REQUIRED:

1.
2.
3.
4.

OFT
Two channel, 20 MHz oscilloscope
Function generator.
Fibre alignment unit.

THEORY:

The OFT can be used to set up two fibre optic digital links, one at a wavelength of 650nm. And
the other at a wavelength of 850nm. LED 1, in the optical transmitter block, is an 850nm. LED,
and LED 2, in the optical transmitter block is a 650nm LED.

PD1, in the optical receiver block, is a PIN detector, which gives a current proportional to the
optical power falling on the detector . The received signal is amplified and converted to a TTL
signal using a comparator. The gain control plays a crucial role in the conversion. PD2, in the
optical receiver block, is another receiver, which directly gives out a TTL signal. Both the PIN
detectors can receive 650nm as well as 850nm signals, through their sensitivity is lower at
650nm.

MATLAB CODE:

function [d,dcode]=adc(a,b,c,code_table)
% Analog-to-Digital Conversion
% Input : analog signal a, boundary vector b, centroid vector c,
%

and code_table

% Output: quantized samples d and the corresponding code dcode


N=length(c);
if nargin<4, code_table=[0:N-1]'; end
Na=length(a); % dcode=zeros(Na,size(code_table,2));
for n=1:Na
I=find(a(n)<b(2:N));
if ~isempty(I), d(n)=c(I(1)); dcode(n,:)=code_table(I(1),:);

else
end
end

d(n)=c(N); dcode(n,:)=code_table(N,:);

RESULT:

Thus the performance of the digital data transmission through the optical fibre is evaluated and
bending loss is calculated.

PERFORMANCE EVALUATION OF DIGITAL MODULATION


SCHEMES
AIM:
To generate amplitude shift keying, frequency shift keying and phase shit keying using
MATLAB program
.

EQUIPMENT REQUIRED:
1. Personal Computer With MATLAB 2007 r

THEORY:
1. Amplitude shift keying:
Start the execution of the program
Read the two different amplitude values for high and low inputs
Generate the output waveform for high and low inputs and plot them in time domain
Stop the execution of the program
2. Frequency shift keying:
Start the execution of the program
Read the two different Frequencies for high and low inputs
Generate the output waveform for high and low inputs and plot them in time domain
Stop the execution of the program
3. Phase shift keying:
Start the execution of the program
Read the amplitude, Frequency and time interval

Generate the output signal with inphase and outphase components according to high
and low inputs
Stop the execution of the program
1. PROGRAM CODING FOR AMPLITUDE SHIFT KEYING:
E1=5;
E2=3;
f=3000;
t1=1:1:50;
t=100;
res1=sqrt(2*E1/t)*(cos((2*3.14*f*t1)+90));
t2=51:1:100;
res2=sqrt(2*E2/t)*(cos((2*3.14*f*t2)+90));
t=1:1:100;
result(1:50)=res1(1:50);
result(51:100)=res2(1:50);
figure(1);
plot(t,result);
title('AMPLITUDE SHIFT KEYING');
xlabel('time ---->');
ylabel('amplitude ---->');
grid on;

OUTPUT OF AMPLITUDE SHIFT KEYING

2. PROGRAM CODING FOR FREQUENCY SHIFT KEYING:


E=15;
t1=1:1:50;
f1=100;
T=50;
res1=(sqrt(2*E/T))*(cos(2*3.14*f1*t1));
t2=51:1:100;
f2=250;
res2=(sqrt(2*E/T))*(cos(2*3.14*f2*t2));
t=1:1:100;
res(1:50)=res1(1:50);
res(51:100)=res2(1:50);
plot(t,res);
title('FREQUENCY SHIFT KEYING');
xlabel('time ---->');

ylabel('amplitude ---->');

OUTPUT OF FREQUENCY SHIFT KEYING

3. PROGRAM CODING FOR PHASE SHIFT KEYING:


E=10;
f1=1:1:50;
f=3000;
T=100;
i=1;
m=2;
res1=(sqrt(2*E/T))*(cos((2*3.14*f*t1)+(2*180*i/m)));
t2=51:1:100;
i=2;
res2=(sqrt(2*E/T))*(cos((2*3.14*f*t2)+(2*180*i/m)));
t=1:1:100;
result(1:50)=res1(1:50);
result(51:100)=res2(1:50);
figure(1);
plot(t,result);
title('PHASE SHIFT KEYING');
xlabel('time---->');

ylabel('amplitude---->');

OUTPUT OF PHASE SHIFT KEYING

RESULT:
Thus the amplitude shift keying ,frequency shift keying and phase shit keying are generated
using MATLAB program and the outputs are verified.

TRANSMISSION LINE PARAMETERS MEASUREMENT


USING NETWORK ANALYZER

AIM:
To measure the transmission line parameters using network analyzer and verify the results.

EQUIPMENT REQUIRED:
MATLAB7.3

THEORY:
In order to calculate Dk and Df, you will need to fabricate transmission line samples (or just one
line, if you are confident you can de-embed an exact length out of a measurement. The samples
should be matched as closely as possible to 50 ohms. The connectors or RF probe pads must be
as electrically transparent as possible, and as repeatable as possible. The RF data must be
carefully measured, as accurately as possible. Even though the measurement technique allows
you to measure the parameters over frequency, don't get greedy and try to gather 10,000
datapoints. In the end you will have to average adjacent points together to smooth out the "noise"
generated by trying to measure slight differences in transmission phase angles.
When you perform the measurement, you can increase the accuracy of the data by dialing down
the IF bandwidth (on Agilent's PNA it is default to 35 kHz, we suggest 500 Hz). You should also
turn up the averaging, we suggest 16 samples averaged. Be sure you perform the calibration with
the averaging on. And consider using smoothing, as you'll see, we use it in the spreadsheet.
There's more information on smoothing group delay measurements on this page.
The transmission line type is up to you. The preferred type would be stripline, as you don't need
to calculate a filling factor convert Keff to Dk. Coax is just as good, so cable manufacturers can
use these techniques just the same as board houses. In the end, most measurements will be on
microstrip or some form of CPW, and these are the easiest to fabricate.

MATLAB CODE:
function [SigGen] = AF2024_Open( SigGen, Reset)

OFF

= 0; ON = 1;

SigGen.IO
= agt_newconnection('gpib',0, SigGen.GPIB);
agt_setVisaTimeout(SigGen.IO, SigGen.VisaTimeout);
%[c_Stat, c_StatDsrp, VisaTimeout] = agt_getVisaTimeout(SigGen.IO);
sprintf('VisaTimeout=%d \n',VisaTimeout)
if (exist('Reset','var') && (Reset == 1))
agt_sendcommand(SigGen.IO,
'*RST');
end
%% ################################################## Query
% (0 command received) (0 'succeeded'; -1 'error message')
[c_Stat, c_StatDsrp, q_Result] = agt_query(SigGen.IO,
'*idn?');
sprintf('%s \n',
q_Result)
%% ################################################## CFRQ Setup: FreqSTD
agt_sendcommand(SigGen.IO, ['FSTD '
SigGen.FSTD]);
agt_query(SigGen.IO,
'*OPC?');
%% ################################################## RFLV Setup: unit, inc
agt_sendcommand(SigGen.IO, ['RFLV:UNITS '
SigGen.RFLV.unit]);
agt_query(SigGen.IO, '*OPC?');
%agt_sendcommand(SigGen.IO, ['RFLV:INC '
agt_query(SigGen.IO, '*OPC?');

num2str( SigGen.RFLV.inc )]);

%% ################################################## Option / Capabilities


[c_Stat, c_StatDsrp, q_Result] = agt_query(SigGen.IO,
'*OPT?');
sprintf('%s \n',
q_Result)
%% ################################################## System Errors
[c_Stat, c_StatDsrp, q_Result] = agt_query(SigGen.IO,
'ERROR?');
sprintf('%s \n',
q_Result)
agt_sendcommand(SigGen.IO, '*CLS'
);
% agt_sendcommand(AF2024_f2.IO, ['GPIB 23']); agt_query(AF2024_f2.IO, '*OPC?');

RESULT:
Thus the transmission line parameters have been measured using network analyzer.

You might also like