阵列信号处理基础(一、协方差矩阵)
生活随笔
收集整理的這篇文章主要介紹了
阵列信号处理基础(一、协方差矩阵)
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
背景
????????在處理陣列信號的時候,為了獲得空間信號維度的相關(guān)性,以估計目標(biāo)的信息。故使用協(xié)方差矩陣能夠獲得這些,因為協(xié)方差矩陣是每一維度下(也就是陣元)信號的相關(guān)性。當(dāng)兩個維度相關(guān)時,信號的協(xié)方差也是最大的。
源代碼
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % 陣列信號基礎(chǔ)(協(xié)方差矩陣) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% clc; close all; clear all;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % 信源 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % 隨機產(chǎn)生10*3維的整數(shù)矩陣作為樣本集,8為樣本的個數(shù),3為樣本的維數(shù) s=fix(rand(8,3)*10); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % 法一 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% cov(s) % 計算協(xié)方差矩陣%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % 法二 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% dim1=s(:,1); %得到第1維的數(shù)據(jù) dim2=s(:,2); %得到第2維的數(shù)據(jù) dim3=s(:,3); %得到第3維的數(shù)據(jù) % size(mysample,1) %第一維的大小 cov12=sum((dim1-mean(dim1)).*(dim2-mean(dim2)))/(size(s,1)-1); %計算dim1和dim2 的協(xié)方差 cov21=cov12; cov13=sum((dim1-mean(dim1)).*(dim3-mean(dim3)))/(size(s,1)-1); %計算dim1和dim3 的協(xié)方差 cov31=cov13; cov23=sum((dim2-mean(dim2)).*(dim3-mean(dim3)))/(size(s,1)-1); %計算dim2和dim3 的協(xié)方差 cov32=cov23; % 協(xié)方差矩陣對角線上的元素就是各個維度的方差,下面計算 var1=std(dim1)^2; var2=std(dim2)^2; var3=std(dim3)^2; answer=[var1,cov12,cov13;cov21,var2,cov23;cov31,cov32,var3]%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % 結(jié)論 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % 法一直接利用函數(shù)得到,法二通過推導(dǎo)得到,有利于理解協(xié)方差矩陣本質(zhì) % 三維協(xié)方差矩陣 % cov(x,x) cov(x,y) cov(x,z) % cov(y,x) cov(y,y) cov(y,z) % cov(z,x) cov(z,y) cov(z,z)仿真結(jié)果
總結(jié)
以上是生活随笔為你收集整理的阵列信号处理基础(一、协方差矩阵)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: (转)用 Asterisk 搭建自己的免
- 下一篇: 每日一题(28)—— 引用与指针的区别