您的位置:首页 > 编程语言 > MATLAB

Matlab_Marr小波尺度变换图

2015-10-10 12:47 931 查看
多尺度的连续小波变换分解后时间尺度图

墨西哥Marr小波函数:

%delta 小波变换尺度

%N     小波函数的长度

%s     原始信号

%g     原始信号某个尺度下的小波变化系数

function g=Singularity_Detection(delta,N,s);

%保持信号长度

n=length(s);

% 构造墨西哥小帽小波函数

for index_x=1:N;

    x=index_x-(N+1)/2;

    phi_x(index_x)=((pi^(-1/4))*(2/sqrt(3)))*(1-x.*x/(delta^2))*exp(-(x.*x)/(2*delta^2));

end;

phi_x=phi_x/norm(phi_x);  %能量归一化

g=conv(s,phi_x); %卷积

g=wkeep(g,n);    %保持信号长度

绘图:

clc;clear

load vonkoch

vonkoch=vonkoch(1:510);

S_Min=1;

S_Max=32;

index=0;

for scale=S_Max:-1:S_Min;

    index=index+1;

    cwt_coef(index,:)=Singularity_Detection(scale,32*(scale),vonkoch);

end

cwtcoef_abs=abs(cwt_coef);

for index=S_Min:S_Max

    max_coef=max(cwtcoef_abs(index,:));

    min_coef=min(cwtcoef_abs(index,:));

    ext=max_coef-min_coef;

    cwtcoef_abs(index,:)=64*(cwtcoef_abs(index,:)-min_coef)/ext;

end

figure(1)

subplot(2,1,1);

plot(vonkoch);

xlabel('Time');

ylabel('Amplitude');

title('Sigal');

axis([1 510 0 0.02])

subplot(2,1,2)

colormap(pink(64));

image(cwtcoef_abs)

set(gca,'YTick',2:3:32)

set(gca,'YTickLabel',32:-3:2)

title('连续小波变换时间尺度图')

xlabel('时间')

ylabel('尺度')
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息