On Fri, Apr 5, 2013 at 1:41 PM, Arturo Rinaldi <arty.n...@gmail.com> wrote: > Hi folks, i have bumped into an error while updating my thesis research to > the latest version of gnuradio. > It is a simple tool to estimate the BER of the digital modulation. I had to > change some lines of code due to the > fact that now the block constellation_decoder_cb accepts as input a > "constellation object" and not a complex > point tuple (i.e. [1+1j,1-1j,-1-1j,-1+1j] and so on) so i modified my code > in the following way (only the > deconding part). By asking to the gnuradio mailing list i got the following > advice : > > rot = (3.0/2.0)*sqrt((8.0/5.0)*bit_energy) > > rotated_const = map(lambda pt: pt * rot, > qam.make_nondifferential_constellation(16,gray_coded=True) > constell = digital.constellation_calcdist(rotated_const,[],1,1).base() # > (1) to get the base points and constellation object > self.slicer = digital.constellation_decoder_cb(constell) > > # if self._gray_code: > # self.symbol_mapper = gr.map_bb(qam.gray_to_binary[arity]) > # else: > # self.symbol_mapper = gr.map_bb(qam.ungray_to_binary[arity]) > > > # unpack the k bit vector into a stream of bits > > self.unpack = gr.unpack_k_bits_bb(self.bits_per_symbol()) # (2) > > self.connect(self,self.slicer, self.unpack,self) > > > which works fine for M-PSK modulation but since QAM is a mix of both phase > and amplitude modulation i can't > recover the exact position of the constellation points. I think the error > stays in a wrong calculation of the > euclidean distance. Any suggestions ? i really need help or otherwise the > functionality of my tool will be > dramatically reduced ! ! ! > > Thanks in advance, > > Arturo > > P.S. : The modulator block is shaped in the "old way", by just only passing > as parameter the constellation > points to the block > > self.chunks2symbols = gr.chunks_to_symbols_bc(rotated_const) > > I also use (2) because of my way to compare original bit by decoded bit and > then calculating the BER. However > the main issue is the wrong decoding of the constellation points by (1)
Arturo, Take a look at the constellation_decoder. This uses the constellation objects and handles the symbol slicing for you. The slicers are defined in constellation.{cc,h}, and if you come up with a smarter/cheaper way of slicing, you can add it here. I think this might help simplify things for you. Tom _______________________________________________ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio