改善频率时间归一化/希尔伯特传递运行时间 [英] Improving frequency time normalization/hilbert transfer runtimes

查看:49
本文介绍了改善频率时间归一化/希尔伯特传递运行时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以这是一个有点棘手的问题...

我有一个时序信号,它的响应频谱不均匀,需要白化.我使用频率时间归一化方法进行美白,在该方法中,我使用恒定的窄频带(〜1/4最低频率的终端成员)对两个频率端点之间的信号进行增量滤波.然后,我找到表征这些窄带中每个窄带的包络,并对该频率分量进行归一化.然后,我使用这些归一化的信号来重建信号...都是在python中完成的(抱歉,必须是python解决方案)...

以下是原始数据:

这是它的频谱:

这是增白数据的光谱:

问题是,我必须像这样大约500,000个信号来执行此操作,并且要花费一段时间(每个〜一分钟)...几乎全部时间都花在了实际操作上(多个)希尔伯特变换

我已经在小型群集上运行它了.我不想并行化希尔伯特所在的循环.

我正在寻找替代的包络例程/函数(非希尔伯特),或者寻找无需进行循环即可计算整个窄带响应函数的替代方法.

另一种选择是使频带适应其滤波所用的中心频率,因此当我们进行例行程序时,它们会逐渐变大;这只会减少我必须经历循环的次数.

欢迎任何建议!

示例代码/数据集:

它比希尔伯特快6倍.为了进一步提高速度,您可以编写一个cython函数,该函数可以找到下一个局部最大点并迭代归一化到局部最大点.

So this is a bit of a nitty gritty question...

I have a time-series signal that has a non-uniform response spectrum that I need to whiten. I do this whitening using a frequency time normalization method, where I incrementally filter my signal between two frequency endpoints, using a constant narrow frequency band (~1/4 the lowest frequency end-member). I then find the envelope that characterizes each one of these narrow bands, and normalize that frequency component. I then rebuild my signal using these normalized signals... all done in python (sorry, has to be a python solution)...

Here is the raw data:

and here is its spectrum:

and here is the spectrum of the whitened data:

The problem is, that I have to do this for maybe ~500,000 signals like this, and it takes a while (~a minute each)... With almost the entirety of the time being spend doing the actual (multiple) Hilbert transforms

I have it running on a small cluster already. I don't want to parallelize the loop the Hilbert is in.

I'm looking for alternative envelope routines/functions (non Hilbert), or alternative ways to calculate the entire narrowband response function without doing a loop.

The other option is to make the frequency bands adaptive to the center frequency over which its filtering, so they get progressively larger as we march through the routines; which would just decrease the number of times I have to go through the loop.

Any and all suggestions welcome!!!

example code/dataset: https://github.com/ashtonflinders/FTN_Example

解决方案

Here is a faster method to calculate the enveloop by local max:

def calc_envelope(x, ind):
    x_abs = np.abs(x)
    loc = np.where(np.diff(np.sign(np.diff(x_abs))) < 0)[0] + 1
    peak = x_abs[loc]
    envelope = np.interp(ind, loc, peak)
    return envelope

Here is an example output:

It's about 6x faster than hilbert. To speedup even more, you can write a cython function that find next local max point and does normalization up to the local max point iteratively.

这篇关于改善频率时间归一化/希尔伯特传递运行时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆