Esempio n. 1
0
    plt.rc("font", **font)

    data_array_x = []
    data_array_y = []

    os.makedirs(output_dir, exist_ok=True)  #用于递归创建目录

    print("Stage %i: Data loading and preparing" % stage)

    SigROI = [18, 19, 20, 26]

    init_data_()

    for j in range(len(SigROI)):

        data_all = ripper.extract('sample_data', DATA_FILE, [SigROI[j]])

        c, d = ripper.x_y(data_all[0][SigROI[j]])

        data = np.array([np.array(c), np.array(d)])

        print("Loaded %s" % DATA_FILE)

        roi = (150000, 200000)
        print(roi)
        x = data[0, roi[0]:roi[1]]
        y = data[1, roi[0]:roi[1]]

        sample_rate = 1.0 / (x[1] - x[0])

        y = butter_filter(y, HIGH_PASS_CUTOFF, sample_rate, btype="high")
Esempio n. 2
0
        exit(1)



if __name__ == "__main__":
    font = {"size": 22}

    plt.rc("font", **font)

    os.makedirs(output_dir, exist_ok=True)

    print("Stage %i" % stage)

    init_data_()

    data_all = ripper.extract('sample_data', DATA_FILE, [SENSOR_NUMBER])

    c,d = ripper.x_y(data_all[0][SENSOR_NUMBER])

    data = np.array([np.array(c),np.array(d)])

    print("Loaded %s" % DATA_FILE)

    roi = (60000, 90000)
    x = data[0, roi[0]:roi[1]]
    y = data[1, roi[0]:roi[1]]

    plot(data[0], data[1], "Время, с", "U, В")

    print("Stage %i: High pass filtering" % stage)
Esempio n. 3
0
    plt.rc("font", **font)

    data_array_x = []
    data_array_y = []

    os.makedirs(output_dir, exist_ok=True)

    print("Stage %i: Data loading and preparing" % stage)

    arr = [18, 19, 20, 26]

    init_data_()

    for j in range(len(arr)):

        data_all = ripper.extract('sample_data', DATA_FILE, [arr[j]])

        c, d = ripper.x_y(data_all[0][arr[j]])

        data = np.array([np.array(c), np.array(d)])

        print("Loaded %s" % DATA_FILE)

        roi = (150000, 200000)
        print(roi)
        x = data[0, roi[0]:roi[1]]
        y = data[1, roi[0]:roi[1]]

        sample_rate = 1.0 / (x[1] - x[0])

        y = butter_filter(y, HIGH_PASS_CUTOFF, sample_rate, btype="high")