日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

scipy连续小波变换

發布時間:2024/3/26 编程问答 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 scipy连续小波变换 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

scipy連續小波變換

連續小波變換,使用小波函數對數據執行連續小波變換。CWT使用由寬度參數和長度參數表征的小波函數執行與數據的卷積。允許小波函數是復數形式。

接口:

scipy.signal.cwt(data, wavelet, widths, dtype=None, **kwargs)

“”"
Continuous wavelet transform.

Performs a continuous wavelet transform on data, using the wavelet function. A CWT performs a convolution with data using the wavelet function, which is characterized by a width parameter and length parameter. The wavelet function is allowed to be complex.


Parameters
data(N,) ndarray
data on which to perform the transform.


waveletfunction
Wavelet function, which should take 2 arguments. The first argument is the number of points that the returned vector will have (len(wavelet(length,width)) == length). The second is a width parameter, defining the size of the wavelet (e.g. standard deviation of a gaussian). See ricker, which satisfies these requirements.
(小波函數,它應該帶2個參數。第一個參數是返回的向量將具有的點數(len(小波(長度,寬度))==length)。第二個是寬度參數,定義了小波的大小(例如高斯的標準差)。參見ricker,它滿足了這些要求。)


widths(M,) sequence
Widths to use for transform.


dtype:data-type, optional
The desired data type of output. Defaults to float64 if the output of wavelet is real and complex128 if it is complex.
所需的輸出數據類型。如果小波的輸出為實值,則默認為float64,如果它是復數的,則復數128。


kwargs
Keyword arguments passed to wavelet function.


Returns
cwt: (M, N) ndarray
Will have shape of (len(widths), len(data)).

對于非對稱復值小波,輸入信號與小波數據的時反復共軛卷積[1].
“”"

代碼

from scipy import signal
import matplotlib.pyplot as plt
import numpy as np

t = np.linspace(-1, 1, 200, endpoint=False)
sig = np.cos(2 * np.pi * 7 * t) + signal.gausspulse(t - 0.4, fc=2)
widths = np.arange(1, 31)
cwtmatr = signal.cwt(sig, signal.ricker, widths)
plt.imshow(cwtmatr, extent=[-1, 1, 31, 1], cmap=‘PRGn’, aspect=‘auto’,
vmax=abs(cwtmatr).max(), vmin=-abs(cwtmatr).max())
plt.show()

引用

[^1] : S. Mallat, “A Wavelet Tour of Signal Processing (3rd Edition)”, Academic Press, 2009.
et Tour of Signal Processing (3rd Edition)”, Academic Press, 2009.
[^2] : scipy.signal.cwt — SciPy v1.9.3 Manual

總結

以上是生活随笔為你收集整理的scipy连续小波变换的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。