<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>Hi,</span></div><div><br><span></span></div><div><span>I am currently trying to implement a modulator/demodulator for TETRA using pi/4 DQPSK. I tried to use cqpsk.py which was provided with this package, but apparently some functions such as psk.constellation[] are not available in the new version of gnuradio. I created a list of constellation points to be used by chunks_to_symbols_bc() function, and I think this has solved this issue. I have another issue: when I modulate a string of bits in a file, and then demodulate it, the output contains 10 zeros and then a few numbers between 0 to 255 which does not seem to be related to the input bit stream at all. Could anyone please advise me on the matter? I am using GNURadio3.6.0, and main bits of code are
 attached:</span></div><div><span></span></div><div>Regards,<br> <br></div><div>Vahid</div><div><br></div><div>CQPSK.py cqpsk_mod() modification:</div><div><br></div><div>...</div><div>self.pi4map = [1, 3, 7, 5]<br>    self.constel = [1+0j,0.7+0.7j,0+1j,-0.7+07j,-1+0j,-0.7-0.7j,0-1j,0.7-0.7j]<br>        self.symbol_mapper = gr.map_bb(self.pi4map)<br>        self.diffenc = gr.diff_encoder_bb(arity)<br>        self.chunks2symbols = gr.chunks_to_symbols_bc(self.constel)</div><div>...</div><div>-------------------------------------------------------------------<br></div><div>Modulator:</div><div><br>        sample_rate = options.sample_rate<br>        symbol_rate = 18000<br>        sps = 2<br>      
 <br>    IN = gr.file_source(gr.sizeof_char, options.input_file, repeat = False)<br>    #IN = (1,0,0,0,1,1,0,0)<br>    #src = gr.vector_source_b (IN)<br>        MOD = cqpsk.cqpsk_mod( samples_per_symbol = sps,<br>                                 excess_bw=0.35,<br>                log=options.log,<br>                            <br>                                
 verbose=options.verbose)<br><br><br>        OUT = gr.file_sink(gr.sizeof_gr_complex, options.output_file)<br><br>#        r = float(sample_rate) / float(new_sample_rate)<br><br>#        INTERPOLATOR = gr.fractional_interpolator_cc(0, r)<br><br>        self.connect(IN, MOD, OUT)<br></div><div>---------------------------------------------------------------</div><div>Demodulator:</div><div><br>        sample_rate = options.sample_rate<br>        symbol_rate = 18000<br>        sps = 2<br>        # output rate will be 36,000<br>        ntaps = 11 * sps<br>        new_sample_rate = symbol_rate *
 sps<br><br>        channel_taps = gr.firdes.low_pass(1.0, sample_rate, options.low_pass, options.low_pass * 0.1, gr.firdes.WIN_HANN)<br><br>        FILTER = gr.freq_xlating_fir_filter_ccf(1, channel_taps, options.calibration, sample_rate)<br><br>        sys.stderr.write("sample rate: %d\n" %(sample_rate))<br><br>        IN = gr.file_source(gr.sizeof_gr_complex, options.input_file, repeat = False)<br><br>        DEMOD = cqpsk.cqpsk_demod( samples_per_symbol = sps,<br>                                
 excess_bw=0.35,<br>                                 costas_alpha=0.03,<br>                                 gain_mu=0.05,<br>                                 mu=0.05,<br>                                
 omega_relative_limit=0.05,<br>                                 log=options.log,<br>                                 verbose=options.verbose)<br><br><br>    self.convert = gr.float_to_char()<br>    self.convert2 = gr.float_to_char()                <br>    OUT = gr.file_sink(gr.sizeof_char, options.output_file)<br><br>    self.sink1 = gr.vector_sink_b()<br><br>        r = float(sample_rate) / float(new_sample_rate)<br><br>       
 INTERPOLATOR = gr.fractional_interpolator_cc(0, r)<br><br>        self.connect(IN, FILTER, INTERPOLATOR, DEMOD, self.convert, OUT)<br>    self.connect (DEMOD,self.convert2,self.sink1)<br>    def print_data(self):<br>    print "data in sink1 is: ",self.sink1.data()</div><div>---------------</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div></body></html>