⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main_recur.m

📁 THIS matlab code is STTD
💻 M
字号:
close all;
clear;
clc;


L = 38400;
chip_data = chip_gen(L);

M = input('Input modem type (4 or 16 or 64) ? ');
num_Tx = input('Input the number of transmit antennas ? ');

[D, L, M, bit_n] = dec_gen(chip_data, M);
dd = scatterplot(0);

snr = [0:2:30];
for idx=1:length(snr)
    SNR = snr(idx);
    
[Tx_1, Tx_2, Tx, scale] = mimo_en(D,M, num_Tx, L, bit_n);

[Rx_1, Rx_2, Rx, h_1, h_2] = channel(Tx_1, Tx_2, L, bit_n, SNR);

[z, R, r_1, r_2] = mimo_de(Rx_1, Rx_2, M, L, bit_n, h_1, h_2, scale);

dd = scatterplot(R, 1, 0, 'b.', dd);
drawnow;

[num_t, rt_t, num_r, rt_r] = result(D, z);

    num_SER(idx) = num_t;
    num_BER(idx) = num_r;
    rt_SER(idx) = rt_t;
    rt_BER(idx) = rt_r;
    
end


semilogy(snr,rt_SER,'-ro')
grid on;
hold on;
semilogy(snr,rt_BER,'-b*')
grid on;
hold on;


if M==4
    title('QPSK Modulation 2_1');
    xlabel('SNR(dB)');
    ylabel('SER & BER');
    legend('QPSK_SER','QPSK_BER');

elseif M==16
    title('16QAM Modulation 2_1');
    xlabel('SNR(dB)');
    ylabel('SER & BER');
    legend('16QAM_SER','16QAM_BER');

elseif M==64
    title('64QAM Modulation 2_1');
    xlabel('SNR(dB)');
    ylabel('SER & BER');
    legend('64QAM_SER','64QAM_BER');
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -