西西軟件園多重安全檢測下載網(wǎng)站、值得信賴的軟件下載站!
西西首頁 電腦軟件 安卓軟件 電腦游戲 安卓游戲 排行榜 專題合集

Matlab-EMD工具箱

官方版
  • Matlab-EMD工具箱官方版
  • 軟件大小:100KB
  • 更新時間:2015-05-14 11:09
  • 軟件語言:英文
  • 軟件廠商:
  • 軟件類別:國產(chǎn)軟件 / 免費軟件 / 編程輔助
  • 軟件等級:4級
  • 應用平臺:WinAll, WinXP
  • 官方網(wǎng)站:http://elephantinaurance.com
  • 應用備案:
好評:50%
壞評:50%

軟件介紹

EMD工具箱,在MATLAB中實現(xiàn)EMD的各種功能所必須的工具箱。

工具箱的安裝

運行install_emd.m文件可以實現(xiàn)此工具箱的安裝,uninstall_emd.m實現(xiàn)卸載。

1、首先下載emd工具箱,50樓網(wǎng)址里面可以下。下載后解壓放在matlab的work工作路徑下package_emd文件夾。

2、打開matlab,選擇File- Set Path- Add with Subfolders-你剛才下載的工具箱(package_emd)點進去- Save- Close。

3、此時選擇work下package_emd文件夾作為工作路徑,即是C:\Program Files\MATLAB\R2010a\toolbox\package_emd。

4、在Command Window里面輸入mex -setup回車,問是否選擇已有的編譯器你選y回車,再問選擇哪個編譯器,你可以選擇C++的那個選擇相應的編號(如 2)回車,然后讓你核對是否選擇對了編譯器等等,你輸入y回車。就安裝成功了

>> mex -setup

Please choose your compiler for building external interface (MEX) files: 

Would you like mex to locate installed compilers [y]/n? y

Select a compiler: 

[1] Lcc-win32 C 2.4.1 in C:\PROGRA~1\MATLAB\R2010a\sys\lcc 

[2] Microsoft Visual C++ 6.0 in C:\Program Files\Microsoft Visual Studio 

[0] None 

Compiler: 2

Please verify your choices: 

Compiler: Microsoft Visual C++ 6.0 

Location: C:\Program Files\Microsoft Visual Studio 

Are these correct [y]/n? y

Trying to update options file: C:\Users\Administrator\AppData\Roaming\MathWorks\MATLAB\R2010a\mexopts.bat 

From template: C:\PROGRA~1\MATLAB\R2010a\bin\win32\mexopts\msvc60opts.bat 

Done . . . 

************************************************************************** 

  Warning: The MATLAB C and Fortran API has changed to support MATLAB 

           variables with more than 2^32-1 elements. In the near future 

           you will be required to update your code to utilize the new 

           API. You can find more information about this at: 

           http://www.mathworks.com/support/solutions/en/data/1-5C27B9/?solution=1-5C27B9 

           Building with the -largeArrayDims option enables the new API. 

************************************************************************** 

MATLAB的emd的工具箱  可是不知道怎么用  也不知道怎么用它來處理txt中的數(shù)據(jù)

安裝中的問題

    但是安裝的時候,如果使用的是VS的編譯器(mbuild –setup、mex –setup設置),會報找不到complex.h的問題(用Linux下的Matlab不會出錯),從而使cemdc2_fix.c等文件編譯失敗,這幾個文件是為了快速實現(xiàn)計算EMD而用c編寫的,所以即使編譯失敗,也不影響直接使用emd.m實現(xiàn)EMD功能。如果想編譯成功,可如下修改:(摘自http://www.chinavib.com/thread-79866-1-1.html)

    G. Rilling 07年3月份的程序,運行作者的install_emd.m,出現(xiàn)找不到complex.h的問題,以下是個人的理解和解決過程:(個人的運行環(huán)境為matlab6.5)

complex.h的問題

    產(chǎn)生原因:采用matlab的C編譯函數(shù)mex時,定義了C99_OK的宏(EMDS/make_emdc.m (28行)),利用的是ANSI C99標準如果個人的電腦中沒有相關的支持,就會出現(xiàn)這個問題。

解決方法:EMDS/make_emdc.m中第28行中mex(’-DC99_OK‘,args(:))語句中的 '-DC99_OK' 即可。

    注意:

    改完之后,運行install_emd,會出現(xiàn)M_PI沒有定義的問題,缺少了常數(shù)PI的宏定義,導致一些.c文件編譯失敗。

    產(chǎn)生原因:去掉C99_OK之后,程序中使用的是作者提供的 emd_complex.h和emd_complex.c兩個文件來支持復數(shù)運算,這兩個文件中,并沒有定義M_PI這個宏。

    解決方法:M_PI這個宏,只在兩個文件中(clocal_mean.c和clocal_mean2.c)使用,個人的解決方法是,在相應的頭文件(clocal_mean.h和clocal_mean2.h)中加入M_PI的宏定義即可。

    在兩個.h文件中分別加入一下語句:

#define CLOCAL_MEAN_H

#ifndef M_PI

#define M_PI 3.1415926

#endif

    安裝完成后,編譯輸出的.dll文件會出現(xiàn),重復后綴名的問題,及 xxx.dll 變成了 xxx.dll.dll自己去掉多余的.dll即可

    最后,關于版本問題:作者推薦使用7.1+版本,但只是針對個別的函數(shù)有影響,主要是作者提供的例子程序,無法在matlab6.5環(huán)境中運行,算法的主要功能函數(shù)并不受影響。

工具箱的使用

工具箱函數(shù)

   運行help index_emd可以查看工具箱提供的函數(shù),如下

index_emd.M list of functions in the EMD package
 
 type help function_name for more information on a specific function
 
 Empirical Mode Decomposition
 
   emd         - computes EMD and bivariate/complex EMD with various options
   emd_local   - computes local EMD variation
   emd_online  - computes on-line EMD variation. Note that it does not truly
                  apply on-line: the function is only a demonstration.
   emdc        - fast implementation for EMD with Cauchy-like stopping criterion
                  (requires compilation, see make_emdc function)
   emdc_fix    - fast implementation for EMD with predefined number of iterations
                  (requires compilation, see make_emdc function)
   cemdc       - fast implementation for bivariate/complex EMD (first algorithm)
                  with Cauchy-like stopping criterion (requires compilation,
                  see make_emdc function)
   cemdc_fix   - fast implementation for bivariate/complex EMD (first algorithm)
                  with predefined number of iterations (requires compilation,
                  see make_emdc function)
   cemdc2      - fast implementation for bivariate/complex EMD (second algorithm)
                  with Cauchy-like stopping criterion (requires compilation,
                  see make_emdc function)
   cemdc2_fix  - fast implementation for bivariate/complex EMD (second algorithm)
                  with predefined number of iterations (requires compilation,
                  see make_emdc function)
 
 Utilities
 
   install_emd  - setup Matlab's path and compile the C codes.
   uninstall_emd - revert the modifications made by install_emd and remove the
                   files (optional).
   make_emdc    - compile all C codes
   emd_visu     - visualization of EMD
   cemd_visu    - visualization of bivariate/complex EMD (automatically called
                   by emd_visu when the input is complex)
   cenvelope    - compute envelope curves for bivariate/complex EMD
   cemd_disp    - visualization of envelope curves and tube envelope
   plot3c       - plot a complex vector in 3 dimensions
   plotc        - plot the projection of a complex vector on a variable direction
   dirstretch   - directional stretching of a complex vector
   hhspectrum   - compute Hilbert-Huang spectrum (need the Time-Frequency Toolbox
                   http://tftb.nongnu.org)
   toimage      - transform a spectrum made of 1D functions (e.g., output of
                   "hhspectrum") in an 2D image
   disp_hhs     - display the image output of "toimage" as a Hilbert-Huang spectrum
   addtag       - add a tag to a graphic object (uses the Tag property as a list
                   of keywords or "tags")
   rmtag        - remove a tag from a graphic object (uses the Tag property as
                   a list of keywords or "tags")
   hastag       - test whether a graphic object has a specific tag (uses the Tag
                   property as a list of keywords or "tags")
   findtag      - find objects having a specific tag (uses the Tag property as
                   a list of keywords or "tags")
   
 Examples from G. Rilling, P. Flandrin and P. Gon鏰lves,
   "On Empirical Mode Decomposition and its algorithms"
   IEEE-EURASIP Workshop on Nonlinear Signal and Image Processing
   NSIP-03, Grado (I), June 2003
   
   emd_fmsin        - Fig. 1: a 3-component example (need the Time-Frequency
                       Toolbox http://tftb.nongnu.org)
   emd_triang       - Fig. 2: another 3-component example
   emd_sampling     - Fig. 3: effect of sampling on 1 tone
   emd_separation   - Fig. 4: separation of 2 tones
   ex_online        - Sect 3.4: the way emd_online.m works
   triangular_signal - subroutine called by emd_triang (formerly triang.m)
   
 Examples from G. Rilling, P. Flandrin, P. Gon鏰lves and J. M. Lilly,
   "Bivariate Empirical Mode Decomposition",
   Signal Processing Letters (submitted)
 
   bivariate_EMD_principle       - Fig. 1: principle of the bivariate/complex EMD
   bivariate_EMD_mean_definitions - Fig. 2: definition of the mean for each algorithm.
                                    Also allows to test other signals and parameter sets.
   bivariate_EMD_illustration    - Fig. 3: illustration of the bivariate EMD
                                    on an oceanographic float position record

   稍做整理如下:

EMD分解函數(shù)

函數(shù)功能
emd計算EMD、雙變量/復數(shù)EMD
emd_local計算local EMD
emd_online計算在線EMD(不是真正在線應用,此函數(shù)只是一個示范)
emdc使用Cauchy-like停止準則的快速EMD實現(xiàn),需編譯
emdc_fix使用預定義迭代次數(shù)的快速EMD實現(xiàn),需編譯
cemdc使用Cauchy-like停止準則的快速雙變量/復數(shù)EMD實現(xiàn)(方法1),需編譯
cemdc_fix使用預定義迭代次數(shù)的快速雙變量/復數(shù)EMD實現(xiàn)(方法1),需編譯
cemdc2使用Cauchy-like停止準則的快速雙變量/復數(shù)EMD實現(xiàn)(方法2),需編譯
cemdc2_fix使用預定義迭代次數(shù)的快速雙變量/復數(shù)EMD實現(xiàn)(方法2),需編譯

工具函數(shù)

函數(shù)功能
install_emd設置Matlab路徑,編譯c代碼
uninstall_emd回復install_emd做的修改,移除文件
make_emdc編譯c代碼
emd_visuEMD可視化
cemd_visu雙變量/復數(shù)EMD可視化(emd_visu的輸入是雙變量或復數(shù)時自動改為調(diào)用cemd_visu)
cenvelope計算雙變量EMD的包絡曲線
cemd_disp顯示復數(shù)包絡曲線
plot3c三維中繪制復數(shù)向量
plotc繪制復數(shù)向量在一個可變方向上的投影
dirstretch復數(shù)向量的方向拉伸
hhspectrum計算Hilbert-Huang譜(需要時頻工具箱http://tftb.nongnu.org)
toimage將一個一維函數(shù)譜轉(zhuǎn)化為圖像
disp_hhs以Hilbert-Huang譜的形式顯示toimage函數(shù)的輸出
addtag添加標簽到一個圖形對象
rmtag移除標簽從一個圖形對象
hastag測試一個圖形對象是否有指定的標簽
findtag找有指定標簽的圖形對象

來自《On Empirical Mode Decomposition and its algorithms》的Examples

函數(shù)功能
emd_fmsin一個包含3組分的例子(需要時頻工具箱)
emd_triang另一個包含3組分的例子
emd_samplingeffect of sampling on 1 tone
emd_separationseparation of 2 tones
ex_onlinethe way emd_online.m works
triangular_signalemd_triang文件調(diào)用的子程序

來自《Bivariate Empirical Mode Decomposition》的Examples

函數(shù)功能
bivariate_EMD_principle雙變量/復數(shù)EMD原則
bivariate_EMD_mean_definitions各種方法的平均值的定義
bivariate_EMD_illustration雙變量EMD在海洋漂流位置的應用圖解

工具箱使用示例

EMD

clc

clear all

close all

% 原始數(shù)據(jù)

fs = 1000;

ts = 1/fs;

t=0:ts:0.3;

z=2*sin(2*pi*10*t) + 5.*sin(2*pi*100*t);

figure

plot(t, z)

title('原始信號')

% EMD

imf=emd(z);

emd_visu(z,t,imf)

[A,f,tt]=hhspectrum(imf);

[im,tt]=toimage(A,f);

disp_hhs(im);

邊際譜

clc

clear all

close all

% 原始數(shù)據(jù)

fs = 1000;

ts = 1/fs;

t=0:ts:0.3;

y=2*sin(2*pi*10*t);% + 5.*sin(2*pi*100*t);

figure

plot(t, y)

title('原始信號')

% 求Hilbert-Huang譜

[A,fh,th] = hhspectrum(y);

figure

subplot(211)

plot(th*ts, A)

title('瞬時幅值') % 就是包絡

subplot(212)

plot(th*ts, fh*fs)

title('瞬時頻率')

% 顯示結(jié)果

[im,tt,ff] = toimage(A,fh,th);

disp_hhs(im,tt)

colormap(flipud(gray))

% 編程實現(xiàn)顯示

figure

imagesc(tt*ts,[0,0.5*fs],im);

ylabel('frequency/Hz')

set(gca,'YDir','normal')

xlabel('time/s')

title('Hilbert-Huang spectrum')

例子程序

更詳細的使用說明可以參見例子程序,如emd_fmsin.m程序,運行結(jié)果如下

EMD分解如下

可以看到,EMD實現(xiàn)的3個組分的分離(即分別分解到了IMF1~3中),可見EMD的強大功能。

軟件標簽: EMD工具箱 Matlab

軟件截圖

其他版本下載

最新評論查看所有(1)條評論 >

第 1 樓 重慶電信 網(wǎng)友 客人 2017/5/27 11:51:24
我安装之后一直出现这个问题

支持( 0 ) 蓋樓(回復)

發(fā)表評論

昵稱:
表情: 高興 可 汗 我不要 害羞 好 下下下 送花 屎 親親
查看所有(1)條評論 > 字數(shù): 0/500

TOP
軟件下載