MATLAB的部分源代码,与MATLAB数字信号处理与应用一书相配套

源代码在线查看: 6-8.m

软件大小: 2081 K
上传用户: Butterflies
关键词: MATLAB 源代码 数字信号处理
下载地址: 免注册下载 普通下载 VIP

相关代码

				%例程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');
							

相关资源