equation of zero forcing receiver

5 次查看(过去 30 天)
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-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