实时提取脑波的delta,theta,alpha,beta 对于baseline的比率差
import os
import pandas as pd
import numpy as np
def mkdir(path_3):
folder = os.path.exists(path_3)
if not folder: # 判断是否存在文件夹如果不存在则创建为文件夹
os.makedirs(path_3) # makedirs 创建文件时如果路径不存在会创建这个路径
print("--- new folder... ---")
print("--- OK ---")
else:
print("--- There is this folder! ---")
def ref_read_csv():
data = pd.DataFrame(pd.read_csv(name_path + name, encoding='CP949', engine='python'))
Delta = np.array(data['Delta'])
Theta = np.array(data['Theta'])
Alpha = np.array(data['Alpha'])
Beta = np.array(data['Beta'])
Delta_M = np.mean(Delta)
Theta_M = np.mean(Theta)
Alpha_M = np.mean(Alpha)
Beta_M = np.mean(Beta)
a = np.array([Delta_M, Theta_M, Alpha_M, Beta_M])
all = np.sum(a)