discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] Question on DQPSK Modulation - issue with output


From: Vahid Behzadan
Subject: [Discuss-gnuradio] Question on DQPSK Modulation - issue with output
Date: Sat, 2 Jun 2012 16:20:15 -0700 (PDT)

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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]