1id: variable_constellation 2label: Constellation Object 3category: Modulators 4flags: [ show_id, python, cpp ] 5 6parameters: 7- id: type 8 label: Constellation Type 9 dtype: enum 10 options: [calcdist, bpsk, qpsk, dqpsk, 8psk, 16qam] 11 option_labels: [Variable Constellation, BPSK, QPSK, DQPSK, 8PSK, 16QAM] 12- id: sym_map 13 label: Symbol Map 14 dtype: int_vector 15 default: '[0, 1, 3, 2]' 16 hide: ${ ( 'none' if str(type) == "calcdist" else 'all') } 17- id: const_points 18 label: Constellation Points 19 dtype: complex_vector 20 default: '[-1-1j, -1+1j, 1+1j, 1-1j]' 21 hide: ${ ( 'none' if str(type) == "calcdist" else 'all') } 22- id: rot_sym 23 label: Rotational Symmetry 24 dtype: int 25 default: '4' 26 hide: ${ ( 'none' if str(type) == "calcdist" else 'all') } 27- id: dims 28 label: Dimensionality 29 dtype: int 30 default: '1' 31 hide: ${ ( 'none' if str(type) == "calcdist" else 'all') } 32- id: precision 33 label: Soft Decisions Precision 34 dtype: int 35 default: '8' 36 hide: part 37- id: soft_dec_lut 38 label: Soft Decisions LUT 39 dtype: raw 40 default: None 41 hide: ${ ('part' if str(soft_dec_lut) == 'None' else 'none') } 42value: ${ digital.constellation_calcdist(const_points, sym_map, rot_sym, dims) if (str(type) == "calcdist") else getattr(digital,'constellation_'+str(type))() } 43 44 45templates: 46 imports: from gnuradio import digital 47 var_make: |- 48 % if str(type) == "calcdist": 49 self.${id} = ${id} = digital.constellation_calcdist(${const_points}, ${sym_map}, 50 ${rot_sym}, ${dims}).base() 51 % else: 52 self.${id} = ${id} = digital.constellation_${type}().base() 53 % endif 54 % if str(soft_dec_lut).lower() == '"auto"' or str(soft_dec_lut).lower() == "'auto'": 55 self.${id}.gen_soft_dec_lut(${precision}) 56 % elif str(soft_dec_lut) != "None": 57 self.${id}.set_soft_dec_lut(${soft_dec_lut}, ${precision}) 58 % endif 59 60cpp_templates: 61 includes: ['#include <gnuradio/digital/constellation.h>'] 62 declarations: 'digital::constellation::sptr ${id};' 63 var_make: |- 64 std::vector<int> sym_map = {${str(sym_map)[1:-1]}}; 65 std::vector<gr_complex> const_points = {${str(const_points)[1:-1]}}; 66 % if str(type) == "calcdist": 67 this->${id} = digital::constellation_calcdist(const_points, sym_map, 68 ${rot_sym}, ${dims}).base(); 69 % else: 70 this->${id} = ${id} = digital::constellation_${type}().base(); 71 % endif 72 % if str(soft_dec_lut).lower() == '"auto"' or str(soft_dec_lut).lower() == "'auto'": 73 this->${id}.gen_soft_dec_lut(${precision}); 74 % elif str(soft_dec_lut) != "None": 75 this->${id}.set_soft_dec_lut(${soft_dec_lut}, ${precision}); 76 % endif 77 link: ['gnuradio-digital'] 78 79file_format: 1 80