优化UI布局,新增自定义频率输入功能,调整相关信号处理逻辑
This commit is contained in:
18
debug_script/Replace_missing.py
Normal file
18
debug_script/Replace_missing.py
Normal file
@ -0,0 +1,18 @@
|
||||
from pathlib import Path
|
||||
import pandas as pd
|
||||
import numpy as np
|
||||
|
||||
samp_np = 10395
|
||||
missing_second = 11495+11463-6300
|
||||
missing_length = 17.29-2.81
|
||||
fs = 500
|
||||
missging_bcg = Path(rf"E:\code\DataCombine2023\ZD5Y2\OrgBCG_Text\{samp_np}\OrgBCG_Raw_500.txt")
|
||||
|
||||
bcg_data = pd.read_csv(missging_bcg, header=None).to_numpy().reshape(-1)
|
||||
miss_start = int(missing_second * fs)
|
||||
bcg_data_filled = np.concatenate([bcg_data[:miss_start],
|
||||
np.full(int(missing_length * fs), np.mean(bcg_data)),
|
||||
bcg_data[miss_start:]])
|
||||
|
||||
output_path = Path(rf"E:\code\DataCombine2023\ZD5Y2\OrgBCG_Text\{samp_np}\OrgBCG_Raw_500_filled.txt")
|
||||
np.savetxt(output_path, bcg_data_filled, fmt="%d")
|
||||
Reference in New Issue
Block a user