首页 > 代码库 > DOA——ESPRIT算法
DOA——ESPRIT算法
相位phei = 2*pi*f*d*sind(theta),因此理论上来讲测向的算法都可以用来测频。
ESPRIT:Estimating signal parameters viarotational invariance techniques,中文为旋转因子不变法。
ESPRIT用于测频:
%Example_espritclear all;clc;close all;N=200; %signal lengthm = N/2;L=N-m;s_amp=[1.31*exp(1i*pi/4),2.07*exp(1i*pi/3),1.88*exp(1i*pi/5)];s_omega=[0.12*pi,0.37*pi,0.72*pi];eps_sigma=0;sigma=0.5;x=zeros(1,N);%initializew = sqrt(sigma)*randn(1,N);n = [1:N];for slen=1:length(s_omega) x = x+s_amp(slen)*exp(1j*s_omega(slen)*n) ;endx=x+w;for n = 1:L X(:,n) = x(n:(n+m-1));endfor n = 1:L Y(:,n) = x((n+1):(n+m));end%Rxx\RxyRxx = 0;for i = 1:L Rxx = Rxx+X(:,i)*X(:,i)‘;endRxx = Rxx/L;Rxy = 0;for i = 1:L Rxy = Rxy+X(:,i)*Y(:,i)‘;endRxy = Rxy/L;[A,B] = eig(Rxx);var = min(diag(B));I = eye(m);Z = diag(ones(1,m-1),-1);Cxx = Rxx - I*var;Cxy = Rxy - Z*var;[~,B] = eig(Cxx,Cxy);f=angle(diag(B));[~,fpos]=sort(abs(abs(diag(B))-1));f=f(fpos);fval=f(f>0);omega_est=sort(fval(1:length(s_amp)));disp(‘结果对比:‘)[omega_est,s_omega‘]
ESPRIT用于测向:
clear allclfset(0,‘defaultaxesfontsize‘,22);M=12;Nb=32;P=3;%angles=[25 80 135]*(pi/180);angdeg=[80 90 115];angles=angdeg*(pi/180);dlambda=0.5;%generate random bits of informationpoles=zeros(1,P);X=zeros(M,Nb);Rideal=zeros(M,M);for k=1:P,mu=pi*cos(angles(1,k));poles(1,k)=exp(j*mu);a=exp(j*mu*(0:M-1)).‘;Rideal=Rideal+a*a‘;br=ones(1,Nb);temp=rand(1,Nb);br(find(temp<.5))=-1;bi=ones(1,Nb);temp=rand(1,Nb);bi(find(temp<.5))=-1;b=br+j*bi;X=X+a*b;end%add some noiseX=X+0.6*(randn(M,Nb)+j*randn(M,Nb));Rxx=X*X‘/Nb;[E,D,V]=svd(Rxx);%ESPRIT algorithm:Es=E(:,1:P);Es1=Es(1:M-1,:); Es2=Es(2:M,:);Psi=Es1\Es2;[T,Phi]=eig(Psi);Phivec=diag(Phi);%plot eigenvalues from ESPRIT and compare with true frequenciespolar(0,1,‘.‘)hold onplot(real(poles),imag(poles),‘kx‘,‘MarkerSize‘,12,‘Linewidth‘,2);plot(real(Phivec),imag(Phivec),‘ro‘,‘MarkerSize‘,12,‘Linewidth‘,2);hold offlegend(‘True "poles"‘,‘ESPRIT eigenvalues‘)
DOA——ESPRIT算法
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。