• 大小: 2KB
    文件类型: .m
    金币: 1
    下载: 0 次
    发布日期: 2021-01-05
  • 语言: Matlab
  • 标签: matlab  

资源简介

matlab编写的一维离散小波变换DWT,有滤波器产生,mallat分解和重构算法的详细过程

资源截图

代码片段和文件信息

clc;clear;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%1原始图像的产生
f1=50;         %  频率1
f2=100;        %  频率2
fs=2*(f1+f2);  %  采样频率
Ts=1/fs;       %  采样间隔
N=120;         %  采样点数
n=1:N;
y=sin(2*pi*f1*n*Ts)+sin(2*pi*f2*n*Ts);  %  正弦波混合
figure;
plot(y);
title(‘Original Signal‘)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 2.小波滤波器产生 
h=wfilters(‘db10‘‘l‘);  %  低通
g=wfilters(‘db10‘‘h‘);  %  高通

figure(2);
subplot(211);
plot(h);
title(‘low_ pass decompose filter‘);
subplot(212);
plot(g);
title(‘high_ pass decompose filter‘);

h=[hzeros(1N-length(h))];  %  补零(圆周卷积,且增大分辨率变于观察)
g=[gzeros(1N-length(g))];  %  补零(圆周卷积,且增大分辨率变于观察)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

评论

共有 条评论