在一系列矩阵中找到周期

时间:2017-06-23 11:18:23

标签: python matrix fft periodicity

下面是包含许多列的csv文件的快照(实际文件非常大)。每列对应于"系统状态"的时间 - 夯实值。我想要找到的是这些列出现的时间段,即系统状态将重复自身以及在什么时间段内。我一直在python中寻找fft2,但现在还没有理解周期提取。请帮助,因为我不是傅立叶变换的新手,也没有先前的知识。

一个矩阵表示在一列中。前两列用于矩阵细胞识别。大多数值都是零但不是全部。

enter image description here

我的程序的算法步骤

import numpy as np

from numpy import fft

#there is mxn array where each column is a state of a system at increasing timestamps.

a=np.array([ [1,2,3,4], [11,12,13,14], [1,2,3,4,], [11,12,13,14], [1,2,3,4], [11,12,13,14] ])

#i have to find the periodicity of this np array where each column is a state of system. hence here state of the system repeats itself at period of 2. 

#if array is as follows

a=np.array([ [1,2,3,4], [11,12,13,14],[2,4,6,8], [1,2,3,4,], [11,12,13,14],[2,4,6,8], [1,2,3,4], [11,12,13,14], [2,4,6,8] ])

#i look periods 3 ......if array is aperiodic I will look for an approximation to period of the array

#can numpy.fftpack is of use to me? can i achieve it using np.fft.fft2(a). I couldnot understand it thouroughly. 

0 个答案:

没有答案