channel equalizer design1

55
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 :…………………………

Upload: sundarhicet83

Post on 10-Feb-2016

247 views

Category:

Documents


1 download

DESCRIPTION

hfg

TRANSCRIPT

Page 1: Channel Equalizer Design1

HINDUSTHANCOLLEGE 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 :…………………………

Page 2: Channel Equalizer Design1

HINDUSTHANCOLLEGE 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

Page 3: Channel Equalizer Design1

SL.NO DATE EXPERIMENT PAGE NO

TOTALMARKS

STAFFINITIAL

1 Channel equalizer design using MATLAB(LMS,RLS)

2 Transform based compression techniques

3 Antenna radiation pattern measurement

4 Transmission line parameters-Measurements using network

analyzer5 Performance evaluation of digital

modulation schemes6 Implementation of linear and cyclic

codes7 OFDM transceiver design using

MATLAB8 Performance evaluation of digital

data transmission through fiber optic link

Page 4: Channel Equalizer Design1

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 tap-input vector at time n, and c[n] = [c0[n], c1[n], . . . , cN−1[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.

Page 5: Channel Equalizer Design1

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 theexpected 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, andthe 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’,

Page 6: Channel Equalizer Design1

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 filtercoefficients 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 Algorithmclc;clear all;

Page 7: Channel Equalizer Design1

close all;order = input('order of the filter = ');% order of the filterno_of_symbols =input('enter number of symbols = '); %length of input symbolsx = sign(randn(no_of_symbols,1)); % Input to the filter, BPSK Signalh = fir1(order,0.5); % FIR system to be identifiednoise = 0.1*randn(no_of_symbols,1); % Uncorrelated noise signald = filter(h,1,x)+noise; % Desired signal = output of H with input x+ Uncorrelated noise signalw = zeros (order+1, 1); % Initially filter weights are zerofor n = order : no_of_symbols-1u = x(n+1:-1:n+1-order);y(n+1)= w' * u; % output of the adaptive filtere(n+1) = d(n+1) - y(n+1); % error signal = desired signal - adaptive filter outputmu=0.008;w = w + mu * u * e(n+1); % filter weights updateendhold onplot(d,'g')plot(y,'m');semilogy((abs(e)),'r');title('System output') ;xlabel('Samples')ylabel('True and estimated output, error')legend('Desired','Output','Error')figureplot(h', 'k+')hold onplot(w', 'r*')legend('Actual weights','Estimated weights')title('Comparison of the actual weights and the estimated weights') ;hwdifference_in_weigths=h-w'mean_square_error= mean(e.^2)

Sample Input Values:

Enter the filter length= 4Enter the number of symbols= 1000

Page 8: Channel Equalizer Design1

Out Put

Page 9: Channel Equalizer Design1
Page 10: Channel Equalizer Design1

RLS ALGORITHM

% Implementation of RLS ALGORITHMclcclose allclear 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);

Page 11: Channel Equalizer Design1

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);endfor i=1:Nyd(i) = sum(w(i)' * x(i)); endsubplot(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

Page 12: Channel Equalizer Design1

Output

Page 13: Channel Equalizer Design1

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.

Page 14: Channel Equalizer Design1

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 othertypes 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 wordThe gate is switched on hence the M message bits are shifted into channel as soon as the Kmessage 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 shiftregister 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:

Page 15: Channel Equalizer Design1

SYNDROME CIRCUIT DIAGRAM:

SYNDROME CALCULATOR:

Suppose if the code word (X0,X1,X2,X3………Xn) is transmitted over the noisy channel andreceived word (Y0,Y1.Y2,Y3……..Yn) the syndrome is calculated for error, if syndrome containzero 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) asYn=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 aremaking 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).

Page 16: Channel Equalizer Design1

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 control’s 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 isin error as the received bits are fed into ht shift register initially set to zero its content aremodified as in table at the end of seventh shift register as 110. Since the syndrome is non zerothe received word is in error pattern corresponding to this syndrome is inn the middle bits ofthe received word.

CODE GENERATOR BLOCK DIAGRAM:

Page 17: Channel Equalizer Design1

CIRCUIT DAGRAM FOR CODE CONVERTER

CODE GENERATOR

Message IO

P0 P1 P2

0 0 0 01 0 1 00 1 1 10 0 1 11 1 1 1

Page 18: Channel Equalizer Design1

RESULT:

The cyclic code was designed for generating word where message a = 1001 and parity bitgenerating 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.

Page 19: Channel Equalizer Design1

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 inter-carrier 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.

Page 20: Channel Equalizer Design1

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----------------%

Page 21: Channel Equalizer Design1

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);

Page 22: Channel Equalizer Design1

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:

Page 23: Channel Equalizer Design1

RESULT:

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

Page 24: Channel Equalizer Design1

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.

Page 25: Channel Equalizer Design1

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;

Page 26: Channel Equalizer Design1

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')

Page 27: Channel Equalizer Design1

%---------------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');

Page 28: Channel Equalizer Design1

OUTPUTS:

OUTPUT1: OUTPUT2:

++

OUTPUT 3:

Page 29: Channel Equalizer Design1
Page 30: Channel Equalizer Design1

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. Antenna transmitter and receiver.2. Stepper motor controller.3. Yagi-Uda Antenna.4. Dipole antenna5. Polarization connector.6. Antenna tripod 7. Stepper rod.

Page 31: Channel Equalizer Design1

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 polarization connector.

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.

Page 32: Channel Equalizer Design1

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.

Page 33: Channel Equalizer Design1

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)

Page 34: Channel Equalizer Design1
Page 35: Channel Equalizer Design1

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. OFT2. Two channel, 20 MHz oscilloscope3. Function generator.4. Fibre alignment unit.

Page 36: Channel Equalizer Design1

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

Page 37: Channel Equalizer Design1

I=find(a(n)<b(2:N));

if ~isempty(I), d(n)=c(I(1)); dcode(n,:)=code_table(I(1),:);

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

end end

Page 38: Channel Equalizer Design1

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 usingMATLAB 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

Page 39: Channel Equalizer Design1

• 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 highand 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;

Page 40: Channel Equalizer Design1

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

Page 41: Channel Equalizer Design1

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

Page 42: Channel Equalizer Design1
Page 43: Channel Equalizer Design1

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.

Page 44: Channel Equalizer Design1

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);

Page 45: Channel Equalizer Design1

%[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: FreqSTDagt_sendcommand(SigGen.IO, ['FSTD ' SigGen.FSTD]); agt_query(SigGen.IO, '*OPC?');

%% ################################################## RFLV Setup: unit, incagt_sendcommand(SigGen.IO, ['RFLV:UNITS ' SigGen.RFLV.unit]); agt_query(SigGen.IO, '*OPC?');

%agt_sendcommand(SigGen.IO, ['RFLV:INC ' num2str( SigGen.RFLV.inc )]);agt_query(SigGen.IO, '*OPC?');

%% ################################################## 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?');

Page 46: Channel Equalizer Design1

RESULT:

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