IATT = 0 filtered_signal = ourFilters.filterSignal(downsampled_data, SAMP_F, passFr = F_PASS, stopFr = F_STOP, LOSS = ILOSS, ATTENUATION = IATT, filterType = filterType) ''' #filter 2 #the user selects the parameters, with default suggested start_good_beats = 1290 #this parameter hasn't a default, this number is only for the example used in this algorithm end_good_beats = 1360 #this parameter hasn't a default, this number is only for the example used in this algorithm plen_bef = 0.35 plen_aft = 1 filtered_signal = ourFilters.matched_filter(downsampled_data, SAMP_F, start_good_beats, end_good_beats, plen_bef, plen_aft) print 'filtered' ''' #extraction peaks from the signal #the user selects the parameters, with default suggested delta = 0.2 peaks = IBI.getPeaksIBI(filtered_signal,SAMP_F, delta) print 'plotting...' plt.plot(filtered_signal[:,0],filtered_signal[:,1]) plt.plot(peaks[:,0], peaks[:,1], 'o') plt.show() #calculation of the IBI #the user selects the parameters, with default suggested minFr = 40 maxFr = 200 ibi = IBI.max2interval(peaks, minFr, maxFr) ourTools.array_labels_to_csv(ibi, np.array(["timestamp", "IBI", "labels"]), "./output/preproc_"+fileName[7:-4]+".csv") #-----FEATURES EXTRACTION-----
IATT = 40 filtered_signal = ourFilters.filterSignal(rawdata, SAMP_F, passFr=F_PASS, stopFr=F_STOP, LOSS=ILOSS, ATTENUATION=IATT, filterType=filterType) #compact timestamp, signal and labels for the next processes total_signal = filtered_signal #extraction peaks from the signal #the user selects the parameters, with default suggested delta = 1 peaks = IBI.getPeaksIBI(total_signal, SAMP_F, delta) #calculation of the IBI #the user selects the parameters, with default suggested minFr = 40 maxFr = 200 ibi = IBI.max2interval(peaks, minFr, maxFr) tools.array_labels_to_csv(ibi, np.array(["timestamp", "IBI", "lables"]), "./output/preproc_" + fileName[7:-4] + ".csv") #-----FEATURES EXTRACTION----- timestamp = ibi[:, 0] timed_vals = ibi[:, [0, 1]] lbls = ibi[:, 2] winds, lbls = windowing.get_windows_contiguos(timestamp, lbls, 100, 50)
#filter the signal #the user selects the parameters, with default suggested filterType = 'butter' F_PASS = 2 F_STOP = 6 ILOSS = 0.1 IATT = 40 filtered_signal = ourFilters.filterSignal(rawdata, SAMP_F, passFr = F_PASS, stopFr = F_STOP, LOSS = ILOSS, ATTENUATION = IATT, filterType = filterType) #compact timestamp, signal and labels for the next processes total_signal = filtered_signal #extraction peaks from the signal #the user selects the parameters, with default suggested delta = 1 peaks = IBI.getPeaksIBI(total_signal,SAMP_F, delta) #calculation of the IBI #the user selects the parameters, with default suggested minFr = 40 maxFr = 200 ibi = IBI.max2interval(peaks, minFr, maxFr) tools.array_labels_to_csv(ibi, np.array(["timestamp", "IBI", "lables"]), "./output/preproc_"+fileName[7:-4]+".csv") #-----FEATURES EXTRACTION----- timestamp = ibi[:,0] timed_vals = ibi[:,[0,1]] lbls = ibi[:,2] winds, lbls = windowing.get_windows_contiguos(timestamp, lbls, 100, 50)