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('尺度')
墨西哥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('尺度')
相关文章推荐
- 解析在main函数之前调用函数以及对设计的作用详解
- java和matlab画多边形闭合折线图示例讲解
- C#调用Matlab生成的dll方法的详细说明
- 从java中调用matlab详细介绍
- VC++与Matlab混合编程的快速实现
- Matlab 矩阵运算
- matlab与opencv部分函数的对照
- matlab神经网络工具箱创建神经网络
- Matlab
- MATLAB 入门教程
- matlab函数_连通区域
- MATLAB中函数模式和命令模式的区别
- MATLAB 添加自定义的模块到simulink库浏览器
- MATLAB for Mac使编辑器支持中文
- [转]matlab中plot用法
- 初学数模-MATLAB Quick Start! Part I
- 初学数模-MATLAB Quick Start! Part II
- matlab程序优化以及eclipse与github的结合
- matlab中的rand函数(用于产生随机数)
- 图像增强算法四种,图示与源码,包括retinex(ssr、msr、msrcr)和一种混合算法