⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unfoldmeyer.sci

📁 小波分解源代码
💻 SCI
字号:
function unfldx = UnfoldMeyer(x, sympts, polarity, windows,deg)
// UnfoldMeyer -- Unfold a vector using a specified window.
//  Usage
//    unfldx = UnfoldMeyer(x, sympts, polarity, windows,deg)
//  Inputs
//    fldx     folded version of x. Supported on interval [sympts(1),sympts(2)]
//                (typically of length n=2^j for some j)
//    sympts    symmetry points, of the form [a,b]
//    polarity  string selection folding polarity
//                      ' mp  =>  (-,+) '
//                      ' pm  =>  (+,-) '
//                      ' mm  =>  (-,-) '
//                      ' pp  =>  (+,+) '
//    windows    string selecting windows
//                      'm' => Mother Meyer Wavelet windows
//                      't' => Truncated Mother Meyer Wavelet windows
//                      'f' => Father Meyer Wavelet windows
//    deg       degree of Meyer windows
//
//  Outputs 
//    unfldx    unfolded version of x. Extended outside interval [sympts(1),sympts(2)]
//              using the selected polarity and windows
//  See Also
//    WindowMeyer, CoarseMeyerProj, DetailMeyerProj, FineMeyerProj
// 
//  Copyright Aldo I Maalouf

	pio2 = %pi/2;

// **  Choices are broken down by windows, and polarity within windows.

	if (windows == 'm') ,
	  epss    = floor(sympts(1)/3);
	  epsp   = sympts(1) - epss - 1;
	  if ( polarity == 'mp' ),
		xi    = ((sympts(1)+1 ):(sympts(2)) ) ./ sympts(2);
		lftt  = waverow(x(1:epss)).* cos(pio2*WindowMeyer(3*xi(1:epss)-1,deg));
		lmid = waverow(x(1:epss)).* sin(pio2*WindowMeyer(3*xi(1:epss)-1,deg));
		rmid = waverow(x(epss+1:epss+epsp)).*cos(pio2*WindowMeyer(1.5*xi(epss+1:epss+epsp)-1,deg)); 
			   
		rght = waverow(x(epss+1:epss+epsp)).*sin(pio2*WindowMeyer(1.5*xi(epss+1:epss+epsp)-1,deg ));
			  
		unfldx = [ -mtlb_fliplr(lftt) 0 lmid rmid x(sympts(1)) mtlb_fliplr(rght) ];
	  elseif ( polarity == 'pm' ),
		xi    = ((sympts(1) ):(sympts(2)-1) ) ./ sympts(2);
		lftt  = waverow(x(2:epss+1)).* cos(pio2*WindowMeyer(3*xi(2:epss+1)-1,deg));
		lmid = waverow(x(2:epss+1)).* sin(pio2*WindowMeyer(3*xi(2:epss+1)-1,deg));
		rmid = waverow(x(epss+2:epss+epsp+1)).* cos(pio2*WindowMeyer(1.5*xi(epss+2:epss+epsp+1)-1,deg));
		rght = waverow(x(epss+2:epss+epsp+1)).* sin(pio2*WindowMeyer(1.5*xi(epss+2:epss+epsp+1)-1,deg));		   
		unfldx = [ mtlb_fliplr(lftt) x(1) lmid rmid  0 -mtlb_fliplr(rght) ];
	  end
	
	elseif (windows == 'f') ,
	  n       = length2(x);
	  epss     = floor(sympts(2)/3) ;
	  innerx  = ((sympts(2)-epss):(sympts(2)-1))./ (2*sympts(2)) ;
	  outerx  = ((sympts(2)+1):(sympts(2)+epss))./ (2*sympts(2)) ;
	  if ( polarity == 'pp' ),
		lftt  = mtlb_fliplr(x(2:(epss+1))').* cos(pio2*WindowMeyer(3*mtlb_fliplr(outerx)-1,deg));
			   
		lmid = waverow(x(2:(epss+1))).* cos(pio2*WindowMeyer(3*mtlb_fliplr(innerx)-1,deg));
			   
		rmid = waverow(x(2*sympts(2)-epss+1:2*sympts(2))).* cos(pio2*WindowMeyer(3*innerx-1,deg));
			   
		rght = mtlb_fliplr( waverow(x(2*sympts(2)-epss+1:2*sympts(2))) ) .* cos(pio2*WindowMeyer(3*outerx-1,deg));
			   
		unfldx = [ lftt  x(1)  lmid  waverow(x((2+epss):(2*sympts(2)-epss))) rmid  x((2*sympts(2)+1))  rght ];
				   
	  elseif ( polarity == 'mm' ),
		lftt  = mtlb_fliplr(waverow(x(1:epss))).* cos(pio2*WindowMeyer(3*mtlb_fliplr(outerx)-1,deg));
			   
		lmid = waverow(x(1:epss)).* cos(pio2*WindowMeyer(3*mtlb_fliplr(innerx)-1,deg));
			   
		rmid = waverow(x(2*sympts(2)-epss:2*sympts(2)-1)).* cos(pio2*WindowMeyer(3*innerx-1,deg));
			   
		rght = mtlb_fliplr( waverow(x(2*sympts(2)-epss:2*sympts(2)-1))) .*  cos(pio2*WindowMeyer(3*outerx -1,deg));
			  
		unfldx = [ -lftt 0 lmid waverow(x(epss+1:2*sympts(2)-epss-1)) rmid 0 -rght ];
	  end
	
	elseif (windows == 't') ,
	  epss    = floor(sympts(1)/3);
	  epsp   = sympts(1) - epss - 1;
	  if ( polarity == 'mp' ),
		xi = ((sympts(1)+1):sympts(2) ) ./ sympts(2) ;
		lftt  = waverow(x(1:epss)).* cos(pio2*WindowMeyer(3*xi(1:epss)-1,deg));
		lmid = waverow(x(1:epss)).* sin(pio2*WindowMeyer(3*xi(1:epss)-1,deg));
		rmid = waverow(x(epss+1:epss+epsp));
		unfldx = [ -mtlb_fliplr(lftt) 0 lmid rmid x(epss+epsp+1)*sqrt(2)];
	  elseif ( polarity == 'pm' ),
		xi    = ((sympts(1) ):(sympts(2)-1) ) ./ sympts(2);
		lftt  = waverow(x(2:epss+1)).* cos(pio2*WindowMeyer(3*waverow(xi(2:epss+1))-1,deg));
		lmid = waverow(x(2:epss+1)).* sin(pio2*WindowMeyer(3*waverow(xi(2:epss+1))-1,deg));
		rmid = waverow(x(epss+2:epss+epsp+1));
		unfldx = [ mtlb_fliplr(lftt) x(1) lmid rmid 0 ];
	  end
	else 
	  ' Either the mother or truncated mother Meyer wavelets '
	  ' must be used with the polarity chosen.               '
	end

 
endfunction   

⌨️ 快捷键说明

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