The old version of modem.qammod in Matlab is not compatible with the new version

Recently, because of the needs of the subject, I am studying communication.

I downloaded a code from around 2015 on the Internet, which used the modem.qammod function in the old version of matlab, but the function in the old version has been deleted. Why change the function...)

Then the following situation arises:

How to do it?

Check the source code and find that the functions mainly in this part of the source code have expired.

    modemTX = modem.qammod('M', M,  'SymbolOrder', 'gray');
    modemTX.InputType = 'bit';
    modemRX = modem.qamdemod(modemTX);

The part that handles this part of the variable is this:

data = normCoef*modulate(modemTX, transmittedBits);

......

receivedBitsMMSE = demodulate(modemRX,symbolEstimateMMSE/normCoef);

So I found these two articles on the Internet

Solve the problem of invalidation of modem.qammod in the new version of MATLAB_matlab modem.qammod_Bonit6's Blog-CSDN Blog

The modem.qammod function cannot be used in the new version of MATLAB_matlab modem.qammod_daijingxin's Blog-CSDN Blog

Modify according to their instructions, but still report an error, and the array does not match.

Personal suggestion, the most complete modification.

First, comment this part of the code block

%     modemTX = modem.qammod('M', M,  'SymbolOrder', 'gray');
%     modemTX.InputType = 'bit';
%     modemRX = modem.qamdemod(modemTX);

Then, modify the code block that uses the code in this part

data = normCoef*qammod(transmittedBits, M, 'gray', 'InputType','bit');

......

numberOfErrorsFrameMMSE = sum(sum(abs(receivedBitsMMSE-transmittedBits)));

In this way, there is no problem.

Guess you like

Origin blog.csdn.net/loveSIYU/article/details/129369919