DSB最简单DOA估计算法

哪位大神帮忙看一下错误在哪里?60度的入射角度,结果总是不对。
%==========================================================================
%   1. close all
%==========================================================================
clc;
clear all;
close all;
%==========================================================================
%   1. 
%==========================================================================
fs=16e3;
d=0.035;
c=340;
angle=60;
Ts=1/fs;
M=6;
% construct wav
tao=d*cos(60*pi/180)/c;
f0=50;
n=1:2000;
y1=sin(2*pi*f0*n*Ts);% reference
y2=sin(2*pi*f0*n*Ts-2*pi*f0*tao);
y3=sin(2*pi*f0*n*Ts-2*pi*f0*2*tao);
y4=sin(2*pi*f0*n*Ts-2*pi*f0*3*tao);
y5=sin(2*pi*f0*n*Ts-2*pi*f0*4*tao);
y6=sin(2*pi*f0*n*Ts-2*pi*f0*5*tao);
nfft=2048;
% fft
fft1=fft(y1,nfft);
fft2=fft(y2,nfft);
fft3=fft(y3,nfft);
fft4=fft(y4,nfft);
fft5=fft(y5,nfft);
fft6=fft(y6,nfft);
fft_res=[fft1;fft2;fft3;fft4;fft5;fft6];
theta=[0:1:180]*pi/180;

% 生成导向矢量
tmp_vec=zeros(nfft/2+1,M,length(theta));
for k=1:(nfft/2+1)
    for m=1:M
      tmp_vec(k,m,:)=exp(j*2*pi*k*fs/nfft*(m-1)*d*cos(theta)/c);
    end
end

% 与频域信号相乘
tmp_res=zeros(nfft/2+1,length(theta));
for k=1:nfft/2+1
    for ang=1:length(theta)
        tmp_res(k,ang)=abs(fft_res(:,k).'* tmp_vec(k,:,ang).')^2;% 计算能量
    end
end

[a b]=max(tmp_res(7,:)) % 找最大的位置b

 

 

 

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值