⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 elenven2.m

📁 The angles in degrees of the two spatially propagating signals Compute the array response vectors o
💻 M
字号:
%
% Problem 11.3
%
clear
M = 50; % number of elements
spacing = 0.5; % lambda/2 spacing
N = 1000; % number of samples
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Part A
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The angles in degrees of the two spatially propagating signals
phi1 = -10;
phi2 = 30;
% The power levels of the signals and the noise
P1_db = 20;
P2_db = 25;
Pn = 0;
% Compute the array response vectors of the two signals
v1 = exp(-j*2*pi*spacing*[0:(M-1)]'*sin(phi1*pi/180))/sqrt(M);
v2 = exp(-j*2*pi*spacing*[0:(M-1)]'*sin(phi2*pi/180))/sqrt(M);
% Generate the signals 1 and 2 and the noise
s1 = (10^(P1_db/20)) * v1 * ((randn(1,N) + j*randn(1,N))/sqrt(2));
s2 = (10^(P2_db/20)) * v2 * ((randn(1,N) + j*randn(1,N))/sqrt(2));
w = (10^(Pn/20)) * (randn(M,N) + j*randn(M,N))/sqrt(2); % Noise
% Add signals and noise to get the total array signal
x = s1 + s2 + w;
% Compute the true covariance matrix
% (remember to divide by 10 not 20 for powers in the covariance)
R_x = (10^(P1_db/10)) * v1 * v1' + (10^(P2_db/10)) * v2 * v2' + ...
(10^(Pn/10)) * eye(M);
% Generate the spatial matched filters to compute the steered
% response for angles from -90 to 90 degrees
phi = -90:0.2:90;
C_smf = exp(-j*2*pi*spacing*[0:(M-1)]'*sin(phi*pi/180))/sqrt(M);
% Compute the steered response
for k = 1:length(phi)
R_steer_est(k) = mean(abs(C_smf(:,k)' * x).^2,2);
R_steer_true(k) = abs(C_smf(:,k)'* R_x * C_smf(:,k));
end
% Plot out the steered response in decibels
figure
plot(phi,10*log10(R_steer_est),'b','linewidth',2.5);
xlabel('Angle (deg)','fontweight','bold','fontsize',20);
ylabel('Steered Response (dB)','fontweight','bold','fontsize',20);
set(gca,'fontweight','bold','fontsize',18);
axis([-90 90 -5 65]);
grid
set(gca,'xtick',-90:15:90);
% Plot out the steered response in decibels
figure
plot(phi,10*log10(R_steer_true),'b','linewidth',2.5);
xlabel('Angle (deg)','fontweight','bold','fontsize',20);
ylabel('Steered Response (dB)','fontweight','bold','fontsize',20);
set(gca,'fontweight','bold','fontsize',18);
axis([-90 90 -5 65]);
grid
set(gca,'xtick',-90:15:90);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -