前文介绍:橡皮筋基线校正
提取修正范围
def get_portion_interest(x,y,bir):
birlen = np.array(bir.shape[0])#用于获取 bir 的行数,也就是要提取信号的区域数量
sp = np.transpose(np.vstack((x.reshape(-1),y.reshape(-1))))
### selection of bir data
for i in range(birlen):
if i == 0:
yafit = sp[np.where((sp[:,0]> bir[i,0]) & (sp[:,0] < bir[i,1]))]
else:
je = sp[np.where((sp[:,0]> bir[i,0]) & (sp[:,0] < bir[i,1]))]
yafit = np.vstack((yafit,je))
return yafit
参数
----------
x : ndarray
x 轴
y : ndarray
y 值
bir : n x 2 数组
需要提取信号的区域的 x 值、
必须是一个 n x 2 维数组,其中 n 是要提取的区域数。
第 0 列为低边界,第 1 列为高边界。