equation of zero forcing receiver
Show older comments
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
5 Comments
Dyuman Joshi
on 16 Sep 2023
What is the size of variables H and S?
Maha Saif
on 16 Sep 2023
Dyuman Joshi
on 16 Sep 2023
Undefined parameter iter in your code.
Check above.
Maha Saif
on 16 Sep 2023
Maha Saif
on 16 Sep 2023
Accepted Answer
More Answers (2)
Walter Roberson
on 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 Comments
Maha Saif
on 17 Sep 2023
Walter Roberson
on 17 Sep 2023
I do not have any idea what the equations are for zero forcing receiver.
Maha Saif
on 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
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
on 17 Sep 2023
0 votes
1 Comment
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,:)
H_ZF1{1}(1:5,:)
H_ZFc{1}(1:5,:)
Categories
Find more on Simulink 3D Animation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!