| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Communications Toolbox |
| Contents | Index |
| Learn more about Communications Toolbox |
h = commtest.ErrorRate
h = commtest.ErrorRate(sys)
h = commtest.ErrorRate(sys,'PropertyName',PropertyValue,...)
h = commtest.ErrorRate('PropertyName',PropertyValue,...)
h = commtest.ErrorRate returns an error rate test console, h. The error rate test console runs simulations of a system under test to obtain error rates.
h = commtest.ErrorRate(sys) returns an error rate test console, error rate test console, h, with each specified property set to the h, with an attached system under test, SYS.
h = commtest.ErrorRate(sys,'PropertyName',PropertyValue,...) returns an error rate test console, h, with an attached system under test, sys. Each specified property, 'PropertyName', is set to the specified value, PropertyValue.
h = commtest.ErrorRate('PropertyName',PropertyValue,...) returns an error rate test console, h, with each specified property 'PropertyName', set to the specified value, PropertyValue.
The error rate test console object has the properties in the following table. Setting any property resets the object. A property that is irrelevant is one that you can set, but its value does not affect measurements. Similarly, you cannot display irrelevant properties using the disp method. You can write to all properties, except for the ones explicitly noted otherwise.
| Property | Description |
|---|---|
| Description | 'Error Rate Test Console'. Read-only. |
| SystemUnderTestName | System under test name. Read-only. |
| FrameLength | Specify the length of the transmission frame at each iteration.
This property becomes relevant only when the system under test registers
a valid test input.
|
| IterationMode | Specify how the object determines simulation points.
|
| SystemResetMode | Specify the stage of a simulation run at which the system resets.
|
| SimulationLimitOption | Specify how to stop the simulation for each sweep parameter
point.
Set TransmissionCountTestPoint to the name of the registered test point that contains the transmission count you are comparing to the MaxNumTransmissions property.
Call the info method of the error rate test console to see the valid registered test point names. |
| MaxNumTransmissions | Specify the maximum number of transmissions the object counts
before stopping the simulation for a sweep parameter point. This property
becomes relevant only when SimulationLimitOption is Number
of transmissions or Number of errors or transmissions.
|
| MinNumErrors | Specify the minimum number of errors the object counts before
stopping the simulation for a sweep parameter point. This property
becomes relevant only when setting the SimulationLimitOption to Number
of errors or Number of errors or transmissions.
|
| TransmissionCountTestPoint | Specify and register a test point containing the transmission count that controls the test console simulation stop mechanism. This property becomes relevant only when setting SimulationLimitOption to Number of transmissions or Number of errors or transmissions. Call the info method to see the valid test point names. |
| ErrorCountTestPoint | Specify and register the name of a test point containing the error count that controls the simulation stop mechanism. This property is only relevant when setting the SimulationLimitOption property to Number of errors or Number of errors or transmissions. Call the info method to see the valid test point names. |
The error rate test console object has the following methods:
Runs a simulation.
Runs the number of error rate simulations you specify for a system under test with a specified set of parameter values. If a Parallel Computing Toolbox™ license is available and a matlabpool is open, then the object distributes the iterations among the number of workers available.
Returns the simulation results.
r = getResults(h) returns the simulation results, r, for the test console, h. r is an object of the type you specify using testconsole.Results. It contains the simulation data for all the registered test points and methods to parse the data and plot it.
Returns a report of the current test console settings.
info(h) displays the current test console settings, such as registered test parameters and registered test points.
Resets the error rate test console.
reset(h) resets test parameters and test probes and then clears all simulation results of test console, h.
Attaches a system to test console.
attachSystem(ho,sys) attaches a valid user-defined system, sys, to the test console, h.
Detaches the system from the test console.
detachSystem(h) detaches a system from the test console, h. This method also clears the registered test inputs, test parameters, test probes, and test points.
Sets test parameter sweep values.
setTestParameterSweepValues(h,name,sweep) specifies a vector of sweep values, 'sweep', for the registered test parameter, name, in the test console, h. You only specify sweep values for registered test parameters. sweep must have values within the specified range of the test parameter. Display the valid ranges using the getTestParameterValidRanges method.
Returns test parameter sweep values.
getTestParameterSweepValues(h,name) gets the sweep values currently specified for the registered test parameter, name, in the test console, h.
Returns the test parameter valid ranges.
getTestParameterValidRanges(h,name) gets the valid ranges for a registered test parameter, name, in the test console, h.
Registers a test point.
registerTestPoint(h, name, actprobe,expprobe) registers a new test point object, name, to the error rate test console, h. The test point must contain a pair of registered test probes, actprobe, and expprobe. actprobe contains actual data, and expprobe contains expected data. The object compares the data from these probes and obtains error rate values. The error rate calculation uses a default error rate calculator function that simply performs one-to-one comparisons of the data vectors available in the probes.
registerTestPoint(h, name, actprobe,expprobe, handle) adds the handle, handle, to a user-defined error calculation function that compares the data in the probes and then obtains error rate results.
The user-defined error calculation function must comply with the following syntax: [ecnt tcnt] = functionName(act, exp, udata) where
ecnt output corresponds to the error count
tcnt output is the number of transmissions used to obtain the error count
act and exp correspond to actual and expected data
The error rate test console sets the inputs to the data available in the pair of test point probes, actprobe, and expprobe.
udata is a data input that the system under test passes to the test console at run time, using the setUserData method. udata contains the data necessary to compute errors, such as delays and data buffers.
The error rate test console passes the data that the system under test logs to the error calculation functions for all the registered test points. Calling the info method returns the names of the registered test points and the error rate calculator functions associated with them. It also returns the names of the registered test probes.
Unregister a test point.
unregisterTestPoint(h,name) removes the test point, name, from the test console, h.
% Obtain bit error rate and symbol error rate of an M-PSK system
% for different modulation orders and EbNo values.
% Instantiate an ErrorRate test console. The default error rate
% test console has an M-PSK system attached.
h = commtest.ErrorRate;
% Set sweep values for simulation test parameters
setTestParameterSweepValues(h,'M',2.^[1 2 3 4])
setTestParameterSweepValues(h,'EbNo',(-5:5))
% Register test points
registerTestPoint(h,'SymbolErrorRate','TxInputSymbols',...,
'RxOutputSymbols')
registerTestPoint(h,'BitErrorRate','TxInputBits','RxOutputBits')
% Set simulation stop criteria.
h.TransmissionCountTestPoint = 'SymbolErrorRate';
% Get information about the simulation settings
info(h)
% Run the MPSK simulations
run(h)
% Get the results
R = getResults(h);
% Plot EbNo versus bit error rate for different values of modulation
% order M
R.TestParameter2 = 'M';
plot(R)![]() | commsrc.pn | compand | ![]() |

Learn how to apply early verification to your development process through these technical resources.
How much time do you spend on testing to ensure implementation meets system-level requirements?
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |