Advertisement
makispaiktis

Beamforming - MVDR

Jan 6th, 2023 (edited)
1,255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 1.11 KB | None | 0 0
  1. clear all
  2. clc
  3.  
  4. %% Data
  5. % Baseband signal
  6. T_signal = 100;
  7. t = [0:0.1:2*T_signal]';
  8. fr = 1/T_signal;
  9. signal = sin(2*pi*fr*t);
  10. % Carrier
  11. c = 3e8;
  12. fc = 300e6;
  13. lambda = c /fc;
  14. % Array
  15. N = 5;
  16. incidentAngle = [45; 0];
  17. array = phased.ULA('NumElements', N, 'ElementSpacing', lambda/2);
  18. x = collectPlaneWave(array, signal, incidentAngle, fc, c);
  19. % Noise
  20. rng('default');
  21. noise = 0.1*(randn(size(x)) + 1j*randn(size(x)));
  22. rx = x + noise;
  23.  
  24. %% Beamformer
  25. % MVDR Beamformer
  26. beamformer = phased.MVDRBeamformer('SensorArray',array,...
  27.     'PropagationSpeed',c,'OperatingFrequency',fc,...
  28.     'Direction',incidentAngle,'WeightsOutputPort',true);
  29. [y, weights] = beamformer(rx);
  30.  
  31. % Plot
  32. figure('Name', 'Received in middle antenna vs Beamformed');
  33. plot(t, real(rx(:,ceil(N/2))), 'r:', t, real(y));
  34. xlabel('Time');
  35. ylabel('Amplitude');
  36. legend('Original', 'Beamformed');
  37. figure('Name', 'Array Factor');
  38. pattern(array, fc, -180:180, 0, 'PropagationSpeed', c, ...
  39.     'Weights', weights, 'CoordinateSystem', 'rectangular',...
  40.     'Type','powerdb');
  41.  
  42. weights
  43. gains = abs(weights)
  44. phases_degrees = angle(weights) * 180/pi
  45.  
  46.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement