Md Nasfik

258 views

Published on

c

Published in: Business, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
258
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Md Nasfik

  1. 1. Part 1: tinc = 1/10000; tend = 1; t = -1:tinc:tend; tp = tripuls(t,20e-3); rp = rectpuls(t,20e-3); subplot(211),plot(t,tp), axis([-0.1 0.1 -0.2 1.2]) xlabel('Time (sec)');('Amplitude'); title('Triangular Pulse') subplot(212),plot(t,rp), axis([-0.1 0.1 -0.2 1.2]) xlabel('Time (sec)');ylabel('Amplitude'); title('Rectangular Pulse') Part 2: % auto correlation clc; close all; clear all; x = [1,2,3,4,5,6,7,8,9,10]; y = [4,1,5,2,6,8,10,9,7]; subplot(3,1,1); stem(x); xlabel('n'); ylabel('x(n)'); title('signal'); subplot(3,1,2); stem(y); xlabel('n'); ylabel('y(n)'); title('signal input'); m=xcorr(x,x); subplot(3,1,3); stem(m); xlabel('n'); ylabel('m(n)'); title('resultant signal');
  2. 2. Part 3: clc; time =0:0.01:5; Te=0.1; y3=1*rectpuls(t-Te/2-0,Te); y2=1*rectpuls(t-Te/2-DelayDifferenceBC,Te); y1=1*rectpuls(t-Te/2-DelayDifferenceAC,Te); figure(1) subplot(411);plot(time,y3); subplot(412);plot(time,y2); subplot(413);plot(time,y1);
  3. 3. yREf=y3; r3REf=xcorr(yREf,yc); r2REf=xcorr(yREf,yb); r1REf=xcorr(yREf,ya); figure(2) subplot(411);plot(r3REf); subplot(412);plot(r2REf); subplot(413);plot(r1REf); r3=find(r3REf==max(r3REf)); r2=find(r2REf==max(r2REf)); r1=find(r1REf==max(r1REf)); r3; r2; r1; r3 = 401 r2 = 380 r1 = 339 [DelayDifferenceABreceiver]=ginput(2); edit DelayDifferenceABreceiver [4.508506616257089e+02,0.017241379310342;4.689981096408316e+02,-0.034722222222226] [DelayDifferenceACreceiver]=ginput(2); edit DelayDifferenceACreceiver [4.497164461247637e+02,0.017241379310342;4.905482041587900e+02,-0.034722222222224]
  4. 4. D3= awgn(r3REf,0); D2= awgn(r2REf,0); D1= awgn(r1REf,0); figure(3) subplot(411);plot(D3); subplot(412);plot(D2); subplot(413);plot(D1); Results: r3 =401 r2 =380 r1 =339 ans =450.8507 0.0172 468.9981 -0.0347

×