Advertisement
stiansjogren

lab3 radio

May 20th, 2016
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 1.15 KB | None | 0 0
  1. close all
  2.  
  3.  
  4.  
  5. T_S = 1/(7.68e6);
  6. omega_max = 300;
  7. nb_samples = 10e-3 * 7.68e6;
  8.  
  9.  
  10.  
  11. rayChanObj = rayleighchan(T_S, omega_max, 0, 0) ;
  12. rayChanObj.StoreHistory = 1;
  13. x = ones(nb_samples,1);
  14. y = filter(rayChanObj,x);
  15. g = rayChanObj.PathGains;
  16.  
  17. [acf_sos,lag_sos] = xcorr(sumofsinusoids((1/(7.68e6)), 20, 300,nb_samples));
  18. [acf_flt,lag_flt] = xcorr(y);
  19.  
  20. % subplot(1,3,1)
  21. % plot(lag_sos,acf_sos/max(acf_sos));
  22. % subplot(1,3,2)
  23. % plot(lag_flt,acf_flt/max(acf_flt));
  24. % chlen = -0.01:T_S:0.01;
  25. % subplot(1,3,3)
  26. % plot(linspace(-76799,76799,length(besselj(0, 2*pi*300*chlen))),besselj(0, 2*pi*300*chlen));
  27.  
  28.  
  29.  
  30.  
  31. % Problem 2
  32.  
  33. % Generate foure independent fading channels
  34.  
  35. a = [0 0.3 0.9]; b = [0 0.9 0.9];
  36. G = zeros(2,2,nb_samples);
  37. tmp = sumofsinusoids((1/(7.68e6)), 20, 300,nb_samples);
  38.  
  39. for k=1:2
  40.     for j=1:2
  41.         for i= 1:length(sumofsinusoids((1/(7.68e6)), 20, 300,nb_samples))
  42.             G(k,j,i) = tmp(i);
  43.         end
  44.         tmp = sumofsinusoids((1/(7.68e6)), 20, 300,nb_samples);
  45.     end
  46. end
  47.  
  48.  
  49.  %Rtx= [1 a(j); conj(a(j)) 1] ; Rrx = [1 b(j); conj(b) 1];
  50. for j =1:1
  51.    
  52.     H = sqrtm(Rrx).*G.*transpose(sqrtm(Rtx));
  53. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement