对数据列进行希尔伯特变换的计算

问题描述

嗨,我想对由 hilbert transform 符号分隔的每个块的 4th 列数据执行 > 并希望将其附加到 5th column6th column 我想把加法的结果(4th and 5th 列)放在 7th column 我想把 4th and 5th 列的减法结果放在最后。我想将其保存到文本文件 out.txt

input.txt

>   >   >
0.000   5.064   -0.15835E-01 -7.755619582136471027e-03
0.200   5.064   -0.21715E-02 -1.302134466433525067e-02
0.400   5.064   0.18954E-01 -1.691809184964498253e-02
0.600   5.064   0.41548E-01 -1.963343598238626725e-02
0.800   5.064   0.58055E-01 -2.226027201334635636e-02
>   >   >
0.000   4.977   0.32899E-02 1.439701445411046415e-02
0.200   4.977   0.15972E-01 6.094966468334198084e-03
0.400   4.977   0.30631E-01 -5.640445453166963163e-03
0.600   4.977   0.43082E-01 -1.894167941538492383e-02
0.800   4.977   0.48568E-01 -3.201777775955200189e-02

输出数据:

>   >   >
0.000   5.064   -0.15835E-01 -7.755619582136471027e-03  hilbert(-7.755619582136471027e-03)  addition of 4 and 5th col     subtraction of 4 and 5th col
0.200   5.064   -0.21715E-02 -1.302134466433525067e-02  hilbert(-1.302134466433525067e-02)   ..                             ..
0.400   5.064   0.18954E-01 -1.691809184964498253e-02   ................................     ..                             ..
0.600   5.064   0.41548E-01 -1.963343598238626725e-02   .................................    ..                             ..
0.800   5.064   0.58055E-01 -2.226027201334635636e-02   hilbert(-2.226027201334635636e-02)   ..                             ..
>   >   >
0.000   4.977   0.32899E-02 1.439701445411046415e-02    hilbert(1.439701445411046415e-02)    ..
0.200   4.977   0.15972E-01 6.094966468334198084e-03    ................................     ..                             ..
0.400   4.977   0.30631E-01 -5.640445453166963163e-03   ................................     ..
0.600   4.977   0.43082E-01 -1.894167941538492383e-02   ................................     ..
0.800   4.977   0.48568E-01 -3.201777775955200189e-02   hilbert(-3.201777775955200189e-02)   ..                             ..

我尝试了脚本:

import numpy as np
from scipy.signal import hilbert
import pandas as pd

data=np.loadtxt("input.txt")
fifth_col=hilbert(data(:,3))
sixth_col=data.append(hilb_trans)
seven_col=
np.savetxt('out.txt')

这里我无法继续。请提出解决方案。提前致谢。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)