我在Matlab中使用cwtft时遇到问题

时间:2019-10-08 07:49:12

标签: matlab-guide wavelet

我正在尝试在matlab中对地震信号进行cwtft,而不给出Fs(频率)和绘制比例尺图。 怎么做?

b=nextpow2(tt);
n=2^b;

s={win2,1/(n-1)};

cwtstruct=cwtft(s,wv);
det=str2double(cwtstruct)

1 个答案:

答案 0 :(得分:1)

MATLAB有一些内置示例,可以帮助您了解一下,幸运的是,它有一个for earthquake time and frequency localizations

示例1神户数据

load kobe

加载时域数据(我正在猜测)。

[wt,f] = cwt(kobe,1);

重建地震时间数据。

xrec = icwt(wt,f,[0.030 0.070],'SignalMean',mean(kobe));

绘制并比较原始时间数据和[0.030, 0.070] Hz范围内的频率数据,我猜这可能是地震的某些技术频率范围。

subplot(2,1,1)
plot(kobe)
grid on
title('Original Data')
subplot(2,1,2)
plot(xrec)
grid on
title('Bandpass Filtered Reconstruction [0.030 0.070] Hz')

示例2厄尔尼诺现象数据

加载El Nino(地震)数据并获得其时间数据的连续小波变换:

load ninoairdata
[cfs,period] = cwt(nino,years(1/12));
Obtain the inverse CWT for years 2 through 8.

xrec = icwt(cfs,period,[years(2) years(8)]);

并使用以下命令绘制重建数据的CWT:

figure
cwt(xrec,years(1/12))

最后将原始时间数据与重建后的数据进行比较:

figure
subplot(2,1,1)
plot(nino)
grid on
title('Original Data')
subplot(2,1,2)
plot(xrec)
grid on
title('El Nino Data - Years 2-8')

您只需将自己的数据加载到这些模型中,即可查看如何设计方法和分析数据。