示例#1
0
def convertToSCV(inputFolder, outputFolder):
    """
        Standard function to convert wave files in folders
        to their respective csv files
    """
    src = files.listDir(inputFolder)
    for f in src:
        waves = wave.loadWave(inputFolder + f)
        frames = wave.getSamples(waves)
        files.write(outputFolder + f[:-4] + ".csv", frames)
示例#2
0
def convertToSCV(inputFolder, outputFolder):
    """
        Standard function to convert wave files in folders
        to their respective csv files
    """
    src = files.listDir(inputFolder)
    for f in src:
        waves = wave.loadWave(inputFolder+f)
        frames = wave.getSamples(waves)
        files.write(outputFolder + f[:-4] + ".csv", frames)
示例#3
0
        aux = hilbert(data[1][i:i + step])
        print(data[0][i])
        print(aux)
        res = np.append(res, aux)
        i += 100
    return np.append([range(len(res))], [res], axis=0)


if __name__ == "__main__":
    """ Unit tests """
    import sys
    import utils.waves as wave
    import utils.charts as chart

    waves = wave.loadWave(sys.argv[2])
    result = wave.getSamples(waves)
    print(result)
    # chart.drawGraph(result)
    result = movingAverage(result, sys.argv[1])
    print(result)
    # chart.drawGraph(result)

    result = movingAverage(result, 8)
    result = movingAverage(result, 6)

    result = movingAverage(np.fliplr(result), 4)
    result = movingAverage(result, 8)
    result = movingAverage(result, 6)
    result = np.fliplr(result)

    # print(result)
示例#4
0
def stdRun(path):
    waves = wave.loadWave(path)
    frames = wave.getSamples(waves)
    frames = stdClean(frames)
    return pul.findBeats(frames, 4, 6)
示例#5
0
    for i in range(0, size, step):
        aux = 0.0
        for j in range(ranges):
            aux += data[1][i+j]
        aux /= ranges
        for j in range(ranges):
            data[1][i+j] = aux
    return  data

import sys
import utils.waves as wave
import utils.charts as chart
if __name__ == "__main__":
    """ Unit tests """
    waves = wave.loadWave(sys.argv[2])
    result = wave.getSamples(waves)
    print(result)
    # chart.drawGraph(result)
    result = movingAverage(result, sys.argv[1])
    print(result)
    # chart.drawGraph(result)

    result = movingAverage(result, 8)
    result = movingAverage(result, 6)

    result = movingAverage(np.fliplr(result), 4)
    result = movingAverage(result, 8)
    result = movingAverage(result, 6)
    result = np.fliplr(result)

    # print(result)