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

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

[复制链接]

该用户从未签到

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

EDA365欢迎您登录!

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

x

5 U) m/ O3 u* I; g" H# {+ K0 ?( x4 N; T* Z7 W0 O+ y
matlab中的conv2是用于对二维数据进行卷积运算,有三个参数可供选择,下面是help content of conv2
$ k9 ?. I2 |. @$ g% T: U' }# k: {
( E9 |/ E" f; d2 ^conv2 Two dimensional convolution.
( P9 L% N9 |9 s1 ?5 l. n
# G  G* r  H. ?0 j4 X( f; E    C = conv2(A, B) peRForms the 2-D convolution of matrices A and B.) \# E" H1 N( E( T7 Q
    If [ma,na] = size(A), [mb,nb] = size(B), and [mc,nc] = size(C), then
6 M3 I# s/ m4 m; L+ C    mc = max([ma+mb-1,ma,mb]) and nc = max([na+nb-1,na,nb]).
/ y/ O7 N- P3 A$ ^2 B2 @5 X! S0 n 2 v- M5 i2 _- c/ ^; _
    C = conv2(H1, H2, A) first convolves each column of A with the vector
* G) }6 O8 Q3 M& p( w5 i& d" j    H1 and then convolves each row of the result with the vector H2.  If2 ^& r( \! Q* E4 P; i/ ?: \6 j
    n1 = length(H1), n2 = length(H2), and [mc,nc] = size(C) then& l$ A( Y7 ~3 H
    mc = max([ma+n1-1,ma,n1]) and nc = max([na+n2-1,na,n2]).# e& L  o  J3 z, L
    conv2(H1, H2, A) is equivalent to conv2(H1(:)*H2(:).', A) up to3 ]+ F: }1 c5 v: U$ O
    round-off.
! W7 |! y/ O) V0 ]/ `- {
! K) |7 c% g( g* S    C = conv2(..., SHAPE) returns a subsection of the 2-D3 L" c6 _: u, Z. l$ I. V$ M
    convolution with size specified by SHAPE:3 {" }* z: u0 w' y7 g& k
      'full'  - (default) returns the full 2-D convolution,' s0 l5 ^% q7 o7 I. [# P
      'same'  - returns the central part of the convolution* n. ?, S, M* d
                that is the same size as A.
4 C9 M/ N/ @1 ^      'valid' - returns only those parts of the convolution
9 i  ~: h9 u  ]7 X                that are computed without the zero-padded edges.: {" T/ Q! S" A' H9 o6 Q1 X0 d
                size(C) = max([ma-max(0,mb-1),na-max(0,nb-1)],0).0 {+ X, Q  C* y6 d1 E* ~! P* _' V4 J

& M6 M( F* h7 ~
0 o/ A9 p- `6 X1 T; ]关于full, same以及valid三种参数的区别,如下面的实例所示:
3 @9 _  ^# Y# t, S3 @% Y( U* b/ f( V& V9 P( e, Y: k$ F
full
/ W. @( n8 |" l% ]6 ~) q: R9 f
' V, C; N2 i. a; ^4 K
! I) \7 x9 k, T4 q
; g) U1 R7 S8 {0 V& J
) d7 F$ v/ k, E2 G% }8 P3 x+ gsame
1 V: X+ j+ \: i+ k9 d
9 K6 t  _6 H$ {; \ - N' x8 F5 g' ]8 Q, v) n8 k& g& `

, X8 g+ M0 {* s4 j* Q" h( M1 I$ H+ ~0 d& p) P3 [
valid7 J1 h5 g5 r$ x  B. E+ {' {- i

& W$ ]8 P4 [& z8 p7 b+ |
0 E8 y( }1 p& r6 q1 P
, V9 Q2 j$ }( }: |( B1 ?
4 q+ M4 m) R, Z/ n; @: V
  • 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-23 23:36 , Processed in 0.156250 second(s), 26 queries , Gzip On.

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

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

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