当前位置:   article > 正文

宽带信号处理实现DOA估计(ISM算法、MUSIC、MVDR、CBF)_宽带cbf

宽带cbf
  1. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  3. %%%%%%%%%%%%%%%%%%% 宽带信号DOA估计算法:ISM 算法%%%%%%%%%%%%%%%%%%%%%%%%%%%
  4. %%%%%%%% Developed by HHU's Boya (河海大学_信息与通信工程_李蓉) %%%%%%%%%%%%%
  5. %%%%%%%%%%%%%%%%%%% EMAIL:15006120517@163.com %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  6. %%%%%%%%%%%%%%%%%%%%%%%%% MUSIC \ CBF \ MVDR %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  7. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  8. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  9. clc;
  10. clear all;
  11. close all;
  12. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 参数定义 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  13. M=12; %阵元数
  14. N=200; %快拍数
  15. X=2; %信源数
  16. ts=0.01; %时域采样间隔
  17. fl=80; %入射信号最低频率
  18. fh=120; %入射信号最高频率
  19. fm=(fl+fh)/2; %入射信号中心频率
  20. c=1500; %声速
  21. lambda=c/fm; %波长
  22. d=lambda/2; %阵元间距
  23. SNR=15; %信噪比
  24. ang2rad = pi/180; %角度转弧度系数
  25. theta1=30*ang2rad; %入射信号波束角1
  26. theta2=-45*ang2rad; %入射信号波束角2
  27. n=ts:ts:N*ts; %采样时间矢量
  28. theta=[theta1,theta2];
  29. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% produce signal %%%%%%%%%%%%%%%%%%%%%%%%%%%%
  30. s1=chirp(n,fl,1,fh); %生成线性调频信号1;
  31. s1=awgn(s1,SNR,'measured'); %在信号中添加高斯噪声
  32. s1_fft=fft(s1); %进行FFT变换;Y = fft(X,n) 返回 n 点 DFT。如果未指定任何值,则 Y 的大小与 X 相同
  33. s2=chirp(n+0.100,fh,1,fl); %生成线性调频信号2
  34. s2=awgn(s2,SNR,'measured'); %在信号中添加高斯噪声
  35. s2_fft=fft(s2); %进行FFT变换
  36. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ISM算法 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  37. %%构造接收信号、协方差矩阵
  38. sump_music=zeros(1,361); %角度功率谱初始化
  39. sump_mvdr= zeros(1,361); %角度功率谱初始化
  40. sump_cbf = zeros(1,361); %角度功率谱初始化
  41. for i=1:N %遍历各频点
  42. f=80+(i-1)*1.0; %具体频点 +1
  43. s_music=[s1_fft(i) s2_fft(i)]'; %2个声源信号的频域快拍_MUSIC\后续考虑增加快拍数\目前是1%%
  44. s_mvdr=[s1_fft;s2_fft]; %MVDR200个快拍一起
  45. s_cbf=[s1_fft;s2_fft]; %CBF200个快拍一起
  46. %接收矢量阵
  47. a = exp(-1j*2*pi*f*d/c*(0:M-1)'*sin(theta)); %方向矢量矩阵M*2 M为阵元数 2为声源数目
  48. %%协方差矩阵music
  49. Xmusic=a*s_music; %接收信号快拍矩阵 Xn 12*1维 12*1 = 12*2 * 2*1
  50. R_music=Xmusic*Xmusic'; %快拍信号的协方差矩阵
  51. %%协方差矩阵mvdr
  52. Xmvdr=a*s_mvdr; %接收信号快拍矩阵
  53. R_mvdr=Xmvdr*Xmvdr'/N; %快拍信号的协方差矩阵
  54. %%协方差矩阵cbf
  55. Xcbf=a*s_cbf; %接收信号快拍矩阵
  56. R_cbf=Xcbf*Xcbf'/N; %快拍信号的协方差矩阵
  57. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ISM_MUSIC 算法 %%%%%%%%%%%%%%%%%%%%%%%%%
  58. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ISM_MVDR算法 %%%%%%%%%%%%%%%%%%%%%%%%%%%
  59. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ISM_CBF算法 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
  60. %%噪声子空间En
  61. [Ev,D] = eig(R_music); % 特征值分解 D:特征值的对角矩阵 Ev:右特征列向量组成的矩阵
  62. EVA = diag(D)'; % 将特征值提取为1行
  63. [EVA,I] = sort(EVA); % 对特征值排序,从小到大。其中I为索引向量
  64. EV = fliplr(Ev(:,I)); % 按照索引I对顺序特征矢量排序得到Ev,再fliplr水平颠倒列向量得到特征值从大到小分布的特征列向量组成的矩阵EV
  65. En = EV(:,X+1:M); % 取特征向量矩阵的第X+1到M列特征向量组成噪声子空间En
  66. % 遍历所有角度,计算空间谱
  67. for i = 1:361
  68. angle(i) = (i-181)/2; % 映射到-90度到90度
  69. theta_m = angle(i)*ang2rad;
  70. a_theta = exp(-1j*2*pi*f/c*d*(0:M-1)'*sin(theta_m)); %导向矢量M*1
  71. p_music(i) = abs(1/(a_theta'*En*En'*a_theta)); %MUSIC算法功率谱
  72. p_mvdr(i)=1/abs(a_theta'*inv(R_mvdr)*a_theta); %MVDR算法功率谱
  73. p_cbf(i)=abs(a_theta'*R_cbf*a_theta); %CBF算法功率谱
  74. end
  75. sump_music=sump_music+p_music; %累加各频点功率谱
  76. sump_mvdr=sump_mvdr+p_mvdr; %累加各频点功率谱
  77. sump_cbf=sump_cbf+p_cbf; %累加各频点功率谱
  78. end
  79. %%%%%%%%%%%%%%%%%%%%%%%%%%%% 归一化处理、作图 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  80. %%ISM_MUSIC
  81. p_music_max = max(sump_music);
  82. sump_music = 10*log10(sump_music/p_music_max);
  83. %%ISM_MVDR
  84. p_mvdr_max = max(sump_mvdr);
  85. sump_mvdr = 10*log10(sump_mvdr/p_mvdr_max);
  86. %%ISM_CBF
  87. p_cbf_max=max(sump_cbf);
  88. sump_cbf=10*log10(sump_cbf/p_cbf_max);
  89. %%作图ISM_MUSIC \ MVDR \ CBF
  90. %%ISM——MUSIC
  91. figure(1);
  92. subplot(3,1,1);
  93. plot(angle,sump_music,'b-');
  94. title('ISM——MUSIC空间谱');
  95. xlabel('入射角/度');
  96. ylabel('空间谱/dB');
  97. %%ISM——MVDR
  98. subplot(3,1,2);
  99. plot(angle,sump_mvdr,'r-');
  100. title('ISM——MVDR空间谱');
  101. xlabel('入射角/度');
  102. ylabel('空间谱/dB');
  103. %%ISM——CBF
  104. subplot(3,1,3);
  105. plot(angle,sump_cbf,'g-');
  106. title('ISM——CBF空间谱');
  107. xlabel('入射角/度');
  108. ylabel('空间谱/dB');
  109. %%ISM——MUSIC
  110. figure(2);
  111. plot(angle,sump_music,'b-');
  112. title('ISM——MUSIC空间谱');
  113. xlabel('入射角/度');
  114. ylabel('空间谱/dB');
  115. %%ISM——MVDR
  116. figure(3);
  117. plot(angle,sump_mvdr,'r-');
  118. title('ISM——MVDR空间谱');
  119. xlabel('入射角/度');
  120. ylabel('空间谱/dB');
  121. %%ISM——CBF
  122. figure(4);
  123. plot(angle,sump_cbf,'g-');
  124. title('ISM——CBF空间谱');
  125. xlabel('入射角/度');
  126. ylabel('空间谱/dB');

1 常规波束形成算法(CBF)

功率谱:                             P_{CBF}(\theta)=a^{H}(\theta)Ra(\theta)_{_{}}

2 MVDR算法

功率谱:                             P_{MVDR}(\theta)=\frac{1}{​{a(\theta)}^H{R^{-1}}{a(\theta)}}

3 多重信号分类法(MUSIC)

功率谱:                            P_{MUSIC}(\theta)=\frac{1}{​{a(\theta)}^H{U_{N}}{​{U_{N}}^{H}}{a(\theta)}}

       由快拍信号 X_{n} 计算协方差矩阵 R ,其中 R=\frac{X_{n}*{X_{n}}^{'}}{N}N为快拍长度;对上述的空间谱公式遍历各个角度,计算对应角度的导向矢量a(\theta ),带入空间谱计算公式得到各个角度的功率值,遍历预想的全部角度以后就得到各种方法的空间谱啦;

       代码中使用了MUSIC算法,也使用了CBF和MVDR算法,效果并不是很完美;代码存在瑕疵,请多多包涵或自行修改,取代码请关注博主吧,唯一小要求;

注:其中  a(\theta ) 为导向矢量,R 为快拍信号的协方差矩阵,U_{N} 为协方差矩阵 R 特征值分解得到的噪声子空间矩阵;  

本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/在线问答5/article/detail/770422
推荐阅读
相关标签
  

闽ICP备14008679号