clc,close all,clear all;
% 第一种:haar小波函数
% 返回2^ITFR点上的尺度变换函数(phi)和小波函数(psi).其中ITFR是指迭代次数
[phi,gll,xval]=wavefun('haar',20);
figure
subplot(211)
plot(xval,gll,'r');
title('haar小波函数时域波形')
xlabel('时间t')
g12=abs(fft(gll));
subplot(212);
plot(g12,'g');
title('haar小波函数幅频波形')
xlabel('频率f')

% 第二种dbN小波
% 返回2^ITFR点上的尺度变换函数(phi)和小波函数(psi).其中ITFR是指迭代次数
[phi,g21,xval]=wavefun('db4',20);
figure
subplot(211)
plot(xval,g21,'r');
title('dbN小波函数时域波形')
xlabel('时间t')
g22=abs(fft(g21));
subplot(212);
plot(g22,'g');
title('dbN小波函数幅频波形')
xlabel('频率f')

% 第三种Mexican hat小波函数
d=-8,h=8,n=200;
[g31,xval]=mexihat(d,h,n);
figure
subplot(211)
plot(xval,g31,'r');
title('mexihat小波函数时域波形')
xlabel('时间t')
g32=abs(fft(g31));
subplot(212);
plot(g32,'g');
title('mexihat小波函数幅频波形')
xlabel('频率f')

% 第四种 morlet小波函数
d=-8,h=8,n=200;
[g41,xval]=morlet(d,h,n);
figure
subplot(211)
plot(xval,g41,'r');
title('morlet小波函数时域波形')
xlabel('时间t')
g42=abs(fft(g41));
subplot(212);
plot(g42,'g');
title('morlet小波函数幅频波形')
xlabel('频率f')

% 第五种 Meyer小波函数
d=-8,h=8,n=128;
[g41,xval]=morlet(d,h,n);
figure
subplot(211)
plot(xval,g41,'r');
title('meyer小波函数时域波形')
xlabel('时间t')
g42=abs(fft(g41));
subplot(212);
plot(g42,'g');
title('meyer小波函数幅频波形')
xlabel('频率f')





Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐