mayuwww / beamforming

0 stars 0 forks source link

基于特征子空间的波束形成 #1

Open mayuwww opened 4 months ago

mayuwww commented 4 months ago

2024.6.3 基于特征子空间的波束形成 最常见的获得子空间的方法便是通过对协方差矩阵特征分解,记录其原理和代码。 基于特征子空间的波束形成.docx

mayuwww commented 4 months ago

`%% 2024.6.3 %% 协方差矩阵特征分解的特征子空间的波束形成

clc; close all clear all;

%% 初始化 M=18; % 天线数 L=100; % 快拍数 f=16000; % 载波频率 t=[0:1:L-1]/200; % 构造时间变量 K=3; %信源数 thetas=10; % 信号入射角度 thetai=[-30 30]; % 干扰入射角度 n=[0:M-1]'; % 构造一个一维列矩阵 snr=10; % 信噪比 inr=10; % 干噪比

%% 构造信号 vs=exp(-1ipinsin(thetas/180pi)); % 信号方向矢量 vi=exp(-1ipinsin(thetai/180pi)); % 干扰方向矢量 xs=sqrt(10^(snr/10))vsexp(1i2pift); % 构造有用信号 xi=sqrt(10^(inr/10)/2)vi[randn(length(thetai),L)+1irandn(length(thetai),L)];% 构造干扰信号 noise=[randn(M,L)+1irandn(M,L)]/sqrt(2); % 噪声 rec_sig=xs+xi+noise; % 接收信号

%% 协方差矩阵 Rx=rec_sig*rec_sig'/L; % 构造协方差矩阵

%% EIG算法 [U, V] = eig(Rx); %特征值分解 [V_new, index] = sort(diag(V),'descend'); U_new = U(:,index); %特征向量构成的矩阵 U_s=U_new(:,1:K); %信号子空间 P = U_s U_s'; %投影矩阵 a0 = P vs; %修正后的导向矢量 w = inv(Rx)a0 /(a0'inv(Rx)a0); %权矢量 sita = -90:0.1:90; %扫描角度 v=exp(-1ipinsin(sita/180pi)); % 扫描方向向量 B=abs(w'v); % 求不同角度的增益 plot(sita,20*log10(B/max(B)),'k'); title('波束图');xlabel('角度/degree');ylabel('波束图/dB'); `