5.m
来自「维特比编解码」· M 代码 · 共 11 行
M
11 行
randn('state', seed(2));
msg_enc = bi2de(reshape(msg_enc_bi, size(msg_enc_bi,2)*k,size(msg_enc_bi,1) / k)');
grayencod = bitxor([0:M-1],floor([0:M-1]/2)); msg_gr_enc = grayencod(msg_enc+1);
msg_tx = dmodce(msg_gr_enc, Fd, [Fs, pi/4], 'psk', M);
msg_rx = awgn(msg_tx, SNR-10*log10(1/codeRate)-10*log10(N));
numModPlot = numEncPlot * Fs ./ k; tMod = [0:numModPlot-1] ./ Fs .* k;
plot(tMod, real(msg_tx(1:length(tMod))),'c-',tMod, imag(msg_tx(1:length(tMod))),'m-');
axis([ min(tMod) max(tMod) -1.5 1.5]); xlabel('Time'); ylabel('Amplitude');
title('Encoded Symbols After QPSK Baseband Modulation' ); legend('In-phase','Quadrature',0);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?