找回密码
 注册
关于网站域名变更的通知
查看: 568|回复: 1
打印 上一主题 下一主题

matlab中的conv2卷积运算的三种形式

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2020-1-14 10:27 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

EDA365欢迎您登录!

您需要 登录 才可以下载或查看,没有帐号?注册

x
! j0 @. c$ v2 w& z9 Q: |

9 z$ {3 Y% W# A  K  Z$ k# wmatlab中的conv2是用于对二维数据进行卷积运算,有三个参数可供选择,下面是help content of conv2
- e4 E9 v, _: ?$ I' M
% Q' q. P, B+ ?conv2 Two dimensional convolution.0 a* s# _* k) k" J9 \8 y

! q) R  L$ P' @5 h) T+ k    C = conv2(A, B) peRForms the 2-D convolution of matrices A and B.
- f- c: s" M% r    If [ma,na] = size(A), [mb,nb] = size(B), and [mc,nc] = size(C), then# r+ A: h6 m/ s+ O' `
    mc = max([ma+mb-1,ma,mb]) and nc = max([na+nb-1,na,nb]).
9 o; Q9 u" _: @) u2 q$ a8 \
! M' u9 z- F' a' m    C = conv2(H1, H2, A) first convolves each column of A with the vector5 C, I& m5 a+ Q; h, A7 r; ^  Y
    H1 and then convolves each row of the result with the vector H2.  If' g' l2 _" f8 V) p" Z- K
    n1 = length(H1), n2 = length(H2), and [mc,nc] = size(C) then
% M- W7 _- P- t/ D    mc = max([ma+n1-1,ma,n1]) and nc = max([na+n2-1,na,n2]).
. x9 ^7 O8 ?% f0 O" ~    conv2(H1, H2, A) is equivalent to conv2(H1(:)*H2(:).', A) up to
3 P! \' |5 m9 E5 Y( m8 e    round-off.; d% S0 f- d2 ~1 w

8 K% x* M; A  c  \    C = conv2(..., SHAPE) returns a subsection of the 2-D
# z" ]2 B; A6 f, G  x) E! J- G% Y    convolution with size specified by SHAPE:8 G8 x* [) p8 R% \) B
      'full'  - (default) returns the full 2-D convolution,
) a& O# _' k5 K      'same'  - returns the central part of the convolution6 s! s  v  I3 V  x. d  y
                that is the same size as A.2 \* ?6 b3 K3 e
      'valid' - returns only those parts of the convolution
- @. \6 \! J0 F" _) [  B6 |- y7 f                that are computed without the zero-padded edges." Y& A, F. P1 H) A3 b: V6 ^
                size(C) = max([ma-max(0,mb-1),na-max(0,nb-1)],0).
  r% m$ g1 j, W* l5 m& z4 ?# ?- i7 }9 ?4 S% G2 Z/ v0 k0 @; X

; @( `8 L4 c/ q0 ^0 w. S关于full, same以及valid三种参数的区别,如下面的实例所示:' l. i( F% g+ V5 o" M! ]
" W  J/ z2 N' E2 m. A% b: N
full- x* a  c( @; }0 k
5 F' p+ P  [/ k) h/ h. I) i

8 m& i( w! Y8 j# w% G" u. E" ^, D% s. f$ {2 ?9 W- i5 \% N
  s" k: ?; |8 [1 \/ Q; d
same: C6 m+ a% K2 |& I; Z

" Q2 q+ q, ^# ?( ] 4 ^- y6 J5 x. G, x

$ W% _; K0 m, j: i5 ], p- C0 C8 C
4 C( `6 l, K( U2 c( o- D: W( ovalid# H$ K* w1 S: z4 ^. X# n' Y

8 `: w' i- U7 y% @0 o; L5 m3 k  s8 V, h; g
, {; K+ P4 u8 G" u
/ C; k: P9 k- A( c4 U2 @& Z
  • TA的每日心情

    2019-11-29 15:37
  • 签到天数: 1 天

    [LV.1]初来乍到

    2#
    发表于 2020-1-14 19:49 | 只看该作者
    三种形式的matlab中的conv2卷积运算
    您需要登录后才可以回帖 登录 | 注册

    本版积分规则

    关闭

    推荐内容上一条 /1 下一条

    EDA365公众号

    关于我们|手机版|EDA365电子论坛网 ( 粤ICP备18020198号-1 )

    GMT+8, 2025-11-1 20:25 , Processed in 0.187500 second(s), 26 queries , Gzip On.

    深圳市墨知创新科技有限公司

    地址:深圳市南山区科技生态园2栋A座805 电话:19926409050

    快速回复 返回顶部 返回列表