20
Programming Assignment presentation By AbdulRahman AlKhayyat Muhammad Felimban

Programming Assignment presentation By AbdulRahman AlKhayyat Muhammad Felimban

  • View
    213

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Programming Assignment presentation By AbdulRahman AlKhayyat Muhammad Felimban

Programming Assignment presentation

ByAbdulRahman AlKhayyat

Muhammad Felimban

Page 2: Programming Assignment presentation By AbdulRahman AlKhayyat Muhammad Felimban

Encoding Techniques

• NRZL

• NRZL

• AMI

• PSEUDO

• MANCH

• DIFMANCH

Page 3: Programming Assignment presentation By AbdulRahman AlKhayyat Muhammad Felimban

NRZL - NRZI

• NRZL :0 ‘+’ pulse1 ‘-’ pulse

• NRZI :0 same pulse1 change pulse

Page 4: Programming Assignment presentation By AbdulRahman AlKhayyat Muhammad Felimban

AMI - PSEUDO

• AMI :0 0 pulse1 alternate ‘+’ & ‘-’

• PSEUDO :0 alternate ‘+’ & ‘-’

• 1 0 pulse

Page 5: Programming Assignment presentation By AbdulRahman AlKhayyat Muhammad Felimban

MANCH - DIFMANCH

• MANCH :0 ‘+’ to ‘-’1 ‘-’ to ‘+’

• DIFMANCH :0 ‘+’ to ‘-’ with last pulse ‘-’1 ‘-’ to ‘+’ with last pulse ‘-’

• 0 ‘-’ to ‘+’ with last pulse ‘+’ 1 ‘+’ to ‘-’ with last pulse ‘+’

Page 6: Programming Assignment presentation By AbdulRahman AlKhayyat Muhammad Felimban

Programming Tool

MATLAB for 1st time :

- Matrix Laboratory

- Powerful with matrixoperations

- Ability of graphical representation

Page 7: Programming Assignment presentation By AbdulRahman AlKhayyat Muhammad Felimban

MATLAB Interface

Page 8: Programming Assignment presentation By AbdulRahman AlKhayyat Muhammad Felimban

MATLAB tools

Code Editor

Page 9: Programming Assignment presentation By AbdulRahman AlKhayyat Muhammad Felimban

MATLAB tools

• Algorithm and development• Math and computation• Data acquisition• Modeling and simulating• Data analysis• Scientific and engineering graphics• Application development

Library contains :

Page 10: Programming Assignment presentation By AbdulRahman AlKhayyat Muhammad Felimban

program codes

Page 11: Programming Assignment presentation By AbdulRahman AlKhayyat Muhammad Felimban

program codes

• Get the binary bits from a file

• Encode by proper encoding scheme

• NRZL,NRZI, AMI and PSEUDO :straight forward representing of 0 or pulse, with a consideration of last pulse

Page 12: Programming Assignment presentation By AbdulRahman AlKhayyat Muhammad Felimban

program codes

• For MANCH and DIFMANCH, more techniques are used

• Saving every bit as a 2-bits (01 or 10) in a new file, depending on the last pulse

• Then read from the new file, and simply represent the data as before in previous schemes

Page 13: Programming Assignment presentation By AbdulRahman AlKhayyat Muhammad Felimban

program codes

• Before drawing the bits, we need to divide the Tb by 2 to make every 2-bits represent one bit in our graph

Need more explain ?

Page 14: Programming Assignment presentation By AbdulRahman AlKhayyat Muhammad Felimban

More explain

Page 15: Programming Assignment presentation By AbdulRahman AlKhayyat Muhammad Felimban

Graphing concepts

• We are making 2 arrays, one for the time and one for the value representing the bit

• Then by making a loop to take the values of every bit and storing it in the values array, and so on with the time array

Page 16: Programming Assignment presentation By AbdulRahman AlKhayyat Muhammad Felimban

Generating the graphs

For NRZL :

clear allload here.txtx = here;InputSize = length(x);

Page 17: Programming Assignment presentation By AbdulRahman AlKhayyat Muhammad Felimban

Generating the graphs

% Generating the NRZL : t=[];u=[];periode= 1; for i = 1 : InputSize tt = (i-1)*periode:1: (i)*periode; if x(i) == 1 uu= zeros(size(tt)); else uu = ones(size(tt)); end t=[t tt]; u=[u uu]; end

plot(t,u), axis([0 length(x) -2 2])gridxlabel('t(s)')ylabel('u(t)')title('NRZL')

Page 18: Programming Assignment presentation By AbdulRahman AlKhayyat Muhammad Felimban

MANCH GRAPH

For MANCH:

clear allload here.txtx = here;InputSize = length(x) ;

Page 19: Programming Assignment presentation By AbdulRahman AlKhayyat Muhammad Felimban

MANCH GRAPH %Generating the MANCH:

counter = 1;

for i = 1 : InputSize if x(i) == 1

y(counter) = '1;' fid = fopen('MANCH.txt','w');

fprintf(fid,'%c \n',y); fclose(fid)

y(counter+1) = '0;' fid = fopen('MANCH.txt','w');

fprintf(fid,'%c \n',y); counter = counter + 2;

else y(counter) = '0;'

fid = fopen('MANCH.txt','w'); fprintf(fid,'%c \n',y);

fclose(fid) y(counter+1) = '1;'

fid = fopen('MANCH.txt','w'); fprintf(fid,'%c \n',y);

counter = counter + 2; end

fclose(fid)end

clear allload MANCH.txtx = MANCH;InputSize = length(x);

t=[];u;[]=

periode= 1; for i = 1 : InputSize

tt = (i-1)*periode:1: (i)*periode; if x(i) == 1

uu = zeros(size(tt)); else

uu = ones(size(tt)); end

t=[t tt]; u=[u uu];

end plot(t/2,u), axis([0 length(x)/2 -2 2])gridxlabel('t(s)')ylabel('u(t)')title('MANCH')

Page 20: Programming Assignment presentation By AbdulRahman AlKhayyat Muhammad Felimban

Hope you enjoy our

programmingAlKhyyat & Filemban