Advertisement
makispaiktis

Mixer RF=600MHz and LO=800MHz

Nov 22nd, 2021 (edited)
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 1.17 KB | None | 0 0
  1. clear all
  2. clc
  3.  
  4. RF = 600;
  5. LO = 800;
  6. RF_half = RF / 2;
  7. startpoint = 0;
  8. endpoint = 2000;
  9. step = 10;
  10. LEN = (endpoint - startpoint)/step + 1;
  11. value1 = -20;
  12. value2 = -30;
  13. value3 = -35;
  14. value3 = -50;
  15. value4 = -60;
  16. value5 = -65;
  17. noise = -100;
  18. counter = 0;
  19. fList = zeros(1, LEN);
  20. dBList = zeros(1, LEN);
  21. for f = startpoint : step : endpoint
  22.     counter = counter + 1;
  23.     fList(counter) = f;
  24.     if f == abs(LO-RF) || f == abs(LO+RF)
  25.         dbList(counter) = value1;
  26.     elseif f == RF || f == LO
  27.         dBList(counter) = value2;
  28.     elseif f == RF_half
  29.         dBList(counter) = value3;
  30.     elseif f == abs(2*RF-LO) || f == abs(3*RF-2*LO) || f == abs(4*RF-3*LO) || f == abs(2*LO-RF) || f == abs(3*LO-2*RF) || f == abs(4*LO-3*RF) || f == abs(2*RF+LO) || f == abs(2*LO+RF) || f == abs(3*RF+2*LO) || f == abs(3*LO+2*RF)
  31.         dBList(counter) = value4;
  32.     elseif f == abs(LO-RF_half) || f == LO+RF_half || f == abs(2*LO+RF_half) || f == abs(3*LO-2*RF_half)
  33.         dBList(counter) = value5;
  34.     else
  35.         dBList(counter) = randi([noise-3, noise+3]);  
  36.     end
  37. end
  38.  
  39. plot(fList, dBList);
  40. title('Mixer: RF=600MHz and LO=800MHz');
  41. xlabel('f (MHz)');
  42. ylabel('dBm Level')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement