No simple_correlator output

Hello,

I’m still working on QPSK modulation [1]. I think I found the solution
for
bit shifting (simple_framer/simple_correlator). I used uchar_to_float to
convert the stream of unsigned char coming from the dqpsk demodulator to
the
stream of float expected at the simple_correlator input.


DEMODULATION

    ...
    objDemod = dqpsk.dqpsk_demod()

conversion = gr.uchar_to_float()
correlator = gr.simple_correlator(p_size)
fg.connect(gr.file_source(gr.sizeof_gr_complex,
“Modulated.dat”),
objDemod, conversion, correlator,

gr.file_sink(gr.sizeof_char,“Result.txt”))

    ...

However, there seems to be no simple_correlator output, Result.txt file
is
empty whereas I’m sure of having data coming out of uchar_to_float.

Regards,
Irene


MODULATION


bytes_src = gr.vector_source_b(arrTxt, False)
framer = gr.simple_framer(p_size)
objMod = dqpsk.dqpsk_mod()
fg.connect(bytes_src, framer,
objMod,gr.file_sink(gr.sizeof_gr_complex,“Modulated.dat”))

[1] http://www.nabble.com/Modulation-problem---td17316660.html#a17316660

View this message in context:
http://www.nabble.com/No-simple_correlator-output-tp17471158p17471158.html
Sent from the GnuRadio mailing list archive at Nabble.com.

I tried simplifying the problem, I have deleted all the DQPSK modulation
part. I just kept the simple_framer, uchar_to_float converter and the
simple_correlator connected as follows:

#!/usr/bin/env python

from gnuradio import gr,audio
from array import array # Array
import wx,os,sys

import dqpsk # QPSK Modulation

Define dialog component

ID_START = 101
ID_EXIT = 103

Packet size

p_size = 1024

-----------------------------------------

Function: Read file and return data array

-----------------------------------------

def ReadFile (arrTxt):
file = open(‘./Test/Test.txt’,‘r’)
while True:
data = file.read(1) # Read data, 1 byte each time
if len(data) == 0: # If reach EOF, finish the loop
break
arrTxt.append(ord(data)) # Store data(int) into array
return arrTxt

---------------------------------------

Class: Main window

---------------------------------------

class MainWindow(wx.Frame):
“”" We simply derive a new class of Frame. “”"
def init(self, parent, id, title):
wx.Frame.init(self, parent, wx.ID_ANY, title, size = (320, 240))
self.control = wx.TextCtrl(self, 1, style=wx.TE_MULTILINE)
self.CreateStatusBar() # A statusbar in the bottom of the window
#Setting up the menu
filemenu=wx.Menu()
filemenu.Append(ID_START, “&Start”, “Start test”)
filemenu.AppendSeparator()
filemenu.Append(ID_EXIT, “&Exit”, “Terminate the program”)
# Creating the menubar
menuBar=wx.MenuBar()
menuBar.Append(filemenu, “&File”,) #Adding the filemenu to the
MenuBar
self.SetMenuBar(menuBar) #Adding the MenuBar to the Frame
content
wx.EVT_MENU(self, ID_START, self.OnStartTest)
wx.EVT_MENU(self, ID_EXIT, self.OnExit) #attach the menu-event
ID_EXIT to method self.OnExit
self.Show(True) # Note the capital on ‘True’

def OnStartTest(self, e):

arrTxt = array(‘B’)
arrTxt.append(0)
arrTxt = ReadFile(arrTxt)
# print ‘Total = ‘, len(arrTxt), ‘bytes’
self.control.SetValue(’[Read File] - Finish!’)

Construct graph

    fg = gr.top_block()
    arrTxt[0] = 0  # you know, for the diff encoding stuff
    bytes_src = gr.vector_source_b(arrTxt, False)

framer = gr.simple_framer(p_size)
conversion = gr.uchar_to_float()
correlator = gr.simple_correlator(p_size)
dst = gr.file_sink(gr.sizeof_char,“Frame_test.txt”)
fg.connect(bytes_src, framer, conversion, correlator, dst)
fg.start()
raw_input(‘Test running…’)
fg.stop()

def OnExit(self, e):
    self.Close(True) #Close the frame, note capitalization of 'T' in

‘True’

---------------------------------------

Main

---------------------------------------

app = wx.PySimpleApp()
frame = MainWindow(None, -1, “QPSK_Test”)
app.MainLoop()

Still nothing coming out of the simple_correlator…


View this message in context:
http://www.nabble.com/No-simple_correlator-output-tp17471158p17490080.html
Sent from the GnuRadio mailing list archive at Nabble.com.

irene159 wrote:

DEMODULATION

    ...

[1] http://www.nabble.com/Modulation-problem---td17316660.html#a17316660


View this message in context:
http://www.nabble.com/No-simple_correlator-output-tp17471158p17490196.html
Sent from the GnuRadio mailing list archive at Nabble.com.