Question on DQPSK Modulation - issue with output

Dear all,

I am currently trying to implement a pi/4 dqpsk modulator and
demodulator. I
have tried two approaches, one uses the CQPSK.py (included in osmocom’s
TETRA project) and the other uses digital.qpsk.dqpsk_mod. Both of these
approaches have failed to return the same string of bits after the
process
of modulations->demodulation. The input comes from a .dat file and is a
string of bits (tried different sizes, from 2 bits to 32 bits), then the
output of modulation is written to a sink.dat as gr_complex. This file
is
then fed to a demodulator which saves the output to a final.dat. I have
attached important bits of the code which uses qpsk.dqpsk_mod/demod. I
would
greatly appreciate any advice.
Also, could anyone please confirm that what I can achieve a
–PI/4–DQPSK
using the dqpsk_mod?

Best Regards,

Vahid

Modulator:

.
.
.
sample_rate = options.sample_rate
symbol_rate = 18000
sps = 2

IN = gr.file_source(gr.sizeof_gr_complex, options.input_file, repeat 

=
False)
#IN = (1,0,0,0,1,1,0,0)
src = gr.vector_source_b (IN)
MOD = digital.qpsk.dqpsk_mod( samples_per_symbol = sps,
excess_bw=0.35,
log=options.log, gray_coded=True,

                             verbose=options.verbose)

self.connect(src,MOD)
    OUT = gr.file_sink(gr.sizeof_gr_complex, options.output_file)

self.sink1 = gr.vector_sink_f()
self.sink2 = gr.vector_sink_f()

real = gr.complex_to_real()
imag = gr.complex_to_imag()
self.connect(MOD,real)
self.connect(MOD,imag)

self.connect(real,self.sink1)
self.connect(imag,self.sink2)
self.connect(MOD,OUT)
def print_data(self):
print "data in sink1 is: ",self.sink1.data()
print "data in sink2 is: ",self.sink2.data()

.
.
.

Demodulator:

sample_rate = options.sample_rate
symbol_rate = 18000
sps = 2
# output rate will be 36,000
ntaps = 11 * sps
new_sample_rate = symbol_rate * sps

    channel_taps = gr.firdes.low_pass(1.0, sample_rate,

options.low_pass, options.low_pass * 0.1, gr.firdes.WIN_HANN)

    FILTER = gr.freq_xlating_fir_filter_ccf(1, channel_taps,

options.calibration, sample_rate)
IN = gr.file_source(gr.sizeof_gr_complex, options.input_file)
#IN = (1,1,0,1,1,1,0,0)
#src = gr.vector_source_b (IN)
DEMOD = digital.qpsk.dqpsk_demod( samples_per_symbol = sps,
excess_bw=0.35, gray_coded=True,
log=options.log,

                             verbose=options.verbose)


OUT = gr.file_sink(gr.sizeof_char, options.output_file)

self.sink1 = gr.vector_sink_b()

    r = float(sample_rate) / float(new_sample_rate)

    INTERPOLATOR = gr.fractional_interpolator_cc(0, r)

    self.connect(IN, FILTER, INTERPOLATOR, DEMOD, OUT)
self.connect(DEMOD,self.sink1)
def print_data(self):
print "data in sink1 is: ",self.sink1.data()


View this message in context:
http://old.nabble.com/Question-on-DQPSK-Modulation---issue-with-output-tp33950307p33950307.html
Sent from the GnuRadio mailing list archive at Nabble.com.

Hi Vahid,

First I’d try using a much longer string of bits and see if that help.

Second I’d find an example in gnuradio
(gr-digital/python/qa_constellation.py should have a working dqpsk
test) and then work from there.

Thirdly if you want pi/4-dqpsk you won’t be able to use the standard
dqpsk_mod and dqpsk_demod, but will need to define a two-dimensional
constellation and use the generic_mod and generic_demod blocks. The
two-dimensional constellation would be defined something like:

normal_qpsk_points = [blah, blah, blah, blah]
rotated_qpsk_points = [blah, blah, blah, blah]
two_d_points = []
for p in normal_qpsk_points:
for q in rotated_qpsk_points:
two_d_points += [p, q]
pi4dqpsk_constellation = digital.constellation_calcdist(two_d_points,
[], 4, 2)

Cheers,
Ben

On Sun, Jun 3, 2012 at 4:31 PM, Ben R. [email protected] wrote:

constellation and use the generic_mod and generic_demod blocks. The
two-dimensional constellation would be defined something like:

normal_qpsk_points = [blah, blah, blah, blah]
rotated_qpsk_points = [blah, blah, blah, blah]
two_d_points = []
for p in normal_qpsk_points:
for q in rotated_qpsk_points:
two_d_points += [p, q]
pi4dqpsk_constellation = digital.constellation_calcdist(two_d_points, [], 4, 2)

Just checked the code and it looks like multi-dimensional
constellations aren’t supported yet by generic_mod and generic_demod.
Another way might be to edit digital.constellation_receiver_cb so that
it shifts the phase back and forth by pi/4.