Example of Fig 5.7

Analytical example of a stationary wave

function example57
%
%  Eof of signal and noise
%


% Generate signal data

clf;

n=34;
m=20;
mode=1;

u=linspace(0,2*pi,m);
v=linspace(0,2*pi,n);

[x,y]=meshgrid(u);


for j = 1:n
    a(:,:,j) = 10*sin(x)*sin(2*v(j)) + 10*randn(length(u));
    surf(x,y,a(:,:,j)) ; colormap(gray);brighten(0.5);
end
%

for j = 1:n
    z(:,j) = reshape(a(:,:,j),[m*m 1]);
end

size(z)

zh=hilbert(z')';


[uu,ss,v]=svd(zh,0);


%
%   Compute explained variances
%
lam = diag(ss.^2)/sum(diag(ss.^2));
%

u=uu(:,mode);size(u)

subplot(4,1,1)
contourf(reshape(real(u),[ m m]));colormap(gray); brighten(0.5);
title([' Real Part CEOF 1      '       num2str(lam(mode)*100,2) '%'],'fontname','times')

subplot(4,1,2)
contourf(reshape(imag(u),[ m m]));colormap(gray); brighten(0.5);
title([' Imaginary Part CEOF 1      '     num2str(lam(mode)*100,2) '%'],'fontname','times')

subplot(4,1,3)
contourf(reshape(abs(u),[ m m]));colormap(gray); brighten(0.5);hold
quiver(1:m,1:m,reshape(real(u),[ m m]),reshape(imag(u),[ m m]));
hold off
title([' Phase and Amplitude  of Stationary Wave CEOF 1       '       num2str(lam(mode)*100,2) '%'],'fontname','times')

subplot(4,1,4)
plot(1:n, real(v(:,mode)), 1:n, imag(v(:,mode)),'--');
legend('Real Part','Imag Part');
title(' Time coefficients')


orient tall;
print('-dpdf','-painters','-adobecset',[mfilename 'b.pdf']);
ans =

   400    34


ans =

   400     1

Current plot held