Filter löschen
Filter löschen

equation of zero forcing receiver

5 Ansichten (letzte 30 Tage)
Maha Saif
Maha Saif am 16 Sep. 2023
Beantwortet: Maha Saif am 24 Sep. 2023
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 Kommentare
Maha Saif
Maha Saif am 16 Sep. 2023
ok
but the problem of "Arrays have incompatible sizes for this operation"
how can solve?
Maha Saif
Maha Saif am 16 Sep. 2023
iter is a for loop

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Maha Saif
Maha Saif am 24 Sep. 2023
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

Weitere Antworten (2)

Walter Roberson
Walter Roberson am 16 Sep. 2023
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 Kommentare
Maha Saif
Maha Saif am 17 Sep. 2023
i mean how i can do multiplication in this case
Walter Roberson
Walter Roberson am 17 Sep. 2023
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.

Melden Sie sich an, um zu kommentieren.


Maha Saif
Maha Saif am 17 Sep. 2023
Does it make any difference if the H matrix is complex or has zeros or ones ?
  1 Kommentar
Walter Roberson
Walter Roberson am 17 Sep. 2023
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

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Programming finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by