You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: QRM_MLD_detector.m
    path of file: ./repos/MIMO-OFDM-Wireless-Communications-with-MATLAB
    
    the code of the file until where you have to start completion: function [X_hat]=QRM_MLD_detecor(Y,H)
% Input parameters
%     Y : received signal, nTx1
%     H : Channel matrix, nTxnT
% Output parameter
%   X_hat : estimated signal, nTx1

%MIMO-OFDM Wireless Communications with MATLAB¢ç   Yong Soo Cho, Jaekwon Kim, Won Young Yang and Chung G. Kang
%2010 John Wiley & Sons (Asia) Pte Ltd

global QAM_table  Q  R  Y_tilde  NT  M;
% NT : Number of Tx antennas, M : Parameter M in M-algorithm
QAM_table = [-3-3j, -3-j, -3+3j, -3+j, -1-3j, -1-j, -1+3j, -1+j, 3-3j, ...
                       3-j, 3+3j, 3+j, 1-3j, 1-j, 1+3j, 1+j]/sqrt(10); % QAM table
[Q R] = qr(H);   % QR-decomposition
Y_tilde = Q'*Y;  

    
function [X_hat]=QRM_MLD_detecor(Y,H)
% Input parameters
%     Y : received signal, nTx1
%     H : Channel matrix, nTxnT
% Output parameter
%   X_hat : estimated signal, nTx1

%MIMO-OFDM Wireless Communications with MATLAB¢ç   Yong Soo Cho, Jaekwon Kim, Won Young Yang and Chung G. Kang
%2010 John Wiley & Sons (Asia) Pte Ltd

global QAM_table  Q  R  Y_tilde  NT  M;
% NT : Number of Tx antennas, M : Parameter M in M-algorithm
QAM_table = [-3-3j, -3-j, -3+3j, -3+j, -1-3j, -1-j, -1+3j, -1+j, 3-3j, ...
                       3-j, 3+3j, 3+j, 1-3j, 1-j, 1+3j, 1+j]/sqrt(10); % QAM table
[Q R] = qr(H);   % QR-decomposition
Y_tilde = Q'*Y;  
symbol_replica = zeros(NT,M,NT); % QAM table index
for stage = 1:NT
   symbol_replica = stage_processing1(symbol_replica,stage);
end