negative eigenvalues in sample covariance matrix
显示 更早的评论
clc; clear;
N=10; taps=2; snr=0; noise_var=0.05;
h1r=randn(1,taps)/sqrt(2); h1i=randn(1,taps)/sqrt(2); h1=complex(h1r,h1i); h1=h1/norm(h1);
h2r=randn(1,taps)/sqrt(2); h2i=randn(1,taps)/sqrt(2); h2=complex(h2r,h2i); h2=h2/norm(h2);
c1=[h1(1);zeros(1,N-1)']; r1=[h1 zeros(1,N-1)]; H1=toeplitz(c1,r1);
c2=[h2(1);zeros(1,N-1)']; r2=[h2 zeros(1,N-1)]; H2=toeplitz(c2,r2);
H=[H1;H2];
order=64; k=log2(order); n=(taps+N-1)*k; x = randi([0 1],n,1); hMod = comm.RectangularQAMModulator(order); hBitToInt = comm.BitToInteger(k);% Convert the bits in x into k-bit symbols. xsym = step(hBitToInt,x); D = modulate(modem.qammod(order),xsym);
X=awgn(H*D,snr,'measured');
% noise1=sqrt(noise_var/2)*(randn(1,size(H1*D,1))+i*randn(1,size(H1*D,2))); % noise2=sqrt(noise_var/2)*(randn(1,size(H2*D,1))+i*randn(1,size(H2*D,2))); % noise=[noise1.';noise2.']; % % X=H*D+noise;
R=X*X'/size(X,2);
[Q ,eig_val]=eig (R);
the problem is that matrix of eig_val has negative values and this can't happen for sample covariance matrix R any help please
回答(1 个)
Matt J
2014-10-10
0 个投票
I can't run your code, because you haven't provided all variables needed to run it. However, you can expect small magnitude negative eigenvalues due to floating point errors, if your true covariance matrix ix close to singular.
类别
在 帮助中心 和 File Exchange 中查找有关 Linear Algebra 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!