SHARE
TWEET

Untitled

bl4desofglory Nov 19th, 2019 97 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. % 21.11.2019
  2. % 165678 Tomasz Kisielewski
  3. % Zadanie 5 Modelowanie odpowiedzi impulsowej kanalu dla srodowiska miejskiego
  4. % Komputer
  5.  
  6. Ts = 6 * 10^(-8);
  7. TU50 = [0,    -5.7;
  8.     21.7e-8,  -7.6;
  9.     51.2e-8,  -10.1;
  10.     51.4e-8,  -10.2;
  11.     51.7e-8,  -10.2;
  12.     67.4e-8,  -11.5;
  13.     88.2e-8,  -13.4;
  14.     123.0e-8, -16.3;
  15.     128.7e-8, -16.9;
  16.     131.1e-8, -17.1;
  17.     134.9e-8, -17.4
  18.     153.3e-8, -19;
  19.     153.5e-8, -19;
  20.     162.2e-8, -19.8;
  21.     181.8e-8, -21.5;
  22.     183.6e-8, -21.6;
  23.     188.4e-8, -22.1;
  24.     194.3e-8, -22.6;
  25.     204.8e-8, -23.5;
  26.     214.0e-8, -24.3];
  27. j = 1;
  28.  
  29. samples = zeros(length(TU50), 2);
  30. for i=0:Ts:TU50(length(TU50), 1)+Ts
  31.     samples(j, 1) = i;
  32.     samples(j, 2) = 0;
  33.     j = j + 1;
  34. end
  35.  
  36. for i=1:1:length(TU50)
  37.     TU50(i,2) = 10^(TU50(i,2)/20);
  38. end
  39.  
  40. figure
  41. stem(TU50(:,1),TU50(:,2),'filled');
  42. title('Przed przeprobkowaniem');
  43.  
  44. samples(1,2) = TU50(1,2);
  45. for n=2:1:length(TU50)
  46.     for m=2:1:length(samples)-1
  47.         if(samples(m,1) >= (TU50(n,1) - Ts))
  48.             delta = TU50(n,1) - samples(m,1);
  49.             samples(m,2) = samples(m,2) + TU50(n,2)*(delta/Ts);
  50.             samples(m+1,2) = samples(m+1,2) + TU50(n,2)*(Ts-delta)/Ts;
  51.             break;
  52.         end
  53.     end
  54. end
  55.  
  56. figure
  57. stem(samples(:,1),samples(:,2),'filled');
  58. title('Po przeprobkowaniu');
  59.  
  60. rayleigh = zeros(1,2*length(TU50));
  61. response = zeros(1,length(TU50));
  62. normal_dist = randn(1,4*length(TU50));
  63. j = 1;
  64. for i=1:2:80
  65.     rayleigh(1,j) = sqrt(normal_dist(1, i)^2 + normal_dist(1,i+1)^2);
  66.     j = j+1;
  67. end
  68.  
  69. for i=1:1:length(samples)
  70.     response(1,i) = rayleigh(1,i) * samples(i,2);
  71. end
  72.  
  73. figure
  74. stem(samples(:,1),response,'filled');
  75. title('Przemnonenie');
  76.  
  77. before = 0;
  78. for i=1:1:length(TU50)
  79.     before = before + TU50(i,2);
  80. end
  81.  
  82. after = 0;
  83. for i=1:1:length(samples)
  84.     after = after + samples(i,2);
  85. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top