pypho_arbmod

Generic signal modulator for arbitrary modulation formats.

 

pypho_arbmod.__init__(glova)

Instantiation and parameter setting. All parameters have to be set after ___call___, as the input parameter bits are generated by other moduls.

Parameter Type Description
glova instance Global parameters

 

Output Type Description
User defined variable pypho_arbmod.pypho_arbmod  

 

pypho_arbmod.__call__(E, constpoints, bits

Parameter Type Description
E list List in which the optical data and noise signal are defined. Read here about data signal and noise representation
The optical input signal should be a pulse comb. See example below.
constpoints array Defines the constellation points.
No default value.
Further information below.
bits array Defines the bit sequence which is modulated.
No default value.

 

Output Type Description
User defined variable list Returns a list in which the optical data and noise signal are defined. Read here about data signal and noise representation.

 

The parameter constpoints defines the constellation points. It is an multidimensial array:
constpoints = [constpoints_x, constpoints_y], where constpoints_x and constpoints_y define the constellation points of the X- and the Y-polarisation. constpoints_* is another multidimensional array. For example

constpts_* = [( [1.0]*16),				
              ([2.0*np.pi*x/16.0 for x in range(0,16)]),			
              (colors.values()[x] for x in range(0,16)]),			
              ([x for x in range(0,16)]),
              ([(0),(0),(0),(0)], [(0),(0),(0),(1)], [(0),(0),(1),(0)], [(0),(0),(1),(1)], [(0),(1),(0),(0)], [(0),(1),(0),(1)], [(0),(1),(1),(0)], [(0),(1),(1),(1)],
              [(1),(1),(1),(1)], [(1),(1),(1),(0)], [(1),(1),(0),(1)], [(1),(1),(0),(0)], [(1),(0),(1),(1)], [(1),(0),(1),(0)], [(1),(0),(0),(1)], [(1),(0),(0),(0)],
             )]

The first array in constpts_* defines the absolute value and the second array the phase of the constellation point.
The third array defines a color code of each constellation point. This array is only for plotting a constellation diagram so that each point has a defined color.
The fourth array is a identification number of each point. The last array defines the bitsequence of each constellation point.
The figure shows the onstellation diagram as defined in the example above.

 

Resultplot
Fig. 1 : Constellation diagramme of the X- and Y-polarisation plane.

 

The parameter bits defines bitsequence which has to be modulated. It is an multidimensial array:
bits = [bits_x, bits_y], where bits_x and bits_y define the bitsequence of the X- and the Y-polarisation. If only bitsequence_x is set, bitsequence_y = bitsequence_x is defined by the module.

 

64 QAM

gcode_0 = ['000000', '000001', '000011', '000010', '000110', '000111', '000101', '000100',
 '001000', '001001', '001011', '001010', '001110', '001111', '001101', '001100', 
 '011000', '011001', '011011', '011010', '011110', '011111', '011101', '011100', 
 '010000', '010001', '010011', '010010', '010110', '010111', '010101', '010100',
 '110000', '110001', '110011', '110010', '110110', '110111', '110101', '110100', 
 '111000', '111001', '111011', '111010', '111110', '111111', '111101', '111100',
 '101000', '101001', '101011', '101010', '101110', '101111', '101101', '101100', 
 '100000', '100001', '100011', '100010', '100110', '100111', '100101', '100100'
 ]

gcode   = copy.deepcopy(gcode_0)
phav    = copy.deepcopy(gcode_0)
absv    = copy.deepcopy(gcode_0)
for c in range(0, len(gcode_0)):
    gcode[c] = [int(gcode_0[c][i:i+1], 2) for i in range(0, len(gcode_0[c]), 1)]
    x = -3.5 + divmod(c,8)[1]
    y = -3.5 + divmod(c,8)[0]
    absv[c] = np.abs(x+1.0j*y)
    phav[c] = np.angle(x+1.0j*y)



alpha = np.arctan(np.sqrt(1.0)/3.0)
constpts_x = [(         absv),
             (          phav),
             (          [colors.values()[x] for x in range(0,64)]),
             (          [x for x in range(0, 64)]),
             (          gcode)]  # codes gray optimized!     to check

for c in range(0, 64):
    b = np.asarray(constpts_x[4][c])        
    constpts_x[3][c] = int(b.dot(2**np.arange(b.size)[::-1]))