Merge branch 'flattopwindow' of http://gnuradio.org/git/jblum
authorJohnathan Corgan <jcorgan@corganenterprises.com>
Thu, 29 Oct 2009 13:52:53 +0000 (06:52 -0700)
committerJohnathan Corgan <jcorgan@corganenterprises.com>
Thu, 29 Oct 2009 13:52:53 +0000 (06:52 -0700)
Merge-fix: Remove debugging print
Merge-fix: Update copyrights

* 'flattopwindow' of http://gnuradio.org/git/jblum:
  Added window option to wxgui fft and waterfall sink.
  redid cos windows, added flattop and nuttall_cfd

1  2 
gnuradio-core/src/python/gnuradio/window.py
gr-wxgui/src/python/fftsink_gl.py
gr-wxgui/src/python/fftsink_nongl.py
gr-wxgui/src/python/waterfallsink_gl.py

index fb4a10675be587c1371d1d4156d7ce3fc3e6554e,7f6d62b7c0c6be7efca17667ed8c110cd90fa6cb..e109a98920300a14df862e5fede79fd21cd27b93
@@@ -1,5 -1,5 +1,5 @@@
  #
--# Copyright 2004,2005 Free Software Foundation, Inc.
++# Copyright 2004,2005,2009 Free Software Foundation, Inc.
  # 
  # This file is part of GNU Radio
  # 
@@@ -187,4 -161,20 +161,20 @@@ def kaiser(fft_size,beta)
          window[index] = izero(beta*math.sqrt(1.0 - (index * inm1)*(index * inm1))) * ibeta
      return window
  
-     
+ # Closure to generate functions to create cos windows
+ def coswindow(coeffs):
+     def closure(fft_size):
+         window = [0] * fft_size
 -        print list(enumerate(coeffs))
++        #print list(enumerate(coeffs))
+         for w_index in range(fft_size):
+             for (c_index, coeff) in enumerate(coeffs):
+                 window[w_index] += (-1)**c_index * coeff * math.cos(2.0*c_index*math.pi*(w_index+0.5)/(fft_size-1))
+         return window
+     return closure
+ blackmanharris = coswindow((0.35875,0.48829,0.14128,0.01168))
+ nuttall = coswindow((0.3635819,0.4891775,0.1365995,0.0106411))  # Wikipedia calls this Blackman-Nuttall
+ nuttall_cfd = coswindow((0.355768,0.487396,0.144232,0.012604)) # Wikipedia calls this Nuttall, continuous first deriv
+ flattop = coswindow((1.0,1.93,1.29,0.388,0.032)) # Flat top window, coeffs from Wikipedia
+ rectangular = lambda fft_size: [1]*fft_size
index 9d683d69795c3cf7f7fe320a5fb5dd262a215347,9b2f9a487e453404b304ef90034e8dfe55d024ad..8ddea9a8e3fd0109a737a8f5f49a28478e604b5d
@@@ -1,5 -1,5 +1,5 @@@
  #
--# Copyright 2008 Free Software Foundation, Inc.
++# Copyright 2008,2009 Free Software Foundation, Inc.
  #
  # This file is part of GNU Radio
  #
index ca5e91fdbea3d708a7927281505c8a133ad105bf,b3a48a716dfe15c60ce74db19a408a2fe4859534..937eb27cce936ad14c5243ecc66568bb750833cb
@@@ -1,6 -1,6 +1,6 @@@
  #!/usr/bin/env python
  #
--# Copyright 2003,2004,2005,2006,2007 Free Software Foundation, Inc.
++# Copyright 2003,2004,2005,2006,2007,2009 Free Software Foundation, Inc.
  # 
  # This file is part of GNU Radio
  # 
index 37844399ed6337e1a9fdf992c3dc0b63b2b98b1c,c6b0df65c6b5c481b7333f2e02a985199013ef0e..c2c4e8df7a1481ce165c5746ae7f65610aebd3ef
@@@ -1,5 -1,5 +1,5 @@@
  #
--# Copyright 2008 Free Software Foundation, Inc.
++# Copyright 2008,2009 Free Software Foundation, Inc.
  #
  # This file is part of GNU Radio
  #