当前位置:   article > 正文

采用前后向空间平滑(FBSS)的DOA估计算法(python)_python doa估计

python doa估计

相干信号会导致信源协方差矩阵秩亏,采用空间平滑算法可以实现降维处理,但是会牺牲阵列的孔径。

这里先采用前后向空间平滑算法解相干,再使用MUSCI算法进行DOA估计。

需要注意的是,在空间平滑之后,新的协方差矩阵的大小是子阵大小,不是原来的协方差矩阵大小。

  1. import numpy as np
  2. import scipy.signal as ss
  3. import scipy.linalg as LA
  4. import matplotlib.pyplot as plt
  5. def awgn(x, snr):
  6. spower = np.sum((np.abs(x) ** 2)) / x.size
  7. x = x + np.sqrt(spower / snr) * (np.random.randn(x.shape[0], x.shape[1]) + 1j * np.random.randn(x.shape[0], x.shape[1]))
  8. return x
  9. derad = np.pi / 180
  10. radeg = 180 / np.pi
  11. d = np.arange(0,3.5,0.5)
  12. theta = np.array([10,30,60]).reshape(1,-1)
  13. n=500
  14. snr = 10
  15. iwave = theta.size
  16. A = np.exp(-1j*2*np.pi*d.reshape(-1,1)@np.sin(theta*derad))
  17. def coherent_signal_Rxx(d, theta, n, snr):
  18. A = np.exp(-1j * 2 * np.pi * d.reshape(-1, 1) @ np.sin(theta * derad))
  19. S = np.random.randn(iwave-1, n)
  20. S = np.concatenate((S[0,:].reshape(1,-1),S), axis=0)
  21. X = A @ S
  22. X = awgn(X, snr)
  23. Rxx = X @ (X.conj().T) / n
  24. return Rxx
  25. def FBSS(Rxx, sub_num, iwave): ##subarray element number
  26. K = Rxx.shape[0]
  27. N = K-sub_num+1
  28. J = np.flip(np.eye(K),axis=0)
  29. crfb = (Rxx + J@(Rxx.T)@J)/2
  30. crs = np.zeros([sub_num,sub_num])
  31. for i in range(N):
  32. crs = crs + crfb[i:i+sub_num,i:i+sub_num]
  33. # crs = crs + Rxx[i:i + sub_num, i:i + sub_num] #FBB
  34. crs = crs/N
  35. D, EV = LA.eig(crs)
  36. index = np.argsort(D) # ascending order index
  37. EN = EV[:, index][:, 0:sub_num - iwave] #
  38. Angles = np.linspace(-np.pi / 2, np.pi / 2, 360)
  39. numAngles = Angles.size
  40. SP = np.empty(numAngles, dtype=complex)
  41. for i in range(numAngles):
  42. a = np.exp(-1j * 2 * np.pi * d.reshape(-1, 1)[0:sub_num] * np.sin(Angles[i]))
  43. SP[i] = ((a.conj().T @ a) / (a.conj().T @ EN @ EN.conj().T @ a))[0, 0]
  44. SP = np.abs(SP)
  45. SPmax = np.max(SP)
  46. SP = 10 * np.log10(SP / SPmax)
  47. x = Angles * radeg
  48. return x, SP
  49. co_Rxx = coherent_signal_Rxx(d=d,theta=theta,n=n,snr=snr)
  50. x, SP = FBSS(Rxx=co_Rxx,sub_num=6,iwave=iwave)
  51. plt.plot(x, SP)
  52. plt.show()

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/不正经/article/detail/315343
推荐阅读
相关标签
  

闽ICP备14008679号