Wednesday, January 21, 2015

We know Fibonacci sequence peptides x (n) = x (n-1) + x (n-2), peptides and x (0) = 0, x (1) = 1. F


PyCon.TW 2012 come to an end in a few days ago, will be the keynote speaker Travis Oliphant told a real example of a linear filter for use Fibonacci in only a slide presentation, where I try to explain what action do break down. Slide content http://www.slideshare.net/pycontw/largescale-arrayoriented-computing-with-python
We know Fibonacci sequence peptides x (n) = x (n-1) + x (n-2), peptides and x (0) = 0, x (1) = 1. Fibonacci sequence generation are often recursive introduction of textbooks a good example, but as shown in Travis Oliphant, using recursive make real complexity is exponential growth, but we can also use SciPy inside the linear filter to make it real, as follows: from scipy.signal import lfilter from numpy import zeros b = array ([1.0]) a = array ([1, -1, -1.]) zi = array ([0, 1.0]) def fib3a (N): y, zf = lfilter (b, a, zeros (N, dtype = float), zi = zi) return y
I look above to slow decomposition method for real. First lfilter at b = array ([1.0]) and a = array ([1, -. 1, -1]) of the cases will have b (0) x (n) = a (0) y (n) + a (1) y (n-1) + a (2) y (n-2) equation, substituting a, b, we can obtain x (n) = y (n) - y (n-1) - y (n-2), and the third parameter is the x lfilter sequence is zeros (N, dtype = float), ie enter all zeros, the above equation becomes 0 = y (n) - y (n-1) - y (n-2), the y (n) moves to the left in the equation, it is possible to obtain y (n) = y (n-1) + y (n-2), This is the Fibonacci sequence notation it! final y (n) is the n-th Fibonacci number of columns. In addition, zi = array ([0,1.0]) is executed when lfilter start, delay element peptides inside the element, which is the value of y (0) and y (1) a.
2014 (6) December (1) August (3) March (1) February (1) 2013 (1) February (1) 2012 (25) December (5) November (4) October (6) August (3) June (1) with Linear Filter (IIR) to implement as a Fibonacci sequence April (2) February (1) January (3) 2011 (3) November (1 ) October (2) 2007 (2) November (2)
Engineering training and humanities peptides


No comments:

Post a Comment