Advertisement
makispaiktis

Phased Arrays - PS vs MVDR vs LCMV

Jan 6th, 2023 (edited)
1,913
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 5.12 KB | None | 0 0
  1. clear all
  2. close all
  3. clc
  4.  
  5. %% Data
  6. % Baseband Signal
  7. t = [0 :0.001 : 0.3];
  8. s = zeros(size(t));
  9. s = s(:);                          
  10. s(201:205) = 1;                  % Row vector ---> Column vector
  11. figure('Name', 'Baseband Signal');
  12. plot(t, s);
  13. title('Pulse');    xlabel('Time (s)');    ylabel('Amplitude (V)');
  14.  
  15. % Carrier
  16. fc = 100e6;
  17. c = 3e8;
  18. lambda = c / fc;
  19.  
  20. % Array
  21. ula = phased.ULA('NumElements', 10,'ElementSpacing', lambda/2);
  22. ula.Element.FrequencyRange = [10e6 110e6];
  23. inputAngle = [45; 0];
  24. x = collectPlaneWave(ula, s, inputAngle, fc, c);
  25.  
  26. % Noise is 3 dB lower (signal has power = 1, so noise will be at 0.5)
  27. rs = RandStream.create('mt19937ar','Seed',2008);
  28. P_noise = 0.5;
  29. noise = sqrt(P_noise/2)*randn(rs,size(x)) * (1+1i);
  30. rxSignal = x + noise;           % It has 10 columns for 10 elements
  31.  
  32. % Plots of data
  33. figure('Name', 'Received signals in 2 first elements');
  34. subplot(2, 1, 1);
  35. plot(t, abs(rxSignal(:, 1)));
  36. axis tight;
  37. title('Pulse at Antenna 1');
  38. xlabel('Time (s)');
  39. ylabel('Magnitude (V)');
  40. subplot(2, 1, 2);
  41. plot(t, abs(rxSignal(:, 2)));
  42. axis tight;
  43. title('Pulse at Antenna 2');
  44. xlabel('Time (s)');
  45. ylabel('Magnitude (V)');
  46.  
  47.  
  48. %% 1) CONVENTIONAL BEAMFORMERS
  49.  
  50. %% 1a) Phase Shifts Beamformer
  51. psbeamformer = phased.PhaseShiftBeamformer('SensorArray', ula,...
  52.     'OperatingFrequency', fc ,'Direction', inputAngle, ...
  53.     'WeightsOutputPort', true);
  54.  
  55. [yCbf, w] = psbeamformer(rxSignal);
  56. figure('Name', 'AF of PS Beamformer');
  57. pattern(ula, fc, -180:180, 0, 'Weights', w, 'Type','powerdb', ...
  58.     'PropagationSpeed', c, 'Normalize', false,...
  59.     'CoordinateSystem','rectangular');
  60. axis([-90 90 -60 0]);
  61.  
  62. figure('Name', 'Output of PS Beamformer (only with noise)');
  63. plot(t,abs(yCbf)); axis tight;
  64. title('Output of Phase Shift Beamformer');
  65. xlabel('Time (s)');ylabel('Magnitude (V)');
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  %% 2) ADAPTIVE BEAMFORMERS
  72.  
  73. % Create 2 interfernces with a 10x amplitude in 30 and 50 degrees
  74. N = length(t);
  75. s1 = 10*randn(rs, N, 1);
  76. s2 = 10*randn(rs, N, 1);
  77. interference = collectPlaneWave(ula, [s1 s2], [25 50; 0 0], fc, c);
  78.  
  79. % Noise at minimal level with SNR = 50 dB
  80. P_noise = 10^(-5);
  81. noise = sqrt(P_noise/2)*randn(rs, size(x)) * (1+1i);
  82. rxInt = interference + noise;        % Total interference + noise
  83. rxSignal = x + rxInt;                % Total received Signal
  84.  
  85. % Failure of PS Beamformer
  86. [yCbf, w] = psbeamformer(rxSignal);
  87. figure('Name', 'Failed output of PS Beamformer in presence with interfernce');
  88. plot(t,abs(yCbf)); axis tight;
  89. title('Failed output of Phase Shift Beamformer');
  90. xlabel('Time (s)');ylabel('Magnitude (V)');
  91.  
  92. %% 2a) MVDR
  93. mvdrbeamformer = phased.MVDRBeamformer('SensorArray', ula, ...
  94.     'Direction', inputAngle, 'OperatingFrequency', fc,...
  95.     'WeightsOutputPort', true);
  96.  
  97. % Train in it 2 cases
  98. mvdrbeamformer.TrainingInputPort = true;
  99. [yMVDR, wMVDR] = mvdrbeamformer(rxSignal, rxInt);
  100.  
  101. figure('Name', 'Output of MVDR Beamformer With Presence of Interference');
  102. plot(t, abs(yMVDR)); axis tight;
  103. title('Output of MVDR Beamformer (noise + interference)');
  104. xlabel('Time (s)');ylabel('Magnitude (V)');
  105.  
  106. figure('Name', 'AF of MVDR Beamformer');
  107. pattern(ula, fc, -90:90, 0, 'Weights', wMVDR, 'Type','powerdb', ...
  108.     'PropagationSpeed', c, 'Normalize', false,...
  109.     'CoordinateSystem','rectangular');
  110.  
  111.  
  112. figure('Name', 'MVDR vs PS');
  113. pattern(ula, fc, -180:180, 0, 'Weights', wMVDR, 'Type', 'powerdb', ...
  114.     'PropagationSpeed', c, 'Normalize', false, ...
  115.     'CoordinateSystem', 'rectangular');
  116. axis([-90 90 -80 20]);
  117. hold on
  118. pattern(ula, fc, -180:180, 0, 'Weights', w, ...
  119.     'PropagationSpeed', c, 'Normalize', false,...
  120.     'Type', 'powerdb', 'CoordinateSystem', 'rectangular');
  121. hold off;
  122. legend('MVDR','PhaseShift');
  123.  
  124.  
  125.  
  126.  
  127.  
  128. %% Self-nulling Issue
  129. mvdrbeamformer_selfnull = phased.MVDRBeamformer('SensorArray',ula,...
  130.     'Direction',inputAngle,'OperatingFrequency',fc,...
  131.     'WeightsOutputPort',true,'TrainingInputPort',false);
  132.  
  133. expDir = [43; 0];
  134. mvdrbeamformer_selfnull.Direction = expDir;
  135.  
  136. [ySn, wSn] = mvdrbeamformer_selfnull(rxSignal);
  137. plot(t,abs(ySn)); axis tight;
  138. title('Output of MVDR Beamformer With Signal Direction Mismatch');
  139. xlabel('Time (s)');ylabel('Magnitude (V)');
  140.  
  141.  
  142. %% 2c) LCMV Beamformer
  143. lcmvbeamformer = phased.LCMVBeamformer('WeightsOutputPort', true);
  144. steeringvec = phased.SteeringVector('SensorArray', ula);
  145. stv = steeringvec(fc, [43 41 45]);
  146. lcmvbeamformer.Constraint = stv;
  147. lcmvbeamformer.DesiredResponse = [1; 1; 1];
  148.  
  149. [yLCMV, wLCMV] = lcmvbeamformer(rxSignal);
  150. figure('Name', 'Array response of LCMV Beamformer');
  151. plot(t,abs(yLCMV)); axis tight;
  152. title('Output of LCMV Beamformer With Signal Direction Mismatch');
  153. xlabel('Time (s)');ylabel('Magnitude (V)');
  154.  
  155. figure('Name', 'MVDR vs LCMV');
  156. pattern(ula,fc,-180:180,0,'Weights',wLCMV,'Type','powerdb',...
  157.     'PropagationSpeed',physconst('LightSpeed'),'Normalize',false,...
  158.     'CoordinateSystem','rectangular');
  159. axis([0 90 -40 35]);
  160.  
  161. hold on;  % compare to MVDR
  162. pattern(ula,fc,-180:180,0,'Weights',wSn,...
  163.     'PropagationSpeed',physconst('LightSpeed'),'Normalize',false,...
  164.     'Type','powerdb','CoordinateSystem','rectangular');
  165. hold off;
  166. legend('LCMV','MVDR');
  167.  
  168.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement