当前位置: 首页>>代码示例>>Python>>正文


Python KHR1readcsv.read方法代码示例

本文整理汇总了Python中KHR1readcsv.read方法的典型用法代码示例。如果您正苦于以下问题:Python KHR1readcsv.read方法的具体用法?Python KHR1readcsv.read怎么用?Python KHR1readcsv.read使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KHR1readcsv的用法示例。


在下文中一共展示了KHR1readcsv.read方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: writeout

# 需要导入模块: import KHR1readcsv [as 别名]
# 或者: from KHR1readcsv import read [as 别名]
def writeout():

    l = []
    out = ''
    ser = serial.Serial("/dev/ttyUSB0", 115200)
    
    l = KHR1readcsv.read("/home/msunardi/Documents/thesis-stuff/KHR-1-motions/push_ups_data.csv")

    ser.open()

    if ser.isOpen():
        for x in l[0]:
            out += (str(x))

        print out
        ser.write(out)

    ser.close()
开发者ID:msunardi,项目名称:soundmotion,代码行数:20,代码来源:py_integration_test1.py

示例2: adjustGain

# 需要导入模块: import KHR1readcsv [as 别名]
# 或者: from KHR1readcsv import read [as 别名]
        return original


    #=== ADJUST GAINS FOR INDIVIDUAL CHANNEL ===
    def adjustGain(self, gain, adjustment):

        return list(numpy.add(gain, numpy.multiply(gain, adjustment)))
            

""" ==============================================
	TESTS
    ==============================================
"""

motion = KHR1readcsv.read("/home/msunardi/Documents/thesis-stuff/KHR-1-motions/push_ups_data.csv")
#motion = KHR1readcsv.read("/home/msunardi/Python-project/some_data.csv")
print "motion: ", motion

#motion = [[1,3,4,5,6,7,8,9,10,42,12,53,12,10,55,12,23],[32,42,12,63,23,23,53,1,5,6,2,32,17,84,23,10,44],[12,42,22,31,9,8,4,24,1,52,12,5,12,23,7,11,20]]

#print "motion list: ", motion

filt = kfilter(len(motion[0]))
#print "fb = ", filt.fb

filtered = []
filtered = filt.filterAll(motion)
gains = []
gains = filt.getGains(filtered)
开发者ID:msunardi,项目名称:soundmotion,代码行数:31,代码来源:multiresfilter2_for_report.py

示例3: readCSV

# 需要导入模块: import KHR1readcsv [as 别名]
# 或者: from KHR1readcsv import read [as 别名]
 def readCSV( self, path ):
     return motion.read(path)
开发者ID:msunardi,项目名称:soundmotion,代码行数:4,代码来源:mosynth7_p.py

示例4: MotionSynthesizer

# 需要导入模块: import KHR1readcsv [as 别名]
# 或者: from KHR1readcsv import read [as 别名]
        - KHR1readcsv:	read .csv motion file, and format it into a 2-D tuple: a list of KHR-1 channels, and each element is a list of motion for the channel
        - interpolation: interpolate points
        - multiresfilter: multiresolution filtering

    =========================================
"""

ms = MotionSynthesizer()

#=== 1. Read motion file
mo_list = []
#mo_list = motion.read("/home/msunardi/Documents/thesis-stuff/KHR-1-motions/push_ups_data.csv")
#mo_list = motion.read("/home/msunardi/Documents/thesis-stuff/KHR-1-motions/somersault.csv")
#mo_list = motion.read("/home/msunardi/Documents/thesis-stuff/KHR-1-motions/sweetescape_surf_right.csv")
#mo_list = motion.read("/home/msunardi/Documents/thesis-stuff/KHR-1-motions/gait_back_roll.csv")
mo_list = motion.read("/home/msunardi/Documents/thesis-stuff/KHR-1-motions/better_fwd_walk_data.csv")

#mo_list = readCSV("/home/msunardi/Documents/thesis-stuff/KHR-1-motions/sweetescape_surf_right.csv")

#=== 2. Interpolate motion list >>> moved to last
#rs = ms.interpolate(mo_list)
#for r in zip(*rs):
#    print r
#=== 3. Apply multiresolution filtering
#filtered = []

#=== 3.a. Extract low pass sequence by filtering (convolving with kernel)
#filtered = ms.multiresFiltering(rs)
#filtered = ms.multiresFiltering(mo_list)

i=0
开发者ID:msunardi,项目名称:soundmotion,代码行数:33,代码来源:mosynth7_p.py

示例5: motion

# 需要导入模块: import KHR1readcsv [as 别名]
# 或者: from KHR1readcsv import read [as 别名]
        return self.bpb.bringItOn(filtered_data)


""" =========================================
    Test:
    - read KHR-1 .csv motion file
    - interpolate the points
    - ready the interpolated motion (in RCB-1 word format) for serial out    Components:
    - KHR1readcsv:  read .csv motion file, and format it into a 2-D tuple: a list of KHR-1 channels, and each element is a list of motion for the channel
    - interpolation: interpolate points
    - filter: apply filtering to interpolated motion and get frequency bands for each channel
    - bandpass: find bandpass for each frequency bands

    =========================================
"""

mo_list = []
mo_list = motion.read("/home/msunardi/Documents/thesis-stuff/KHR-1-motions/push_ups_data.csv")
#mo_list = motion.read("/home/msunardi/Documents/thesis-stuff/KHR-1-motions/somersault.csv")
#mo_list = motion.read("/home/msunardi/Documents/thesis-stuff/KHR-1-motions/sweetescape_surf_right.csv")

kms = KHR1MotionSignal(mo_list)

print kms.returnBandsData(kms.filterData(kms.interpolate(mo_list)))

"""writer = csv.writer(open("test_convolved_data.csv", "wb"))

for rows in filtered:
    writer.writerows(rows)
"""
开发者ID:msunardi,项目名称:soundmotion,代码行数:32,代码来源:KHR1_interpol_filtering2.py

示例6: readCSV

# 需要导入模块: import KHR1readcsv [as 别名]
# 或者: from KHR1readcsv import read [as 别名]
def readCSV( path ):
    return motion.read(path)
开发者ID:msunardi,项目名称:soundmotion,代码行数:4,代码来源:KHR1_re_in_cv3.py

示例7: interpolate

# 需要导入模块: import KHR1readcsv [as 别名]
# 或者: from KHR1readcsv import read [as 别名]
	- read KHR-1 .csv motion file
	- interpolate the points
	- apply multiresolution filtering to the interpolated points    

    Modules:
	- KHR1readcsv:	read .csv motion file, and format it into a 2-D tuple: a list of KHR-1 channels, and each element is a list of motion for the channel
	- interpolation: interpolate points
        - multiresfilter: multiresolution filtering

    =========================================
"""

mo_list = []
#mo_list = motion.read("/home/msunardi/Documents/thesis-stuff/KHR-1-motions/push_ups_data.csv")
#mo_list = motion.read("/home/msunardi/Documents/thesis-stuff/KHR-1-motions/somersault.csv")
mo_list = motion.read("/home/msunardi/Documents/thesis-stuff/KHR-1-motions/sweetescape_surf_right.csv")


rs = interpolate(mo_list)
filtered = []
filtered = multiresFiltering(rs)

i=0
j=0

for freq in filtered:
    print "Frequency bands for Channel ",i," :"
    for fbd in freq:
        print "CH:",i,", FB_",j," = ", fbd
        j += 1
    j = 0
开发者ID:msunardi,项目名称:soundmotion,代码行数:33,代码来源:KHR1_re_in_cv2.py


注:本文中的KHR1readcsv.read方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。