예제 #1
0
                        time_domain_features = eeg_features_exct.extractTimeDomainAll(
                            eeg_filtered)
                        freq_domain_features = eeg_features_exct.extractFrequencyDomainAll(
                            eeg_filtered)
                        plf_features = eeg_features_exct.extractPLFFeatures(
                            eeg_filtered)
                        power_features = eeg_features_exct.extractPowerFeatures(
                            eeg_filtered)
                        eeg_features = np.concatenate([
                            time_domain_features, freq_domain_features,
                            plf_features, power_features
                        ])

                        # extract cvx of eda and time domain of ppg to check whether the inputs are not disorted
                        cvx_features = eda_features_exct.extractCVXEDA(eda)
                        scr_features = eda_features_exct.extractSCRFeatures(
                            eda)
                        ppg_time = ppg_features_exct.extractTimeDomain(ppg)
                        eda_features = np.concatenate([
                            cvx_features,
                            eda_features_exct.extractMFCCFeatures(
                                eda, min_len=min_eda_len), scr_features
                        ])
                        ppg_features = np.concatenate([
                            ppg_time,
                            ppg_features_exct.extractFrequencyDomain(ppg),
                            ppg_features_exct.extractNonLinear(ppg)
                        ])

                        # extract ecg resp features
                        ecg_resp_time_domain = ecg_resp_features_exct.extractTimeDomain(
                            ecg_resp)
from GSR.GSRFeatures import PPGFeatures, EDAFeatures
from Conf import Settings as set
import pandas as pd

data = pd.read_csv("..\\Data\\Dummy\\GSR_sample.csv", header=[0, 1])

#PPG
ppg = data["GSR_PPG_A13_CAL"].iloc[0:900].values

ppgExtract = PPGFeatures(set.FS_GSR)

print(ppgExtract.extractTimeDomain(ppg.flatten()))

print(ppgExtract.extractFrequencyDomain(ppg.flatten()))

print(ppgExtract.extractNonLinear(ppg.flatten()))

#EDA
eda = data["GSR_GSR_Skin_Conductance_CAL"].iloc[0:900].values

edaExtract = EDAFeatures(set.FS_GSR)

print(edaExtract.extractMFCCFeatures(ppg.flatten()))

print(edaExtract.extractSCRFeatures(ppg.flatten()))