这是MATLAB官方网站对它的介绍
hs = hht(imf)
返回hs由固有模式函数指定的信号的希尔伯特频谱imf。hs对于分析包含频谱含量随时间变化的信号混合的信号很有用。用于hht对信号执行希尔伯特频谱分析,以识别局部特征。
在输入一个时间序列,并进行hs = hht(imf) 变换后的输出如下
clc
clear
x=[
0.174
0.582667
1.439
2.671
4.74533
9.15
4.64633
2.17033
9.38767
10.3327
4.472
4.07767
3.69433
3.26067
4.351
4.738
5.01833
4.87667
6.48967
8.76267
12.581
10.9257
9.03567
6.56767
7.45167
6.277
4.95467
10.2543
8.528
7.59067
7.52667
7.29567
6.26933
5.52667
2.83867
2.03933
0.522
];
imf = emd(x,'Display',1);%这是先求得IMF分量
hs = hht(imf)%对其进行hht变换
输出如下:
列表显示每个IMF的筛选迭代次数,相对公差和筛选停止标准。
下面的hs表示的是得到的一个稀疏矩阵,括号内的数字表示的是行号和列号,后面的数字表示的是’瞬时能量Instantaneous Energy’,可以理解为各个IMF分量的幅值,现在可能不太容易理解,在画出hht三维图谱后,秒懂。这个稀疏矩阵可能不太好看,你可以采用代码:full(hs)将其还原成日常看到的矩阵的形式。
Current IMF | #Sift Iter | Relative Tol | Stop Criterion Hit
1 | 3 | 0.042691 | SiftMaxRelativeTolerance
2 | 2 | 0.025358 | SiftMaxRelativeTolerance
3 | 2 | 0.0021327 | SiftMaxRelativeTolerance
The decomposition stopped because the number of extrema of the residual signal is less than 'MaxNumExtrema'.
hs =
(4,1) 9.7430
(13,1) 2.5288
(18,1) 12.3507
(5,2) 8.8357
(9,2) 1.3671
(17,2) 9.8454
(5,3) 7.9882
(7,3) 1.9184
(14,3) 9.5075
(5,4) 9.2192
(17,4) 7.7312
(4,5) 2.2866
(5,5) 7.0763
(34,5) 14.4814
(5,6) 9.4598
(54,6) 17.1113
(5,7) 6.6329
(6,7) 3.8016
(60,7) 16.9049
(5,8) 6.4591
(8,8) 5.2045
(57,8) 20.3345
(5,9) 6.4794
(10,9) 7.3053
(55,9) 19.6617
(5,10) 6.4043
(12,10) 9.5687
(52,10) 18.1715
(5,11) 6.5145
(13,11) 10.9203
(43,11) 14.7195
(5,12) 6.4978
(14,12) 11.6642
(20,12) 5.2650
(5,13) 6.6712
(14,13) 13.6318
(5,14) 6.7192
(16,14) 10.4454
(29,14) 4.8284
(5,15) 6.9640
(17,15) 9.3067
(29,15) 2.5769
(5,16) 7.0934
(19,16) 8.6135
(34,16) 1.7344
(6,17) 7.4075
(20,17) 8.1330
(41,17) 2.6261
(6,18) 7.5979
(21,18) 7.6981
(31,18) 2.5946
(6,19) 7.9447
(21,19) 7.9574
(28,19) 2.7597
(6,20) 8.1919
(21,20) 8.0562
(43,20) 4.9932
(6,21) 8.5721
(22,21) 8.2214
(56,21) 3.4536
(6,22) 8.8942
(22,22) 7.7281
(45,22) 0.9716
(6,23) 9.3122
(22,23) 6.8644
(32,23) 0.1991
(6,24) 9.7263
(24,24) 6.9954
(54,24) 1.0623
(6,25) 10.1753
(24,25) 7.0798
(72,25) 2.5179
(6,26) 10.6770
(22,26) 7.4111
(69,26) 5.7637
(6,27) 11.1037
(21,27) 8.1742
(76,27) 4.6712
(6,28) 11.6609
(18,28) 8.0488
(72,28) 4.3450
(7,29) 12.0564
(16,29) 7.7957
(47,29) 6.9041
(7,30) 12.6973
(15,30) 6.7955
(25,30) 3.3540
(7,31) 12.9754
(14,31) 5.6766
(19,31) 1.8266
(7,32) 13.5655
(13,32) 4.4047
(17,32) 0.6433
(7,33) 13.6247
(15,33) 3.0892
(41,33) 0.1810
(7,34) 14.2225
(18,34) 2.3773
(62,34) 0.5033
(7,35) 14.0278
(11,35) 1.3105
(21,35) 1.2872
(9,36) 14.7094
(31,36) 1.4471
(10,37) 13.7521
(23,37) 7.3398
(38,37) 2.6321
>>
紧接着上述代码,画出三维的hht图谱
figure;
[hs,f,t] = hht(imf,'FrequencyLimits',[0 3]);
mesh(seconds(t),f,hs,'EdgeColor','none','FaceColor','interp')
xlabel('时间Time (s)')
ylabel('频率Frequency (Hz)')
zlabel('瞬时能量Instantaneous Energy')
运行结果图如下:
当你俯视他时,
可以看出它是,三个IMF分量的频率随着时间的变化情况
当你鼠标在图上标注出数值时,惊奇地发现Z轴数值可以在稀疏矩阵里被找到。