commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r5666 - in grc/branches/jblum_work/src: . SignalBlockD


From: jblum
Subject: [Commit-gnuradio] r5666 - in grc/branches/jblum_work/src: . SignalBlockDefs
Date: Mon, 4 Jun 2007 12:49:57 -0600 (MDT)

Author: jblum
Date: 2007-06-04 12:49:57 -0600 (Mon, 04 Jun 2007)
New Revision: 5666

Modified:
   grc/branches/jblum_work/src/MathExprParser.py
   grc/branches/jblum_work/src/SignalBlockDefs/Filters.py
   grc/branches/jblum_work/src/SignalBlockDefs/SignalBlockTree.py
Log:
supports negative exponents for floating point format, added filter delay block

Modified: grc/branches/jblum_work/src/MathExprParser.py
===================================================================
--- grc/branches/jblum_work/src/MathExprParser.py       2007-06-04 17:02:48 UTC 
(rev 5665)
+++ grc/branches/jblum_work/src/MathExprParser.py       2007-06-04 18:49:57 UTC 
(rev 5666)
@@ -327,7 +327,7 @@
        for i,element in enumerate(elements):
                if i == 0 and element == '-':   #first element was a minus
                        rectified_elements.extend(['-1', '*'])
-               elif i != 0 and element == '-': #minus found!
+               elif i != 0 and element == '-' and i+1 != len(elements):        
#minus found!
                        if _is_operator(elements[i-1]) or \
                        _is_open_bracket(elements[i-1]) or \
                        _is_comma(elements[i-1]):       #negative implied
@@ -335,6 +335,9 @@
                                else: #^ proceeds - in order of ops, remove the 
^ and append ^- as a special operator
                                        rectified_elements.pop()        #remove 
last element
                                        rectified_elements.append('^-')
+                       elif elements[i-1][-1] == 'e' and 
_is_number(elements[i-1][0:-1]):      #found a floating point format 
+                               f = rectified_elements.pop()    #remove last 
element
+                               elements[i+1] = "%s-%s"%(f, elements[i+1])
                        else: rectified_elements.append(element)        
#regular minus
                else: rectified_elements.append(element)        #non minus
        return rectified_elements

Modified: grc/branches/jblum_work/src/SignalBlockDefs/Filters.py
===================================================================
--- grc/branches/jblum_work/src/SignalBlockDefs/Filters.py      2007-06-04 
17:02:48 UTC (rev 5665)
+++ grc/branches/jblum_work/src/SignalBlockDefs/Filters.py      2007-06-04 
18:49:57 UTC (rev 5666)
@@ -123,6 +123,23 @@
        sb.add_param('FB Taps', FloatVector())
        return sb, lambda fg, fftaps, fbtaps: fcn(fftaps.parse(), 
fbtaps.parse())
 
+def FilterDelay(sb):
+       fcn = gr.filter_delay_fc
+       sb.add_input_socket('in1', Float())
+       sb.add_input_socket('in2', Float(), optional=True)
+       sb.add_output_socket('out', Complex())
+       sb.add_param('Taps', FloatVector())
+       sb.set_docs('''\
+The block takes one or two float stream and outputs a complex stream. \
+If only one float stream is input, \
+the real output is a delayed version of this input and the imaginary output is 
the filtered output. \
+If two floats are connected to the input, \
+then the real output is the delayed version of the first input, \
+the imaginary output is the filtered output. \
+The delay in the real path accounts for the group delay introduced by the 
filter in the imaginary path.\
+''')
+       return sb, lambda fg, taps: fcn(taps.parse())
+
 ###########################################################################
 #      Special filters using taps generators
 ###########################################################################

Modified: grc/branches/jblum_work/src/SignalBlockDefs/SignalBlockTree.py
===================================================================
--- grc/branches/jblum_work/src/SignalBlockDefs/SignalBlockTree.py      
2007-06-04 17:02:48 UTC (rev 5665)
+++ grc/branches/jblum_work/src/SignalBlockDefs/SignalBlockTree.py      
2007-06-04 18:49:57 UTC (rev 5666)
@@ -110,6 +110,7 @@
                                ('Freq Xlating FIR Filter', 
Filters.FreqXlatingFIRFilter),              
                                ('Rational Resampler', 
Filters.RationalResampler),      
                                ('IIR Filer', Filters.IIRFiler),        
+                               ('Filter Delay', Filters.FilterDelay),
                        ]),             
                        ('Filters', [                   
                                ('Low Pass Filter', Filters.LowPassFilter),





reply via email to

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