[Top][All Lists]

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

[Discuss-gnuradio] Help using check_lfsr_32k_s in fsk_rx.py

From: Michael Quinn
Subject: [Discuss-gnuradio] Help using check_lfsr_32k_s in fsk_rx.py
Date: Sun, 13 Nov 2005 14:34:55 -0500

I am attempting to modify the provided FSK algorithms to use a standardized method for determining the transmission error rate.  In the fsk_tx file, I’m trying to use the lfsr_32k_source_s instead of a file source as the source for the transmitter.  In the fsk_rx file, I’m trying to use check_lfsr_32k_s to determine how accurately the data was received.  I have written modules that will convert shorts to bytes and bytes to shorts, in order to integrate the lfsr output into the existing FSK programs.  I am also able to transmit a signal using the lfsr_32k_source_s.  However, on the receive end, I am confused about how to use and where to call the ntotal, nright, and runlength functions to determine how accurately the data was received.  I need these functions to run after all of the data being transmitted has been received.  I was trying to use benchmark_usb.py as an example.  However, I am confused about what exactly the FPGA_MODE_LOOPBACK is.  Also, in the benchmark_usb.py implementation, ntotal, nright, and runlength are called after the fg.run command.  In the fsk_rx.py, graphs and therefore fg.run are not used, and I don’t understand how to perform a similar implementation of this in the fsk_rx.py program. 


My questions are:


1.  What is the USRP digital loop back mode?

2.  Using the check_lfsr_32k_s function in the fsk_rx.py program, how can I call ntotal, nright, and runlength only after receiving all of the transmitted data instead of immediately after the blocks are connected?


Any insights into these issues would be helpful.


Thank you,

Michael Q.



fsk_rx.py Program:


        data_rate = options.data_rate

        self.samples_per_symbol = 8

        self.usrp_decim = int (64e6 / self.samples_per_symbol / data_rate)

        self.fs = data_rate * self.samples_per_symbol

        payload_size = 1024             # bytes


        print "data_rate = ", eng_notation.num_to_str(data_rate)

        print "samples_per_symbol = ", self.samples_per_symbol

        print "usrp_decim = ", self.usrp_decim

        print "fs = ", eng_notation.num_to_str(self.fs)


        max_deviation = data_rate / 4


        u = usrp.source_c (0, self.usrp_decim, 1, options.mux, 0)

        u.set_rx_freq (0, -options.cordic_freq)

        u.set_pga(0, options.gain)

        u.set_pga(1, options.gain)


        filter_taps =  gr.firdes.low_pass (1,                   # gain

                                           self.fs,             # sampling rate

                                           data_rate / 2 * 1.1, # cutoff

                                           data_rate,           # trans width



        print "len = ", len (filter_taps)


        filter = gr.fir_filter_ccf (1, filter_taps)


        k = 1      

        fmdemod = gr.quadrature_demod_cf (k)


        corr = gr.simple_correlator (payload_size)


        bytes_to_shorts = howto.bytes_to_shorts ()

        stream_length = 8*1000000   # length of stream to examine in bits


        head = gr.head (gr.sizeof_short, stream_length/16)

        check = gr.check_lfsr_32k_s ()


        ntotal = check.ntotal ()

        nright = check.nright ()

        runlength = check.runlength ()


        print "ntotal    =", ntotal

        print "nright    =", nright

        print "runlength =", runlength

        print "delta     =", ntotal - runlength


        self.connect (u, filter)

        self.connect (filter, fmdemod)

        self.connect (fmdemod,corr)

        self.connect (corr, bytes_to_shorts)

        self.connect (bytes_to_shorts, check)  


def main ():

    app = stdgui.stdapp (fsk_rx_graph, "FSK Rx")

    app.MainLoop ()


if __name__ == '__main__':

    main ()

reply via email to

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