标签: butterworth

JS 中处理和更新庞大数据集的性能问题

我有一个 Python Tkinter 应用程序,它使用 Matplotlib 将包含 1000 万个数据点的数据集加载到绘图中。此外,它允许用户在运行时不断应用各种信号处理滤波器来操纵数据并更新绘图。

\n

我正在使用 React 和微服务架构在 Web 平台中重新构建这个应用程序,\xc2\xa0 数据文件保存在 S3 中并由客户端加载。

\n

应应用的数据过滤器是:

\n
    \n
  • 巴特沃斯
  • \n
  • 迹线归一化
  • \n
  • 标准差
  • \n
\n

目前使用的python库有:

\n
    \n
  • scipy
  • \n
  • 数值模拟
  • \n
  • 绘图库
  • \n
\n

我面临的问题如下:

\n
    \n
  • JS 中没有明显的库可以像 Pyhton 那样满足我对复杂\xc2\xa0信号处理的需求
  • \n
  • 在客户端以外的任何地方进行处理将导致不必要的网络流量。
  • \n
\n

在 JS 中对庞大数据集应用实时复杂数学\xc2\xa0calculations\xc2\xa0 的正确方法是什么?

\n

我最初的想法是向 Python 微服务发送一个 HTTP 请求,并使用所选的过滤器将其应用于文件并将数据发送回客户端。这种方法的最大问题是仅仅为了做出一个小改变就会产生巨大的网络流量。对于桌面应用程序中的压缩,处理此类更改只需不到半秒的时间。

\n

我的网络应用程序是用 ReactJS 编写的,我使用的绘图库是 Poltly.js,它工作得很好,但实时数据操作是一个巨大的挑战。

\n

javascript mathematical-optimization web webassembly butterworth

6
推荐指数
0
解决办法
190
查看次数

音频均衡器

我正在尝试用 python 制作一个简单的 10 频段均衡器。我已经编写了两个函数来实现此目的,但我有增益问题。我想为每个频段设置增益,但它不起作用。

这里有一个例子。需要一个单通道 wav“audio.wav”文件才能工作。

import numpy as np
import matplotlib.pyplot as plt
import scipy.io.wavfile as wav
from scipy import signal
from scipy.signal import butter, lfilter

def bandpass_filter(data, lowcut, highcut, fs, order=5):
    nyq = 0.5 * fs
    low = lowcut / nyq
    high = highcut / nyq
    b, a = butter(order, [low, high], btype='bandpass')
    filtered = lfilter(b, a, data)
    return filtered

def equalizer_10band (data, fs, gain1=0, gain2=0, gain3=0, gain4=0, gain5=0, gain6=0, gain7=0, gain8=0, gain9=0, gain10=0):
    band1 = bandpass_filter(data, …
Run Code Online (Sandbox Code Playgroud)

python filter equalizer butterworth

5
推荐指数
0
解决办法
1万
查看次数

在python中应用巴特沃斯带通滤波器后,如何去除信号开头的大尖峰?

我想使用带通滤波器消除信号的趋势。我在 python 中使用了 FL=0.1 Hz 和 FH=20Hz 的巴特沃斯滤波器,但在应用这个带通滤波器后,我在去趋势信号的开始处观察到一个大尖峰。这个尖峰是做什么用的?以及如何删除 python 中的这个尖峰?

滤波后的信号

您可以使用此链接下载“data1.csv” 。

from scipy.signal import butter, lfilter
from numpy import genfromtxt
import numpy as np
import matplotlib.pyplot as plt

def butter_bandpass(lowcut, highcut, fs, order=5):
    nyq = 0.5 * fs
    low = lowcut / nyq
    high = highcut / nyq
    b, a = butter(order, [low, high], btype='band')
    return b, a

def butter_bandpass_filter(data, lowcut, highcut, fs, order=5):
    b, a = butter_bandpass(lowcut, highcut, fs, order=order)
    y = lfilter(b, a, data)
    return …
Run Code Online (Sandbox Code Playgroud)

python signal-processing filter butterworth

4
推荐指数
1
解决办法
1347
查看次数

为什么将Butterworth滤波器用于低频滤波会出现错误?

我正在尝试分析每个1/3倍频程频带频率的幅度,因此我使用了许多带通Butterworth滤波器。但是,它们只能在三阶时以50 Hz的频率工作。我想使用6阶,但是由于某些原因,在1 kHz以下没有得到任何结果。

[fs, x_raw] = wavfile.read('ruido_rosa.wav')
x_max=np.amax(np.abs(x_raw))
x=x_raw/x_max
L=len(x)

# Creates the vector with all frequencies

f_center=np.array([50.12, 63.10, 79.43, 100, 125.89, 158.49, 199.53, 251.19, 316.23, 398.11, 501.19, 630.96, 794.33, 1000, 1258.9, 1584.9, 1995.3, 2511.9, 3162.3, 3981.1, 5011.9, 6309.6, 7943.3, 10000, 12589.3, 15848.9])
f_low=np.array([44.7, 56.2, 70.8, 89.1, 112, 141, 178, 224, 282, 355, 447, 562, 708, 891, 1120, 1410, 1780, 2240, 2820, 3550, 4470, 5620, 7080, 8910, 11200, 14100])
f_high=np.array([56.2, 70.8, 89.1, 112, 141, 178, 224, 282, 355, 447, 562, …
Run Code Online (Sandbox Code Playgroud)

python signal-processing filter butterworth

2
推荐指数
1
解决办法
61
查看次数