关于信号的卷积计算(Python)

360影视 2025-01-12 14:26 2

摘要:# Convolution of two 1-D signals# Convolution operationdef convolution_1d(signal, kernel):signal_length = len(signal)kernel_length

1-D Signals

# Convolution of two 1-D signals# Convolution operationdef convolution_1d(signal, kernel):signal_length = len(signal)kernel_length = len(kernel)output_length = signal_length + kernel_length - 1output = [0] * output_lengthfor i in range(output_length):for j in range(kernel_length):if(i>=j and i-j>=0 and i-j[0.5, 2.0, 4.0, 6.0, 8.0, 7.0, 2.5]

Sinusoidal signals

import numpy as npimport matplotlib.pyplot as pltdef convolution_1d(signal, kernel):signal_length = len(signal)kernel_length = len(kernel)output_length = signal_length + kernel_length - 1output = np.zeros(output_length)for i in range(output_length):for j in range(kernel_length):if(i>=j and i-j>=0 and i-j

White Noise

import numpy as npimport matplotlib.pyplot as pltdef convolution_1d(signal, kernel):signal_length = len(signal)kernel_length = len(kernel)output_length = signal_length + kernel_length - 1output = np.zeros(output_length)for i in range(output_length):for j in range(kernel_length):if(i>=j and i-j>=0 and i-j

Impulse signals

import numpy as npimport matplotlib.pyplot as pltdef convolution_1d(signal, kernel):signal_length = len(signal)kernel_length = len(kernel)output_length = signal_length + kernel_length - 1output = np.zeros(output_length)for i in range(output_length):for j in range(kernel_length):if(i>=j and i-j>=0 and i-j

Step Signals

import numpy as npimport matplotlib.pyplot as pltdef convolution_1d(signal, kernel):signal_length = len(signal)kernel_length = len(kernel)output_length = signal_length + kernel_length - 1output = np.zeros(output_length)for i in range(output_length):for j in range(kernel_length):if(i>=j and i-j>=0 and i-j

Practical Signals

import numpy as npimport matplotlib.pyplot as plt# Function for 1D convolutiondef convolution_1d(signal, kernel):signal_length = len(signal)kernel_length = len(kernel)output_length = signal_length + kernel_length - 1output = np.zeros(output_length)for i in range(output_length):for j in range(kernel_length):if(i>=j and i-j>=0 and i-j

知乎学术咨询:

https://www.zhihu.com/consult/people/792359672131756032?isMe=1

担任《Mechanical System and Signal Processing》《中国电机工程学报》等期刊审稿专家,擅长领域:信号滤波/降噪,机器学习/深度学习,时间序列预分析/预测,设备故障诊断/缺陷检测/异常检测。

分割线分割线

基于改进高斯-拉普拉斯滤波器的微震信号平滑降噪方法(MATLAB)

完整数据可通过知乎学术咨询获得

非平稳信号的凸一维全变差降噪方法(MATLAB)

算法可迁移至金融时间序列,地震/微震信号,机械振动信号,声发射信号,电压/电流信号,语音信号,声信号,生理信号(ECG,EEG,EMG)等信号。

完整数据可通过知乎学术咨询获得

基于广义交叉验证阈值的微震信号降噪方法(MATLAB)

算法可迁移至金融时间序列,地震/微震信号,机械振动信号,声发射信号,电压/电流信号,语音信号,声信号,生理信号(ECG,EEG,EMG)等信号。

完整数据可通过知乎学术咨询获得

来源:常识指导员

相关推荐