1.软件版本
MATLAB2013b
2.本算法理论知识
算法源于文献:
3.部分核心代码
登录后复制
clc;clear;close all;warning off;Num_Sensor = 16;Num_signal = 2;Num_babe = 2;b = zeros(Num_Sensor,1);H = zeros(Num_Sensor,Num_signal);DOA = zeros(Num_signal,1);wavelength = 0.06; Iteration = 1:1:20;SNR = 12;d = 0.5*wavelength*ones(Num_Sensor,1);%阵元间距f = zeros(Num_signal,1);f(1) = 1;Len_Signal = 100000;Len_train = round(0.01*Len_Signal);%设置延迟长度Len_delays = round(0.05*Len_Signal);Train_Signal = zeros(Num_signal,Len_train); Train_Noise = zeros(Num_Sensor,Len_train); %信号和噪声以及反射信号和反射噪声Signal = zeros(Num_signal,Len_Signal);Noise = zeros(Num_Sensor,Len_Signal);%全值,LCMV不需要进行迭代更新W = zeros(Num_Sensor,1);%根据所提供的场景,设置各个入射信号的方位角DOA = [0,pi-atan(2)];%根据场景设置H(tableI算法为H已知,所以根据场景来设置)for jj=1:Num_signal for ii=1:Num_Sensor b(ii)=exp(-j*2*pi*(ii-1)*d(ii)*sin(DOA(jj))/wavelength) ; end H(:,jj)=b/(b'*b)^0.5;end %产生两路随机信号Signalo = randint(Num_signal,Len_Signal);Signalo = 2*(Signalo-0.5);%反射信号for i = 1:Num_signal Signal_reflect(i,:) = 0.2*[zeros(1,Len_delays),Signal(i,1:Len_Signal-Len_delays)];endSignal = Signalo;%产生babe噪声源babble = randn(Num_signal,Len_Signal)+j*randn(Num_signal,Len_Signal);babble = 2*(babble-0.5);for i = 1:Num_signal babble_reflect(i,:) = 0.2*[zeros(1,Len_delays),babble(i,1:Len_Signal-Len_delays)];end%实际输入到麦克风的声源Signal = (Signalo + Signal_reflect + babble + babble_reflect)/4;%传感器之间的噪声干扰Noise = randn(Num_Sensor,Len_Signal)+j*randn(Num_Sensor,Len_Signal);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%SNRs = zeros(1,length(Iteration));%在几种不同的信噪比下计算误码率diBi = 1/(2*10^(SNR/10))^0.5;Noise = Noise*diBi;for Iter = Iteration Iter Train_Signal = Signal(:,(1:Len_train)); Train_Noise = Noise(:,(1:Len_train)); x = H*Train_Signal + Train_Noise; %加噪声 x1 = H*Signal + Noise; %加噪声 %LCMV R = x*x'; W = inv(R)*H*inv((H'*inv(R)*H))*f; y = W'*x1; %以第一个信号源为准计算,如果是第二个信号源,也是同样处理 %计算SNR值 SNRs(Iter) = 10*log10(mean(abs(y(1,:)).^2)/mean(abs(Noise(1,:)).^2)); %计算SDR值 SDRs(Iter) = 10*log10(mean(abs(Signal(1,:)).^2)/mean(abs(Signal(1,:)-y(1,:)).^2));endfigure;subplot(211);plot(Iteration,SNRs,'b--','LineWidth',2);xlabel('Iteration');ylabel('SNR[dB]')axis([0,20,0,15]);subplot(212);plot(Iteration,SDRs,'b--','LineWidth',2);xlabel('Iteration');ylabel('SDR[dB]')axis([0,20,0,15]);save fig3.mat SNRs SDRs Iteration %计算后面的MSE值save w_mat.mat W1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.30.31.32.33.34.35.36.37.38.39.40.41.42.43.44.45.46.47.48.49.50.51.52.53.54.55.56.57.58.59.60.61.62.63.64.65.66.67.68.69.70.71.72.73.74.75.76.77.78.79.80.81.82.83.84.85.86.87.88.89.90.91.92.93.94.95.96.97.98.99.
4.操作步骤与仿真结论
我们对tableI的算法进行仿真,同时给出了用于对比的LCMV算法,通过对比,我们得到如下的仿真结果:
图一:LCMV和LC-DANSE的SNR对比仿真图;
图二:LC-DANSE的MSE图(论文中MSE只是DANSE系列的对比,TableI对应其中一种)
图三:LC-DANSE中不同P之的SNR图。
图四:LCMV和LC-DANSE的随着p变化的SNR图。A27-03
免责声明:本文系网络转载或改编,未找到原创作者,版权归原作者所有。如涉及版权,请联系删