-
Notifications
You must be signed in to change notification settings - Fork 15
/
eemd_2d_demo.m
71 lines (59 loc) · 962 Bytes
/
eemd_2d_demo.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
% clc;
% clear all;
close all;
%% parameters
nos_img = 0.1;
goal = 3;
ens = 100;
nos_wn = 0.1;
%% load data
load lena64;
img = lena;
std_img = std( img(:) );
sz = size(img);
img2 = (img./std_img + randn(sz).*nos_img ).*std_img;
figure;
subplot(1,2,1);
imagesc(img);
colormap(bone);
axis off;
axis image;
title('original data');
subplot(1,2,2);
imagesc(img2);
colormap(bone);
axis off;
axis image;
title(['\sigma = ' num2str(nos_img) ' noise added']);
%% 2-D EEMD
tic;
[H, G, D] = eemd2(img2, goal, ens, nos_wn);
toc
%% show result
for k = 1:goal
figure;
imagesc(H(:,:,k));
colormap(bone);
axis off;
axis image;
title(['mode #' num2str(k)]);
end
figure;
imagesc(H(:,:,goal+1));
colormap(bone);
axis off;
axis image;
title('trend');
figure;
subplot(1,2,1)
imagesc(img);
colormap(bone);
axis off;
axis image;
title('original');
subplot(1,2,2)
imagesc( sum(H, 3) );
colormap(bone);
axis off;
axis image;
title('reconstructed');