Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #The three-dimension data collected (X,Y,Z) were transformed into a
- #single-dimensional Signal Magnitude Vector SMV (aka The Resultant)
- #SMV = x2 + Y2 + Z2
- X2 = X['X']*X['X']
- Y2 = X['Y']*X['Y']
- Z2 = X['Z']*X['Z']
- #print X['X'].head(2) #Confirmed worked
- #print X2.head(2) #Confirmed worked
- combine = [X2,Y2,Z2, Y]
- parent = pd.concat(combine, axis=1)
- parent['ADD'] = parent.sum(axis=1) #Sum X2,Y2,Z2
- sqr = np.sqrt(parent['ADD']) #Square Root of Sum Above
- sqr.name = 'SMV'
- combine2 = [sqr, Y] #Reduce Dataset to SMV and Class
- parent2 = pd.concat(combine2, axis=1)
- print parent2.head(4)
- "************************* Begin Fourier ****************************"
- from scipy import fftpack
- X = fftpack.fft(sqr)
- f_s = 80 #80 Hertz
- samp = 1024 #samples per segment divided by 12.8 secs signal length
- n = X.size
- timestep = 10
- freqs = fftpack.fftfreq(n, d=timestep)
Add Comment
Please, Sign In to add comment