- first, add a 'to workspace' block in "array" format for the two signals.
- input variable called "Tx", and variable output called "Rx".
- run the model, and then execute the following code:
confusing behavior of MIL-STD-188-110B
4 views (last 30 days)
Nina Buchanan on 23 Jul 2017
Simulink has a demo model of M110B digital messaging (commmilstd188110b)that encodes a stream from a Bernoulli binary generator, puts it through a channel, and decodes it. A BER metric compares the input and output and, unless the SNR is reduced, typically shows zero errors. However, when I capture the input and output data (by display or to workspace) the numbers are very different. I know there is a delay while the preamble is sent, but I am looking at the end of the streams. I don't understand how BER can tell me the streams are the same while the captured numbers are different. Thanks to anyone who can explain this model.
Abhi Sundararaman on 26 Jul 2017
I believe looking at the end of the streams may not be the best way to compare the two signals. Since both data streams end as soon as the simulation ends, there will be data at the end of the input signal that has yet to reach the output signal due to delay. This is why the ends of the signals will never match.
Instead, if you compare the data at the start of the input signal (Tx) to the start of the data AFTER the delay in the output signal (Rx), you will see that the two are the same.
The following code snippet will demonstrate the above:
dataStartIndex = find(Rx);
dataStartIndex = dataStartIndex(1);
outputData = Rx(dataStartIndex:end);
inputDataTrimmed = Tx(1: length(outputData));
%compare the two data sets, input and output
compared = outputData == inputDataTrimmed;
%the above will output a boolean vector, with "1" everywhere the two match.
completeMatch = all(compared); %this will check if they all matched.
The above compares the data that DID reach the output, to the input data. From the above, we can see that the two sets are identical (excluding the end of the input data that did not reach the output in time due to the delay).