window code

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

window code

Patrick Strasser

I'm trying the code from gr.window. For the blackmanharris window
everthing works fine:

 >>> from gnuradio import window
 >>> window.blackmanharris(3)
[0.21746999999999997, 0.21747000000000014, 0.21746999999999989]

but bartlett has problems findeing midn:

 >>> window.bartlett(7)
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File "/usr/lib/python2.4/site-packages/gnuradio/window.py", line 91,
in bartlett
     for index in xrange(midn(fft_size)+1):
NameError: global name 'midn' is not defined

The code for bartlett is:

def bartlett(fft_size):
     mfrq = freq(fft_size)
     angle = 0
     window = [0 for i in range(fft_size)]
     j = fft_size-1
     for index in xrange(midn(fft_size)+1):
         window[j] = window[index] = angle
         angle += freq
         j -= 1
     return window

window.midm1 and window.midp1 exist, though.

Bit rot?

Engineers motto: cheap, good, fast: choose any two
Patrick Strasser <patrick dot strasser at  tugraz dot at>
Student of Telematik, Techn. University Graz, Austria

Discuss-gnuradio mailing list
[hidden email]