필터 지우기
필터 지우기

equation of zero forcing receiver

조회 수: 5 (최근 30일)
Maha Saif
Maha Saif 2023년 9월 16일
답변: Maha Saif 2023년 9월 24일
hi,
can help me in this error , i don't know the solution ?
and i want to sure if this equation is right for zero forcing estimator ?
N_r = 128 ;
K = 8 ;
H = zeros(N_r, K);
SNR_dB = -12:4:20;
SNR = 10.^(0.1.*SNR_dB);
for iter = 1:length(SNR)
S = sqrt((SNR(iter))/K).*dftmtx(K) ;
W_ZF = ((H.^H) .* (H .* (H.^H)).^(-1)) .* S ; %" error in this line , Arrays have incompatible sizes for this operation"
H_ZF = (W_ZF .^ H) .* y1 ;
end
Arrays have incompatible sizes for this operation.
  댓글 수: 5
Maha Saif
Maha Saif 2023년 9월 16일
ok
but the problem of "Arrays have incompatible sizes for this operation"
how can solve?
Maha Saif
Maha Saif 2023년 9월 16일
iter is a for loop

댓글을 달려면 로그인하십시오.

채택된 답변

Maha Saif
Maha Saif 2023년 9월 24일
this the right answer of code function
function H_ZF = ZF_receiver ( W_ZF , H , Y , S )
N_r = 128 ;
K = 10 ;
H = zeros (N_r , K) ;
SNR_dB = -12:4:25;
SNR = 10.^(0.1.*SNR_dB);
for iter = 1:length(SNR)
S = sqrt((SNR(iter))/K).*dftmtx(K); % pilot matrix
end
Hh = H' ;
%W_ZF = ((H.^H) .* (H .* (H.^H)).^(-1)) .* S ;
W_ZF = H * pinv(Hh*H) * S ;
H_ZF = W_ZF .* Y ;
%H_ZF = (W_ZF .^ H) .* y1 ;
H_est_zf = reshape (H_ZF , N_r , K );
end

추가 답변 (2개)

Walter Roberson
Walter Roberson 2023년 9월 16일
W_ZF = ((H.^H) .* (H .* (H.^H)).^(-1)) .* S ;
The first part of that expression results in a 128 x 8 array that is all infinity -- with H being all 0, the H .* gives all 0 and all-zero ^-1 is going to be all infinity.
S is 8 x 8.
You cannot use element-by-element multiplication between a 128 x 8 matrix and an 8 x 8 matrix.
You could potentially use * matrix-multiplication between a 128 x 8 matrix and an 8 x 8 matrix, giving a 128 x 8 result. Which will probably be entirely complex-NaN due to the infinities in the left-hand side...
  댓글 수: 4
Maha Saif
Maha Saif 2023년 9월 17일
i mean how i can do multiplication in this case
Walter Roberson
Walter Roberson 2023년 9월 17일
N_r = 128 ;
K = 8 ;
H = zeros(N_r, K);
SNR_dB = -12:4:20;
SNR = 10.^(0.1.*SNR_dB);
numSNR = length(SNR);
W_ZF = cell(numSNR,1);
H_ZF = cell(numSNR,1);
for iter = 1:numSNR
S = sqrt((SNR(iter))/K).*dftmtx(K) ;
W_ZF{iter} = ((H.^H) .* (H .* (H.^H)).^(-1)) * S ;
H_ZF{iter} = (W_ZF{iter} .^ H) .* y1 ;
end
Unrecognized function or variable 'y1'.
However, I have no idea whether the modified expression is a correct expression for zero forcing receiver.
And it's still going to be all complex nan and inf anyhows. The matrix of zeros raised to power -1 is going to produce all infinities, and when you start manipulating infinities nan are a very common result.

댓글을 달려면 로그인하십시오.


Maha Saif
Maha Saif 2023년 9월 17일
Does it make any difference if the H matrix is complex or has zeros or ones ?
  댓글 수: 1
Walter Roberson
Walter Roberson 2023년 9월 17일
I had to guess about the size and values of y1 and about what might be reasonable "complex" entries.
If you have even a single zero entry in H then you get a NaN output -- at least for the corresponding row.
N_r = 128 ;
K = 8 ;
y1 = randi([0 1], N_r, K);
SNR_dB = -12:4:20;
SNR = 10.^(0.1.*SNR_dB);
numSNR = length(SNR);
H_ZF0 = cell(numSNR,1);
H_ZF1 = cell(numSNR,1);
H_ZFc = cell(numSNR,1);
H0 = zeros(N_r, K);
H1 = ones(N_r, K);
Hc = ones(N_r, K) * (1+1i); Hc(1,1) = 0;
for iter = 1:numSNR
S = sqrt((SNR(iter))/K).*dftmtx(K) ;
W_ZF = ((H0.^H0) .* (H0 .* (H0.^H0)).^(-1)) * S ;
H_ZF0{iter} = (W_ZF .^ H0) .* y1 ;
W_ZF = ((H1.^H1) .* (H1 .* (H1.^H1)).^(-1)) * S ;
H_ZF1{iter} = (W_ZF .^ H1) .* y1 ;
W_ZF = ((Hc.^Hc) .* (Hc .* (Hc.^Hc)).^(-1)) * S ;
H_ZFc{iter} = (W_ZF .^ Hc) .* y1 ;
end
H_ZF0{1}(1:5,:)
ans =
NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi
H_ZF1{1}(1:5,:)
ans = 5×8
0.7105 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.7105 0 0 0 0 0 0 0 0.7105 0 0 0 0 0 0 0
H_ZFc{1}(1:5,:)
ans =
NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi NaN + NaNi 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i -0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 - 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i -0.0000 + 0.0000i 0.1067 - 1.0967i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i -0.0000 + 0.0000i 0.0000 + 0.0000i -0.0000 + 0.0000i 0.1067 - 1.0967i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by