wconv2.m
上传用户:haiyisale
上传日期:2013-01-09
资源大小:3246k
文件大小:1k
源码类别:

波变换

开发平台:

Matlab

  1. function y = wconv2(type,x,f,shape)
  2. %WCONV2 2-D Convolution.
  3. %   Y = WCONV2(TYPE,X,F) performs the 2-D convolution
  4. %   of X and F.
  5. %
  6. %   Y = WCONV2('r',X,F) or Y = WCONV2('row',X,F)
  7. %   if X is a matrix and F a vector, performs 
  8. %   the 1-D convolution of the rows of X and F.
  9. %
  10. %   Y = WCONV2('c',X,F) or Y = WCONV2('col',X,F)
  11. %   if X is a matrix and F a vector, performs 
  12. %   the 1-D convolution of the columns of X and F.
  13. %
  14. %   Y = WCONV2(TYPE,X,F) with TYPE = {2,'2','2d' or '2D'}
  15. %   and if X and F are matrices, performs the 2-D 
  16. %   convolution of X and F.
  17. %   M. Misiti, Y. Misiti, G. Oppenheim, J.M. 06-May-2003.
  18. %   Last Revision: 19-May-2003.
  19. %   Copyright 1995-2004 The MathWorks, Inc.
  20. %   $Revision: 1.1.6.2 $  $Date: 2004/03/15 22:42:32 $
  21. if nargin<4 , shape = 'full'; end
  22. switch type
  23.     case 'row' , y = conv2(x,f(:)',shape);
  24.     case 'col' , y = conv2(x',f(:)',shape); y = y';
  25.     case '2d'  , y = conv2(x,f,shape);
  26. end