一些常见模拟信号的绘制(Python)

360影视 2025-01-11 12:35 2

摘要:import matplotlib.pyplot as pltimport numpy as npimport pywt# use 'list' to get a list of all available 1d demo signalssignals = p

import matplotlib.pyplot as pltimport numpy as npimport pywt# use 'list' to get a list of all available 1d demo signalssignals = pywt.data.demo_signal('list')subplots_per_fig = 5signal_length = 1024i_fig = 0n_figures = int(np.ceil(len(signals)/subplots_per_fig))for i_fig in range(n_figures):# Select a subset of functions for the current plotfunc_subset = signals[i_fig * subplots_per_fig:(i_fig + 1) * subplots_per_fig]# create a figure to hold this subset of the functionsfig, axes = plt.subplots(subplots_per_fig, 1)axes = axes.ravelfor n, signal in enumerate(func_subset):if signal in ['Gabor', 'sineoneoverx']:# user cannot specify a length for these twox = pywt.data.demo_signal(signal)else:x = pywt.data.demo_signal(signal, signal_length)ax = axes[n]ax.plot(x.real)if signal == 'Gabor':# The Gabor signal is complex-valuedax.plot(x.imag)ax.legend(['Gabor (Re)', 'Gabor (Im)'], loc='upper left')else:ax.legend([signal, ], loc='upper left')# omit axes for any unused subplotsfor n in range(n + 1, len(axes)):axes[n].set_axis_offplt.show

知乎学术咨询:

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

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

分割线分割线分割线

MATLAB环境下一种改进的瞬时频率(IF)估计方法

完整代码:

Python环境下轴承振动信号(一维信号)的包络谱分析

算法程序运行环境为Python,执行一维信号的包络谱分析,以轴承振动信号为例。

MATLAB环境下信号的倒谱分析(MATLAB R2018A)

完整代码:

MATLAB环境下几种离群值检测方法(MATLAB R2018A)

(1) Wright (Laiyite) criterion

(2) Iglewicz-Hoaglin modified Z-score

(3) Huber-Miller MAD rule

(4) Tukey criterion

(5) Romanowski criterion

(6) Chebyshev criterion

来源:百科技展示

相关推荐