Bipolar to Unipolar Converter
Map bipolar signal to unipolar signal in range [0, M – 1]
Libraries:
Communications Toolbox /
Utility Blocks
Description
The Bipolar to Unipolar Converter block maps the bipolar input signal to a unipolar output signal.
Examples
Use the Bipolar to Unipolar Converter to remap a signal from bipolar to unipolar.
The cm_convert_bipolar2unipolar model converts signals from bipolar to unipolar and displays the unipolar mapping.

With Output data type set to Inherit via internal rule, vary the M-ary number and Polarity settings, run the simulation, and then display the output of the Bipolar to Unipolar Converter block.
For the input signal int8([-3; -1; 1; 3]), With Polarity = Positive and M-ary number = 4: The output is 0 1 2 3, and type is uint8.
With Polarity = Negative and M-ary number = 4: The output is 3 2 1 0, and type is uint8.
With Polarity = Positive and M-ary number = 2^8: The output is 126 127 128 129, and type is uint8.
With Polarity = Positive and M-ary number = 2^8+1: The output is 126 127 128 129, and type is uint16.
Ports
Input
Input signal, specified as a scalar, vector, or matrix. The block expects a signal of integers in the set {–M+1, –M+3, –M+5,..., M – 1}, where M is the M-ary number parameter value.
The input signal is unnamed on the block mask.
Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32
Output
Output signal, returned as a signal of integers in the range [0, (M – 1)] with the same dimensions as the input signal, In. M is the M-ary number parameter value. The Output data type parameter specifies the desired data type.
The output signal is unnamed on the block mask.
Note
The output might not be valid for input signal values outside the set {–M+1, –M+3, –M+5,..., M – 1}.
Parameters
To edit block parameters interactively, use the Property Inspector. From the Simulink® Toolstrip, on the Simulation tab, in the Prepare gallery, select Property Inspector.
Number of symbols in the bipolar or unipolar alphabet, specified as a positive integer.
Relative ordering of symbols, specified as
Positive or
Negative.
Positivecauses the block to maintain the relative ordering of symbols in the alphabets.Negativecauses the block to reverse the relative ordering of symbols in the alphabets.
The value of this parameter determines the output for input value k and M-ary number parameter value M.
| Output | |
|---|---|
Positive
| (M – 1 + k)/2 |
Negative
| (M – 1 – k)/2 |
Output data type of the unipolar signal, specified as Inherit
via internal rule, Same as
input, double,
int8, int16,
int32, uint8,
uint16, uint32, or
boolean.
When you set this parameter to Inherit via internal
rule, the block determines the output data type based on
the input data type as follows:
If the input data type is either
singleordouble, the output data type is the same as the input data type.If the input data type is not
singleordouble:For the M-ary number parameter value, M, the block computes the ideal signed integer output word length, ideal_word_length, required to contain the range [0, M – 1] as:
ideal_word_length = ceil(log2(M)).The block sets the output data type to be an unsigned integer, based on the smallest word length (in bits) that can best fit the computed ideal word length.
Note
Selections in the Hardware Implementation Pane (Simulink) that constrain word length do not affect how this block determines output data types.
Block Characteristics
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Version History
Introduced before R2006a
See Also
Blocks
- Unipolar to Bipolar Converter | Bit to Integer Converter (Simulink) | Integer to Bit Converter (Simulink) | Data Mapper
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)