function cwt = CWT(x,nvoice,wavelet,oct,scale)
% CWT -- Continuous Wavelet Transform
% Usage
% cwt = CWT(x,nvoice,wavelet,oct,scale)
% Inputs
% x signal, dyadic length n=2^J, real-valued
% nvoice number of voices/octave
% wavelet string 'Gauss', 'DerGauss','Sombrero', 'Morlet'
% octave Default=2
% scale Default=4
% Outputs
% cwt matrix n by nscale where
% nscale = nvoice .* noctave
%
% Description
%
%
if nargin<4,
oct = 2;
scale = 4;
end
% preparation
x = ShapeAsRow(x);
n = length(x);
xhat = fft(x);
xi = [ (0: (n/2)) (((-n/2)+1):-1) ] .* (2*pi/n);
% root
omega0 = 5;
% noctave = floor(log2(n))-2;
% noctave = floor(log2(n))-1;
noctave = floor(log2(n))-oct;
nscale = nvoice .* noctave;
cwt = zeros(n,nscale);
kscale = 1;
% scale = 4;
% scale = 16;
for jo = 1:noctave,
for jv = 1:nvoice,
qscale = scale .* (2^(jv/nvoice));
omega = n .* xi ./ qscale ;
if strcmp(wavelet,'Gauss'),
window = exp(-omega.^2 ./2);
elseif strcmp(wavelet,'DerGauss'),
window = i.*omega.*exp(-omega.^2 ./2);
elseif strcmp(wavelet,'Sombrero'),
window = (omega.^2) .* exp(-omega.^2 ./2);
elseif strcmp(wavelet,'Morlet'),
window = exp(-(omega - omega0).^2 ./2) - exp(-(omega.^2 + omega0.^2)/2);
end
% Renormalization
window = window ./ sqrt(qscale);
what = window .* xhat;
w = ifft(what);
cwt(1:n,kscale) = real(w)';
kscale = kscale+1;
end
scale = scale .*2;
end
% kscale = 1 -> low frequencies
% the matrix cwt is ordered from low to high frequencies
寒泊
- 粉丝: 86
- 资源: 1万+
最新资源
- 处理定时器和消息的队列.7z
- 基于netty3.5的游戏服务器端框架 消息封装,编解码结构提供扩展,请求消息队列处理,基于protobuf的实例已经完成.7z
- 一个服务器处理框架,包括 协议处理,消息处理,持久层数据处理.7z
- matlab实现粒子群算法综合线阵低副瓣方向图设计-粒子群算法-天线阵列-PSO算法-matlab
- 动态规划算法详解及应用实例分析
- fscan一款内网资产排查工具提高工作效率
- 800高压脱泡机.STEP全套设计资料100%好用.zip
- 动态规划算法详解及Python代码实现
- 50kg双向单立柱堆垛机step全套设计资料100%好用.zip
- BBR12包装机卷包机热熔编带机sw12可编辑+cad全套设计资料100%好用.zip
- SQLAlchemy 基础用法完整示例
- X射线平板探测器架车step全套设计资料100%好用.zip
- TE-桁架机械手sw12全套设计资料100%好用.zip
- Z2021-4-顶升移栽机sw18可编辑全套设计资料100%好用.zip
- 2024注册测绘师《综合能力》讲义-第3章-工程测量(3)城乡规划与建筑工程测量.pdf
- 点胶贴合机step全套设计资料100%好用.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
评论0