15696_lmece457 (2)

26
1 LMECE457 LABORATORY MANUAL COURSE CODE: ECE 457 COURSE TITLE: UNIFIED ELECTRONICS LABORATRY V

Upload: aadiljahangeer

Post on 26-Oct-2014

110 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 15696_LMECE457 (2)

1 LMECE457

LABORATORY MANUAL

COURSE CODE: ECE 457

COURSE TITLE: UNIFIED ELECTRONICS

LABORATRY V

Page 2: 15696_LMECE457 (2)

2 LMECE457

TABLE OF CONTENTS

S. No. Title of the Experiment Page No.

1 Use slotted line 1. To determine unknown frequency 2. To find SWVR and Reflection coefficient

3

2 1. To investigate the properties of a system comprising a dipole and a parasitic element

2. Understand the terms ‘driven element’, ‘reflector’, ‘director’ 3. To know the form of a YAGI antenna and examine multi element yagi. 4. To see how gain and directivity increase as element numbers

increase.

5

3 Understand the terms ‘baying’ and ‘stacking’ as applied to antennas. 1. To investigate stacked and bayed yagi antennas. 2. To compare their performance with a single yagi.

7

4 Implementation of Time Division Multiplexing system using matlab/simulink. 10

5 Implementation of pulse code modulation and demodulation using matlab/simulink.

13

6 Implementation of delta modulation and demodulation and observe effect of slope Overload using matlab/simulink

17

MTE 7 Implementation of pulse data coding techniques for various formats using

matlab/simulink.. 19

8 Implementation of Data decoding techniques for various formats using matlab/simulink.

21

9 Implementation of amplitude shift keying modulator and demodulator using matlab/simulink.

24

10 Implementation of frequency shift keying modulator and demodulator using matlab/simulink.

25

11 Implementation of phase shift keying modulator and demodulator using matlab/simulink.

26

Page 3: 15696_LMECE457 (2)

3 LMECE457

Experiment No. 1

1. Experiment: To study of unknown frequency, VSWR and reflection Coefficient

by the use of the slotted line

Equipment/Material required

Transmitter Mod MW-TX, One slotted line MW-5, Loads of different values

(OC, SC, 75Ω, 50Ω, 100Ω) RF cable (Zo =75Ω) Voltmeter

2. Learning Objectives: i) To determine the unknown frequency

ii) To determine the Voltage Standing Wave Ratio (VSWR) and Reflection

Coefficient.

3. Outline of the Procedure:

Microwave test bench

1. Connect the generator (transmitter) to the slotted line through RF cable.

2. Terminate the line by attaching a load (ZL) on other end of line.

3. Insert probes of voltmeter in the slots provided on the trailer of the slotted line

4. Turn on the generator and excite the cable with RF waves.

5. Move the trailer on the slotted line. Positions of maximum & minimum voltage

appear alternately on the slotted line.

6. Note down the max & min values of voltage.

7. Also note down the positions of the voltage minima and voltage maxima on the

scale 8. Determine VSWR by the following formula:

Measured VSWR= V max

/ V min

9. Determine the calculated VSWR by the formula:

VSWR = 1 + Г

1 - Г

where Г= ZL – Z0

ZL

+ Z0

10. Calculate the unknown frequency with the help of the following formula.

λ / 2 =distance between consecutive V maxima or minima

f = c / λ 11. Repeat same procedure for different loads (Z

L).

4. Required Results:

Parameters: Varying unknown frequency

Page 4: 15696_LMECE457 (2)

4 LMECE457

Relationship: VSWR depends upon reflection coefficient

Error Analysis: To calculate error

5. Cautions:

a. use fan for cooling

b. use kit very carefully

6. Learning outcomes: to be written by the students in 50-70 words.

Page 5: 15696_LMECE457 (2)

5 LMECE457

Experiment No. 2 1. Experiment: To study of a dipole and a parasitic element , Understand the terms

‘driven element’, ‘reflector’, ‘director’

Equipment/Material required: Antenna Lab hardware, Discovery Software,

Dipole elements, Yagi boom

2. Learning Objectives: I) To investigate the properties of a system comprising a dipole and a parasitic

element

II) Understand the terms ‘driven element’, ‘reflector’, ‘director’

III) To know the form of a YAGI antenna and examine multi element yagi.

IV) To see how gain and directivity increase as element numbers increase.

3. Outline of the Procedure: 1. Identify one of the Yagi Boom Assemblies and mount it on top of the

Generator Tower.

2. Ensure that all of the elements are removed, except for the dipole.

3. Ensure that the Motor Enable switch is off and then switch on the trainer.

4. Launch a signal strength vs. angle 2D polar graph and immediately switch on

the motor enable.

5. Ensure that the Receiver and Generator antennas are aligned with each other

and that the spacing between them is about one meter.

6. Set the dipole length to 10cm

7. Acquire a new plot at 1500MHz.

8. Observe the polar plot.

9. Identify one of the other undriven dipole antenna element.

10. move the driven dipole forward on the boom by about 2.5 cm and mount a

second undriven dipole element behind the first at a spacing of about 5 cm.

11. set the undriven length to 10 cm

12. acquire a second new plot at 1500 MHz

Has the polar pattern changed by adding the second element? 13. change the spacing to 2.5cm and acquire a third new plot at 1500 MHz

What changes has the alteration in spacing made to the gain and

directivity?

CHANGING THE LENGTH OF THE PARASITIC ELEMENT

14. Launch a new signal strength vs. angle 2D polar graph window.

15. Acquire a new plot at 1500 MHz

16. Extend the length of the un-driven element to 11cm.

17. Acquire a second new plot at 1500 MHz.

18. Reduce the length of the un-driven element to 8cm.

19. Acquire a third new plot at 1500MHz.

What changes has the alteration in length made to the gain and

Page 6: 15696_LMECE457 (2)

6 LMECE457

directivity?

ADDING A SECOND REFLECTOR 20. Mount the driven dipole on the boom forward from the axis of rotation by

about 2.5cm and mount a second un-driven dipole element behind the first, at

a spacing of about 5cm.

21. Set the dipole length to 10cm and the un-driven dipole length to 11cm.

22. Acquire a new plot at 1500MHz.

23. Observe the polar plot.

24. Mount a second parasitic element about 5cm from the first parasitic reflector

and adjust its length to 11cm.

25. Acquire a second new plot at 1500MHz.

26. Observe the polar plot.

Is there any significant difference between the two plots? 27. Change the spacing between the two reflectors and acquire a third new plot at

1500MHz.

Is there any significant difference between the plots, now? ___You will find that the addition of a second reflector has little effect on the

gain and directivity of the antenna, irrespective of the spacing between the two

reflectors. ADDING DIRECTORS

28. Remove the second reflector element from the boom.

29. Launch a new signal strength vs. angle 2D polar graph window.

30. Acquire a new plot at 1500 MHz.

31. Observe the polar plot

32. Mount a parasitic element about 5cm in front of the driven

33. element and adjust its length to 8.5cm.

34. Acquire a second new plot at 1500 MHz.

35. Observe the polar plot.

Is there any significant difference between the two plots? 36. Move the director to about 2.5 cm in front of the driven element.

37. Acquire a third new plot at 1500 MHz

38. Observe the polar plot.

How does the new plot compare with the previous two? 39. Launch another new signal strength vs. angle 2d polar graph window.

40. Acquire a new plot at 1500 MHz.

41. Add a second director 5 cm in front of the second.

42. Acquire a second new plot at 1500 MHz.

43. Add a third director 5 cm in front of the second.

44. Acquire a third new plot at 1500 MHz.

45. Add a fourth director 5 cm in front of the third.

46. Acquire a fourth new plot at 1500 MHz

How do the gains and directivities compare? 47. Launch another new signal strength vs. angle 2D polar graph window.

48. Acquire a new plot at 1500 MHz.

49. Move the reflector to 2.5 cm behind the driven element. Acquire a second new

plot at 1500 MHz.

4. Required Results:

Parameters: Varying unknown frequency

Page 7: 15696_LMECE457 (2)

7 LMECE457

Relationship: VSWR depends upon reflection coefficient

Error Analysis: To calculate error

5. Cautions:

a. use fan for cooling

b. use kit very carefully

6. Learning outcomes: to be written by the students in 50-70 words.

Experiment No. 3

1. Experiment: To study of baying, stacking by the use of yagi antenna

Equipment/Material required: yagi antennas, cables.

2. Learning Objectives: I) To understand the terms ‘baying’ and ‘stacking’ as applied to antennas.

II) To investigate stacked and bayed yagi antennas.

III) To compare their performance with a single yagi

(A) Baying Two Yagis

3. Outline of the Procedure: 1. Connected up the hardware of AntennaLab.

2. Loaded the Discovery software.

3. Loaded the NEC-Win software.

4. Ensure that a Yagi Boom Assembly is mounted on the Generator Tower.

5. Building up a 6 element yagi. The dimensions of this are:

Length Spacing Reflector 11 cm 5cm behind

driven element

Driven Element 10 cm Zero (reference)

Director 1 8.5 cm 2.5 cm in front

of DE

Director 2 8.5 cm 5 cm in front of

D1

Director 3 8.5 cm 5 cm in front of

D2

Director 4 8.5 cm 5 cm in front of

D3

6. Plot the polar response at 1500 MHz.

7. Without disturbing the elements too much, remove the antenna from the Generator

Page 8: 15696_LMECE457 (2)

8 LMECE457

Tower.

8. Identify the Yagi Bay base assembly (the broad grey plastic strip with tapped

holes) and mount this centrally on the Generator Tower.

9. Mount the 6 element yagi onto the Yagi Bay base assembly at three holes from the

centre.

10. Assemble an identical 6 element yagi on the other Yagi Boom Assembly and

mount this on the Yagi Bay base assembly at three hole the other side of the

centre, ensuring that the two yagis are pointing in the same direction (towards the

Receiver Tower).

11. Identify the 2-Way Combiner and the two 183mm cables.

12. Connect the two 183mm cables to the adjacent connectors on the Combiner and

their other ends to the two 6 element yagis.

12. Connect the cable from the Generator Tower to the remaining connector on the

Combiner.

13. Acquire a new plot for the two bayed antennas onto the same graph as that for the

single 6 element yagi.

15. Reverse the driven element on one of the yagis and acquire a third plot

4. Required Results:

Parameters:

a) Does reversing the driven element make much difference to the polar

pattern for the two bayed yagis?

b) How does the directivity of the two bayed yagis compare with the single

yagi plot (with the driven element the correct way round)?

c) How does the forward gain of the two bayed yagis compare with the

single yagi plot (with the driven element the correct way round)? Now, move the two yagis to the outer sets of holes on the Yagi Bay base assembly.

Ensure that you keep the driven elements the same way round as you had before to

give the correct phasing.

Superimpose a plot for this assembly.

d) How do the directivity and forward gain of the wider spaced yagis

compare with the close spaced yagis?

Relationship: Yagi antennas may be used side-by-side, or one on top of another to

Give greater gain or directivity. This is referred to as baying, or

stacking the antennas, respectively.

5. Cautions:

a) Without disturbing the elements too much, remove the antenna from the

Generator Tower

6. Learning outcomes: to be written by the students in 50-70 words.

Page 9: 15696_LMECE457 (2)

9 LMECE457

(B) Stacking Two Yagis

3. Outline of the Procedure: 1. Identify the Yagi Stack base assembly (the narrow grey plastic strip with tapped holes)

and mount this on the side of the Generator Tower.

2. Mount the 6 element yagi onto the Yagi Stack base assembly at one set of holes above

the centre.

3. Plot the polar response at 1500 MHz.

4. Mount the other 6 element yagi on the Yagi Stack base assembly at the uppermost set of

holes, ensuring that the two yagis are pointing in the same direction (towards the

Receiver Tower)

5. Identify the 2-Way Combiner and the two 183mm coaxial cables.

6. Connect the two 183mm cables to the adjacent connectors on the Combiner and their

other ends to the two 6 element yagis.

7. Connect the cable from the Generator Tower to the remaining connector on the

Combiner.

8. Superimpose the polar plot for the two stacked antennas onto that for the single 6

element yagi.

9. Reverse the driven element on one of the yagis and superimpose a third plot.

10. Change the position of the lower yagi to the bottom set of holes on the Yagi Stack base

assembly. Ensure that the driven elements are correctly phased and superimpose a fourth

polar plot.

4. Required Results:

Parameters:

a) How does the directivity of the different configurations compare?

b) How does the forward gain of the stacked yagis compare with the single

yagi?

c) How does the forward gain of the stacked yagis change when the driven

element phasing is incorrect?

Relationship: Yagi antennas may be used side-by-side, or one on top of another to

Give greater gain or directivity. This is referred to as baying, or

stacking the antennas, respectively.

5.Cautions:

d) Without disturbing the elements too much, remove the antenna from the

Generator Tower

6.Learning outcomes: to be written by the students in 50-70 words.

Page 10: 15696_LMECE457 (2)

10 LMECE457

Experiment No. 4

1. Experiment: To study of TDM by the using Matlab/simulink

Equipment/Material required: Matlab software

2. Learning Objectives: I) To Implementation of Time Division Multiplexing system using Matlab/simulink

3. Outline of the Procedure: Matlab code for TDM:

% *********** Matlab code for Time Division Multiplexing ************* clc; close all; clear all; % Signal generation x=0:.5:4*pi; % siganal taken upto 4pi sig1=8*sin(x); % generate 1st sinusoidal signal l=length(sig1); sig2=8*triang(l); % Generate 2nd traingular Sigal % Display of Both Signal subplot(2,2,1); plot(sig1); title('Sinusoidal Signal'); ylabel('Amplitude--->'); xlabel('Time--->'); subplot(2,2,2); plot(sig2); title('Triangular Signal'); ylabel('Amplitude--->'); xlabel('Time--->'); % Display of Both Sampled Signal subplot(2,2,3); stem(sig1); title('Sampled Sinusoidal Signal'); ylabel('Amplitude--->'); xlabel('Time--->'); subplot(2,2,4); stem(sig2); title('Sampled Triangular Signal'); ylabel('Amplitude--->'); xlabel('Time--->'); l1=length(sig1); l2=length(sig2); for i=1:l1 sig(1,i)=sig1(i); % Making Both row vector to a matrix sig(2,i)=sig2(i); end % TDM of both quantize signal tdmsig=reshape(sig,1,2*l1); % Display of TDM Signal figure stem(tdmsig); title('TDM Signal'); ylabel('Amplitude--->'); xlabel('Time--->'); % Demultiplexing of TDM Signal demux=reshape(tdmsig,2,l1);

Page 11: 15696_LMECE457 (2)

11 LMECE457

for i=1:l1 sig3(i)=demux(1,i); % Converting The matrix into row vectors sig4(i)=demux(2,i); end % display of demultiplexed signal figure subplot(2,1,1) plot(sig3); title('Recovered Sinusoidal Signal'); ylabel('Amplitude--->'); xlabel('Time--->'); subplot(2,1,2) plot(sig4); title('Recovered Triangular Signal'); ylabel('Amplitude--->'); xlabel('Time--->');

4. Required Results:

0 10 20 30-10

-5

0

5

10Sinusoidal Signal

Am

plit

ude--

->

Time--->

0 10 20 300

2

4

6

8Triangular Signal

Am

plit

ude--

->

Time--->

0 10 20 30-10

-5

0

5

10Sampled Sinusoidal Signal

Am

plit

ude--

->

Time--->

0 10 20 300

2

4

6

8Sampled Triangular Signal

Am

plit

ude--

->

Time--->

Page 12: 15696_LMECE457 (2)

12 LMECE457

0 10 20 30 40 50 60-8

-6

-4

-2

0

2

4

6

8TDM Signal

Am

plit

ude--

->

Time--->

0 5 10 15 20 25 30-10

-5

0

5

10Recovered Sinusoidal Signal

Am

plit

ude--

->

Time--->

0 5 10 15 20 25 300

2

4

6

8Recovered Triangular Signal

Am

plit

ude--

->

Time--->

5. Learning outcomes: to be written by the students in 50-70 words.

Page 13: 15696_LMECE457 (2)

13 LMECE457

Experiment No. 5

1. Experiment: To study of pulse code modulation and demodulation using

Matlab/simulink Equipment/Material required: Matlab software

2. Learning Objectives: I) To Implementation of Time pulse code modulation and demodulation using

Matlab/simulink

3. Outline of the Procedure: Matlab code of PCM:

%********PCM************************************************** %the uniform quantization of an analog signal using L quantizaton levels% %****implemented by uniquan.m function of matlab %(uniquan.m) function [q_out,Delta,SQNR]=uniquan(sig_in,L) %usage % [q_out,Delta ,SQNR]=uniquan(sig_in,L) % L-number ofuniform quantization levels % sig_in-input signalvector % function output: % q_out-quantized output % Delta-quantization interval % SQNR- actual signal to quantization ratio sig_pmax=max(sig_in); % finding the +ve peak sig_nmax=min(sig_in); % finding the -ve peak Delta=(sig_pmax-sig_nmax)/L; % quantization interval q_level=sig_nmax+Delta/2:Delta:sig_pmax-Delta/2; %define Q-levels L_sig=length(sig_in); % find signal length sigp=(sig_in-sig_nmax)/Delta+1/2; % convert int to 1/2 to L+1/2 range qindex=round(sigp); % round to 1,2,.....L levels qindex=min(qindex,L); % eliminate L+1 as a rare possibility q_out=q_level(qindex); % use index vector to generate output SQNR=20*log10(norm(sig_in)/norm(sig_in-q_out)); % actual SQNR value end % sampandquant.m function executes both sampling and uniform quantization %sampandquant.m function [s_out,sq_out,sqh_out,Delta,SQNR]=sampandquant(sig_in,L,td,ts)

% usage % [s_out,sq_out,sqh_out,Delta,SQNR]=sampandquant(sig_in,L,td,ts) % L-no. of uniform quantization levels % sig_in-input signal vector % td-original signal sampling period of sig_in % ts- new sampling period % NOTE: td*fs must be +ve integef % function outputs: % s_out-sampled output % sq_out-sample and quantized output % sqh_out-sample, quantized and hold output % Delta- quantization interval % SQNR-actual signal to quantization ratio

if rem(ts/td,1)==0 nfac=round(ts/td); p_zoh=ones(1,nfac); s_out=downsample(sig_in,nfac); [sq_out,Delta,SQNR]=uniquan(s_out,L); s_out=upsample(s_out,nfac); sqh_out=upsample(sq_out,nfac);

Page 14: 15696_LMECE457 (2)

14 LMECE457

else warning('Error! ts/td is not an integer!'); s_out=[]; sq_out=[]; sqh_out=[]; Delta=[]; SQNR=[]; end end %********generation of PCM *****************************% clc; clear; clf; td=0.002; % original sampling rate rate 500 hz t=[0:td:1.]; %time interval of 1 sec xsig=sin(2*pi*t)-sin(6*pi*t); %n1hz +3 hz sinusoidals Lsig=length(xsig); Lfft=2^ceil(log2(Lsig)+1); Xsig=fftshift(fft(xsig,Lfft)); Fmax=1/(2*td); Faxis=linspace(-Fmax,Fmax,Lfft); ts=0.02; % new sampling rate =50 hz Nfact=ts/td; % send the signal through a 16-level uniform quantiser [s_out,sq_out,sqh_out1,Delta,SQRN]=sampandquant(xsig,16,td,ts); % obtaind the signal which is % - sampled,quantiser,and zero-order hold signal sqh_out % plot the original signal and PCM signal in time domain figrue(1); figure(1); subplot(211); sfig1=plot(t,xsig,'k',t,sqh_out1(1:Lsig),'b'); set(sfig1,'Linewidth',2); title('Signal {\it g}({{\it t}) and its 16 level PCM signal') xlabel('time(sec.)'); % send the signal through a 16-level unifrom quantiser [s_out,sq_out,sqh_out2,Delta,SQNR]=sampandquant(xsig,4,td,ts); % obtained the PCM signal which is % - sampled,quantiser,and zero_order hold signal sqh_out % plot the original signal and the PCM signal in time domain subplot(212); sfig2=plot(t,xsig,'k',t,sqh_out2(1:Lsig),'b'); set(sfig2,'Linewidth',2); title('Signal {\it g}({\it t}) and its 4 level PCM signal') xlabel('time(sec.)'); Lfft=2^ceil(log2(Lsig)+1); Fmax=1/(2*td); Faxis=linspace(-Fmax,Fmax,Lfft); SQH1=fftshift(fft(sqh_out1,Lfft)); SQH2=fftshift(fft(sqh_out2,Lfft)); % Now use LPF to filter the two PCM signal BW=10; %Bandwidth is no larger than 10Hz. H_lpf=zeros(1,Lfft);H_lpf(Lfft/2-BW:Lfft/2+BW-1)=1; %ideal LPF S1_recv=SQH1.*H_lpf; s_recv1=real(ifft(fftshift(S1_recv))); s_recv1=s_recv1(1:Lsig); S2_recv=SQH2.*H_lpf; s_recv2=real(ifft(fftshift(S2_recv))); s_recv2=s_recv2(1:Lsig);

Page 15: 15696_LMECE457 (2)

15 LMECE457

% plot the filtered signal against the original signal figure(2); subplot(211); sfig3=plot(t,xsig,'b-',t,s_recv1,'b-.'); legend('original','recovered') set(sfig3,'Linewidth',2); title('signal{\it g}({it t}) and filtered 16-level PCM signal') xlabel('time(sec.)'); subplot(212); sfig4=plot(t,xsig,'b-',t,s_recv2(1:Lsig),'b'); legend('original','recovered') set(sfig1,'Linewidth',2); title('signal{\it g}({it t}) and filtered 4-level PCM signal') xlabel('time(sec.)');

4. Required Results:

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-2

-1

0

1

2Signal {\it g}({{\it t}) and its 16 level PCM signal

time(sec.)

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-2

-1

0

1

2Signal g( t) and its 4 level PCM signal

time(sec.)

Page 16: 15696_LMECE457 (2)

16 LMECE457

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-2

-1

0

1

2

time(sec.)

signal g(it t) and filtered 16-level PCM signal

original

recovered

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-2

-1

0

1

2

time(sec.)

signal g(it t) and filtered 4-level PCM signal

original

recovered

5. Learning outcomes: to be written by the students in 50-70 words.

Page 17: 15696_LMECE457 (2)

17 LMECE457

Experiment No. 6 1. Experiment: To study of delta modulation and demodulation and observe effect of

slope Overload using matlab/simulink

Equipment/Material required: Matlab software

2. Learning Objectives: I) To Implementation of delta modulation and demodulation and observe effect of

slope Overload using matlab/simulink

3. Outline of the Procedure: Mtalb Code: % *** Function for Delta Modulation*********** % (deltamod.m) function s_DMout=deltamod(sig_in,Delta,td,ts) % usage % s_DMout=deltamod(xsig,Delta,td,ts) % Delta-step size % sig_in-input signal vector % td-original signal sampling period of sig_in % NOTE: td*fs must be a positive integer; % S_DMout -DM sampled output % ts-new sampling period if (rem(ts/td,1)==0) nfac=round(ts/td); p_zoh=ones(1,nfac); s_down=downsample(sig_in,nfac); Num_it=length(s_down); s_DMout(1)=Delta/2; for k=2:Num_it xvar=s_DMout(k-1); s_DMout(k)=xvar+Delta*sign(s_down(k-1)-xvar); end s_DMout=kron(s_DMout,p_zoh); else warning('Error! ts/t is not an integer!'); s_DMout=[]; end end %********Delta Modulation **********************************% % togenerate DM signals with different step sizes, % Delta1=0.2,Delta2=Delta1,Delta3=Delta4 clc; clear; clf; td=0.002; % original sampling rate rate 500 hz t=[0:td:1.]; % time interval of 1 sec xsig=sin(2*pi*t)-sin(6*pi*t); % 1hz +3 hz sinusoidals Lsig=length(xsig); ts=0.02; % new sampling rate =50 hz Nfact=ts/td; % send the signal through a 16-level uniform quantiser Delta1=0.2; s_DMout1=deltamod(xsig,Delta1,td,ts); % obtaind the DM signal % plot the original signal and DM signal in time domain figrue(1); figure(1); subplot(311); sfig1=plot(t,xsig,'k',t,s_DMout1(1:Lsig),'b'); set(sfig1,'Linewidth',2);

Page 18: 15696_LMECE457 (2)

18 LMECE457

title('Signal {\it g}({{\it t}) and its DM signal') xlabel('time(sec.)'); axis([0 1 -2.2 2.2]); % Apply DM again by doubling the Delta Delta2=2*Delta1; s_DMout2=deltamod(xsig,Delta2,td,ts); subplot(312); sfig2=plot(t,xsig,'k',t,s_DMout2(1:Lsig),'b'); set(sfig2,'Linewidth',2); title('Signal {\it g}({\it t}) and DM signal with doubled stepsize') xlabel('time(sec.)'); axis([0 1 -2.2 2.2]); %*********** Delta3=2*Delta2; s_DMout3=deltamod(xsig,Delta3,td,ts); subplot(313); sfig3=plot(t,xsig,'k',t,s_DMout3(1:Lsig),'b'); set(sfig3,'Linewidth',2); title('Signal {\it g}({\it t}) and DM signal with quadrupled stepsize') xlabel('time(sec.)'); axis([0 1 -2.2 2.2]);

4. Required Results:

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

-2

-1

0

1

2

Signal {\it g}({{\it t}) and its DM signal

time(sec.)

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

-2

-1

0

1

2

Signal g( t) and DM signal with doubled stepsize

time(sec.)

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

-2

-1

0

1

2

Signal g( t) and DM signal with quadrupled stepsize

time(sec.)

5. Learning outcomes: to be written by the students in 50-70 words.

Page 19: 15696_LMECE457 (2)

19 LMECE457

Experiment No. 7 1. Experiment: To study of pulse data coding techniques for various formats using

matlab/simulink

Equipment/Material required: Matlab software

2. Learning Objectives: I) Implementation of pulse data coding techniques for various formats using

matlab/simulink.

3. Outline of the Procedure: Matlab code: function [U P B M S]=nrz(a) % 'a' is input data sequence % U = Unipolar, P=Polar, B=Bipolar, M=Mark and S=Space %Wave formatting %Unipolar a=[1 0 0 1 1]; U=a; n= length(a); %POLAR P=a; for k=1:n; if a(k)==0 P(k)=-1; end end %Bipolar B=a; f = -1; for k=1:n; if B(k)==1; if f==-1; B(k)=1; f=1; else B(k)=-1; f=-1; end end end

%Mark M(1)=1; for k=1:n; M(k+1)=xor(M(k), a(k)); end

%Space S(1)=1; for k=1:n S(k+1)=not(xor(S(k), a(k))); end %Plotting Waves subplot(5, 1, 1); stairs(U) axis([1 n+2 -2 2]) title('Unipolar NRZ') grid on subplot(5, 1, 2); stairs(P) axis([1 n+2 -2 2]) title('Polar NRZ')

Page 20: 15696_LMECE457 (2)

20 LMECE457

grid on subplot(5, 1, 3); stairs(B) axis([1 n+2 -2 2]) title('Bipolar NRZ') grid on subplot(5, 1, 4); stairs(M) axis([1 n+2 -2 2]) title('NRZ-Mark') grid on subplot(5, 1, 5); stairs(S) axis([1 n+2 -2 2]) title('NRZ-Space') grid on

4. Required Results:

1 2 3 4 5 6 7-2

0

2Unipolar NRZ

1 2 3 4 5 6 7-2

0

2Polar NRZ

1 2 3 4 5 6 7-2

0

2Bipolar NRZ

1 2 3 4 5 6 7-2

0

2NRZ-Mark

1 2 3 4 5 6 7-2

0

2NRZ-Space

5. Learning outcomes: to be written by the students in 50-70 words.

Page 21: 15696_LMECE457 (2)

21 LMECE457

Experiment No. 8 1. Experiment: To study of Data decoding techniques for various formats using

matlab/simulink Equipment/Material required: Matlab software

2. Learning Objectives: I) Implementation of Data decoding techniques for various formats using

matlab/simulink

3. Outline of the Procedure: Matlab Code: function [Ur,Pr,Br,Mr,Sr]=nrzRx(U,P,B,M,S) % 'a' is input data sequence % U = Unipolar, P=Polar, B=Bipolar, M=Mark and S=Space %Wave formatting %Unipolar U=[1 0 0 1 1] P=[1 -1 -1 1 1] B=[1 0 0 -1 1] M=[1 0 0 0 1 0] S=[1 1 0 1 1 1] Ur=U; n= length(P); %POLAR Pr=P; l=find(Pr<0); Pr(l)=0

%Bipolar n= length(B); Br=B; l=find(Br<0); Br(l)=1;

%Mark n= length(M); for k=1:n-1; Mr(k)=xor(M(k), M(k+1)); end

%Space n= length(S); S(1)=1; for k=1:n-1 Sr(k)=not(xor(S(k), S(k+1))); end %Plotting Waves n= length(Ur); subplot(5, 1, 1); stairs(Ur) axis([1 n+2 -2 2]) title('Unipolar NRZ Decoded') grid on n= length(P); subplot(5, 1, 2); stairs(P) axis([1 n+2 -2 2]) title('Polar NRZ Decoded') grid on n= length(Br); subplot(5, 1, 3); stairs(B) axis([1 n+2 -2 2]) title('Bipolar NRZ Decoded')

Page 22: 15696_LMECE457 (2)

22 LMECE457

grid on n= length(Mr); subplot(5, 1, 4); stairs(M) axis([1 n+2 -2 2]) title('NRZ-Mark Decoded') grid on n= length(Sr); subplot(5, 1, 5); stairs(S) axis([1 n+2 -2 2]) title('NRZ-Space Decoded') grid on

4 Required Results:

Input

1 2 3 4 5 6 7-2

0

2Unipolar NRZ Decoded

1 2 3 4 5 6 7-2

0

2Polar NRZ Decoded

1 2 3 4 5 6 7-2

0

2Bipolar NRZ Decoded

1 2 3 4 5 6 7-2

0

2NRZ-Mark Decoded

1 2 3 4 5 6 7-2

0

2NRZ-Space Decoded

U =

1 0 0 1 1

P =

1 -1 -1 1 1

B =

1 0 0 -1 1

M =

Page 23: 15696_LMECE457 (2)

23 LMECE457

1 0 0 0 1 0

S =

1 1 0 1 1 1

Pr =

1 0 0 1 1

Output

ans =

1 0 0 1 1

5 Learning outcomes: to be written by the students in 50-70 words.

Page 24: 15696_LMECE457 (2)

24 LMECE457

Experiment No. 9 1. Experiment: To study of amplitude shift keying modulator and demodulator using

matlab/simulink.

Equipment/Material required: Matlab software

2. Learning Objectives: I) Implementation of amplitude shift keying modulator and demodulator using

matlab/simulink.

3. Outline of the Procedure: Matlab Code : % program for amplitude shift keying % clc; clear all; close all; s= [1 0 1 0]; f1=20; a=length (s); for i=1:a f=f1*s (1,i); for t=(i-1)*100+1:i*100 x(t)=sin(2*pi*f*t/1000); end end plot(x); xlabel('time in secs'); ylabel('amplitude in volts'); title('ASK') grid on;

4. Required Results:

0 50 100 150 200 250 300 350 400-1

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

time in secs

ampl

itude

in v

olts

ASK

5. Learning outcomes: to be written by the students in 50-70 words.

Page 25: 15696_LMECE457 (2)

25 LMECE457

Experiment No. 10

1. Experiment: To study of frequency shift keying modulator and demodulator using matlab/simulink.

Equipment/Material required: Matlab software

2. Learning Objectives: I) Implementation of frequency shift keying modulator and demodulator using

matlab/simulink.

3. Outline of the Procedure: Matlab Code: %*********FSK**************% clc; clear all; close all; s= [1 0 1 0]; f1=10; f2=50; a=length (s); for i=1:a if s(1,i)==1 freq=f1*s(1,i); for t= (i-1)*100+1:i*100 x(t)= sin(2*pi*freq*t/1000); end elseif s(1,i)==0 b=(2*s(1,i))+1; freq=f2*b; for t=(i-1)*100+1:i*100 x(t)= sin(2*pi*freq*t/1000); end end end plot(x); xlabel('title in secs'); ylabel('amplitude in volts') title ('FSK') grid on;

4. Required Results:

0 50 100 150 200 250 300 350 400-1

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

title in secs

amplit

ude in

volts

FSK

5. Learning outcomes: to be written by the students in 50-70 words

Page 26: 15696_LMECE457 (2)

26 LMECE457

Experiment No. 11

1. Experiment: To study of phase shift keying modulator and demodulator using matlab/simulink.

Equipment/Material required: Matlab software

2. Learning Objectives: I) Implementation of phase shift keying modulator and demodulator using

matlab/simulink.

3. Outline of the Procedure: Matlab Code: clc; clear all; close all; s= [1 0 1 0]; f1=10; a=length (s); for i=1:a if s(1,i)==1 freq=f1*s(1,i); for t= (i-1)*100+1:i*100 x(t)= sin(2*pi*freq*t/1000); end elseif s(1,i)==0 b=(2*s(1,i))+1; freq=f1*b; for t=(i-1)*100+1:i*100 x(t)= sin((2*pi*freq*t/1000)+pi); end end end plot(x); xlabel('title in secs'); ylabel('amplitude in volts') title ('PSK') grid on

4. Required Results:

0 50 100 150 200 250 300 350 400-1

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

title in secs

ampl

itude

in v

olts

PSK

5. Learning outcomes: to be written by the students in 50-70 words