6-8.m

来自「经典数字信号处理滤波器的源代码 重点是利用巴特沃斯模拟滤波器转而设计其它数字滤」· M 代码 · 共 26 行

M
26
字号
%例程6-8  方波信号的离散小波变换
% e.g.6-8.m for example6-8;
%test the function of dwt

clear all;
t=0:.01*pi:10*pi;
x=square(t,80);
X=x+randn(size(x))/10;
subplot(311); plot(t,X);
xlabel('Time t');
axis([0 11*pi  -2 2]);
ylabel('Amplitude X');
title('Analyzed signal ')
 
% Perform single-level discrete wavelet transform of X by haar
%and the kind of signal extension mode is zero-padding extension.  
[ca1,cd1] = dwt(X,'haar','mode','zpd'); 
subplot(323); plot(ca1); title('Approx. coef. for haar'); 
subplot(324); plot(cd1); title('Detail coef. for haar');
 
% Perform single-level discrete wavelet transform of X by coif4,use the default mode .
% and observe edge effects for last coefficients.
[ca2,cd2] = dwt(X,'coif4','mode','sym');
subplot(325); plot(ca2); title('Approx. coef. for coif4'); 
subplot(326); plot(cd2); title('Detail coef. for coif4');

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?