argmin function for communication system

4 次查看(过去 30 天)
I can use assistance implementing a minimum distance decoder with Matlab to estimate the transmitted symbol as from the computed received signal which is y = h * x + w. The decoder estimates the transmitted symbol as . So, this is where the function attains its minimal value, which in this case is the minimum distance of the transmitted symbol. I am not certain how to implement this into Matlab. I included my current Matlab code shown below which creates 1e4 independent realizations each of h, x, and w for the input-output model y = h · x + w, and so what I need assistance with is the Matlab code for the 1e4 realizations of the decoder. I did find an argmin function from the Mathworks forum which I included at the very bottom of my Matlab code and ran it and I get a result but I am not certain if this is correct. Any assistance is greatly appreciated. Thank you in advance!
% random transmitted symbol x generations
N = 1e4;
c_vals = [-2-2*1i, -2+2*1i, 2-2*1i,2+2*1i];
idx = randi(4,N,1);
x = c_vals(idx)'
% channel h generations
N = 1e4
h = 1/sqrt(2) * (randn(N,1) + 1i*randn(N,1))
mean(h)
var(h)
% noise generations
numRealizations = 1e4; % number of independent realizations
sigma2_w = 0.1; % noise variance
w = sqrt(sigma2_w/2)*(randn(numRealizations, 1) + 1j*randn(numRealizations, 1))
y = h.*x + w
X = argmin(abs(y-h.*x).^2)
function [I,M]=argmin(varargin)
[M,I] = min(varargin{:});
end
  4 个评论
Torsten
Torsten 2023-4-6
编辑:Torsten 2023-4-6
I am assuming if x had real and imaginary components, the xhat formula which takes the absolute value and squares it only accounts for the real part.
No. It's the norm squared of a complex vector, namely y = h*x + w. The norm is defined as ||y||^2 = y'*y where y' is the conjugate transpose of y.
My guess is that your problem is solved by x = h\(y-w).
At least for all variables being real,
xhat = A\b
minimizes ||A*x-b|| in the 2-norm.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Test and Measurement 的更多信息

产品


版本

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by