我有以下代码:
hMod = comm.GMSKModulator('BitInput', true, 'InitialPhaseOffset', pi/4);
hAWGN = comm.AWGNChannel('NoiseMethod','Signal to noise ratio (SNR)','SNR',0);
hDemod = comm.GMSKDemodulator('BitOutput', true,'InitialPhaseOffset', pi/4);
% Error calculator
hError = comm.ErrorRate('ReceiveDelay', hDemod.TracebackDepth);
for counter = 1:100
% Transmit 100 words of 16 bits
data = randi([0 1],16,1);
modSignal = step(hMod, data);
noisySignal = step(hAWGN, modSignal);
receivedData = step(hDemod, noisySignal);
errorStats = step(hError, data, receivedData);
end
下面的函数得到mod / demod块的延迟,延迟是16位。
hError = comm.ErrorRate('ReceiveDelay', hDemod.TracebackDepth);
误差函数根据上述延迟计算误差。
errorStats = step(hError, data, receivedData);
有了这个,我的输出(receivedData
)由于延迟而得到错误的值(延迟)。