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

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

[复制链接]

该用户从未签到

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

EDA365欢迎您登录!

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

x

7 m+ V9 `. F2 i  e( F( }! C- B2 X' Q' H+ s5 n
matlab中的conv2是用于对二维数据进行卷积运算,有三个参数可供选择,下面是help content of conv2+ V; i- b4 |. {% |1 T; B2 f
  f! r- @5 L# M* o; n- @( |* \( @
conv2 Two dimensional convolution.; I; z9 Z$ ]& [& x2 N5 @% M: X

& s2 F2 K- F1 Z- V5 N    C = conv2(A, B) peRForms the 2-D convolution of matrices A and B.0 ~- y3 |4 @6 Q3 ~1 M
    If [ma,na] = size(A), [mb,nb] = size(B), and [mc,nc] = size(C), then9 Q" t! n6 |" G; G9 v
    mc = max([ma+mb-1,ma,mb]) and nc = max([na+nb-1,na,nb]).
8 c% ]  q! F% H2 [4 z & I' l: I; e6 _& s- B# K
    C = conv2(H1, H2, A) first convolves each column of A with the vector
2 z2 _0 Z6 j& b6 Z( ^8 M7 c    H1 and then convolves each row of the result with the vector H2.  If1 {9 l9 n# J/ G2 `) M
    n1 = length(H1), n2 = length(H2), and [mc,nc] = size(C) then' Q+ J& J+ Z& I( E
    mc = max([ma+n1-1,ma,n1]) and nc = max([na+n2-1,na,n2]).  Z3 ?( j( M% Z6 R2 H/ \8 z
    conv2(H1, H2, A) is equivalent to conv2(H1(:)*H2(:).', A) up to
* h- P) D# S& |8 p    round-off.
% ?- A& d9 E# z; G
; U% N# i2 z! P) E  k6 n  ^    C = conv2(..., SHAPE) returns a subsection of the 2-D
: F5 x/ \, b8 S' X. x3 x+ s4 y    convolution with size specified by SHAPE:
" y  [# J% a4 }% b% ^  t) c2 @      'full'  - (default) returns the full 2-D convolution,5 L% c0 ^  O, b% }7 u
      'same'  - returns the central part of the convolution2 \7 R8 K" W$ y/ C" d# N
                that is the same size as A.
2 q8 d' g; f- j1 G: |, B! ?/ u      'valid' - returns only those parts of the convolution
1 O, Y  m+ \$ \* S                that are computed without the zero-padded edges.1 R. G& n! O$ M/ j9 u1 o
                size(C) = max([ma-max(0,mb-1),na-max(0,nb-1)],0).9 ]; T; v+ R5 E/ O) y
& \0 m0 A! Q; L- x) d* n

: t3 I& n$ h. f& o* n6 T8 b. m$ I3 E$ Y关于full, same以及valid三种参数的区别,如下面的实例所示:, z% p9 ]5 S: ~* ^6 ~5 k% _

! S( j% O* ^$ b- i; Qfull
8 q: O2 G# u5 ~
$ Y. e: b. w- h% b # E( s  U0 p5 R4 y

) N2 }, n. q7 D; O& Y9 n) t
1 q) u1 f6 f) {7 nsame
& Q9 f2 ~& {% X9 w8 O5 Y# @5 ~# i6 G( v7 S
1 K. u- B4 ~! J& a. m

+ l" D$ o" _0 l0 B) W+ n5 c
9 L- C) O1 j; b/ G1 e! k5 c; \valid
& r6 Z) ~- G8 J, B3 g
$ j( ^; W8 l- Y+ Z0 Z4 Y$ m1 x$ o9 y# Y6 {6 G  }

  c& K  X8 o; ]/ a4 M8 ]+ s0 K
  • 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-8-5 04:18 , Processed in 0.109375 second(s), 26 queries , Gzip On.

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

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

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