Example #1
0
    def setUp(self):
        self.tb = gr.top_block()

        fftl = 512
        waveform = gr.GR_SIN_WAVE
        freq = 0.0
        ampl = 1.0
        offset = 0.0
        cpl = 144 * fftl / 2048
        cpl0 = 160 * fftl / 2048
        slotl = 7 * fftl + 6 * cpl + cpl0
        samp_rate = slotl / 0.0005

        self.sig = gr.sig_source_c(samp_rate, waveform, freq, ampl, offset)
        self.head = gr.head(gr.sizeof_gr_complex, 100000)

        print "amplitude\t" + str(self.sig.amplitude())
        print "frequency\t" + str(self.sig.frequency())
        print "name\t" + str(self.sig.name())
        print "offset\t" + str(self.sig.offset())
        print "samp_rate\t" + str(self.sig.sampling_freq())
        print "waveform\t" + str(self.sig.waveform())

        #print type(self.sig)

        self.est = lte_swig.freq_estimate_c(self.sig, fftl)

        self.tb.connect(self.sig, self.head, self.est)
Example #2
0
    def setUp (self):
        self.tb = gr.top_block ()
        
        
        fftl = 512
        waveform = gr.GR_SIN_WAVE
        freq = 0.0
        ampl = 1.0
        offset = 0.0
        cpl = 144 * fftl / 2048
        cpl0 = 160 * fftl / 2048
        slotl = 7 * fftl + 6 * cpl + cpl0
        samp_rate = slotl / 0.0005

        self.sig = gr.sig_source_c(samp_rate,waveform,freq,ampl,offset)
        self.head = gr.head(gr.sizeof_gr_complex, 100000)
        
        print "amplitude\t" + str(self.sig.amplitude())
        print "frequency\t" + str(self.sig.frequency())
        print "name\t" + str(self.sig.name())
        print "offset\t" + str(self.sig.offset())
        print "samp_rate\t" + str(self.sig.sampling_freq())
        print "waveform\t" + str(self.sig.waveform())
        
        #print type(self.sig)
        
        self.est = lte_swig.freq_estimate_c(self.sig,fftl)
        
        self.tb.connect(self.sig,self.head,self.est)
Example #3
0
    def __init__(self, fftl):
        """
        docstring
	    """
        gr.hier_block2.__init__(self, "hier_freq_estimate_cc",
				gr.io_signature(1,1, gr.sizeof_gr_complex),  # Input signature
				gr.io_signature(1,1, gr.sizeof_gr_complex)) # Output signature

        # Define blocks
        waveform = gr.GR_COS_WAVE
        wave_freq = 0.0
        ampl = 1.0
        offset = 0.0
        cpl = 144 * fftl / 2048
        cpl0 = 160 * fftl / 2048
        slotl = 7 * fftl + 6 * cpl + cpl0
        samp_rate = slotl / 0.0005
        #print fftl
        #print cpl
        #print cpl0
        #print slotl
        #print samp_rate
        self.sig   = gr.sig_source_c(samp_rate, waveform,wave_freq,ampl,offset)
        self.multi = gr.multiply_cc(1)
        self.est   = lte_swig.freq_estimate_c(self.sig,fftl)
        
        self.connect(self,(self.multi,0),self)
        self.connect(self.sig,(self.multi,1) )
        self.connect(self.multi,self.est )