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

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

[复制链接]

该用户从未签到

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

EDA365欢迎您登录!

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

x

. ?% A7 ]6 A% y6 I2 u3 R, A" W; g" l, `( a9 v# u6 y
matlab中的conv2是用于对二维数据进行卷积运算,有三个参数可供选择,下面是help content of conv2; d! K. Z" S7 Q4 H; e0 ?' Y1 q
. m, Z* m4 N7 y; I5 D
conv2 Two dimensional convolution.
# k9 d% t3 t* X* S. `$ x
- p) N0 |6 `5 _9 _. K  X    C = conv2(A, B) peRForms the 2-D convolution of matrices A and B.1 A5 ^9 r1 ?" R$ H* B$ c9 F
    If [ma,na] = size(A), [mb,nb] = size(B), and [mc,nc] = size(C), then
" D; s1 E( J7 |% u, d    mc = max([ma+mb-1,ma,mb]) and nc = max([na+nb-1,na,nb]).( K' k, s3 S6 i$ }5 z+ E5 u7 I

& _: T3 s: {3 s" t  p& \    C = conv2(H1, H2, A) first convolves each column of A with the vector! ^- q; M( Y) [$ O- b* s( E
    H1 and then convolves each row of the result with the vector H2.  If
( s8 I& t' c3 L3 G2 c7 g% u    n1 = length(H1), n2 = length(H2), and [mc,nc] = size(C) then
' E* h+ R! D% d2 {1 I- e# I4 u    mc = max([ma+n1-1,ma,n1]) and nc = max([na+n2-1,na,n2]).
" b" @2 K9 h' a7 C, a+ [$ z    conv2(H1, H2, A) is equivalent to conv2(H1(:)*H2(:).', A) up to& i! P$ z+ [! f/ K5 w1 V
    round-off.. K; N+ E; e% c

# S6 |9 _9 K+ {- _! l    C = conv2(..., SHAPE) returns a subsection of the 2-D( t$ {# p: e* }" e4 ]* t! Q
    convolution with size specified by SHAPE:# \) I+ B# l; z0 J5 {$ S2 d3 v; c
      'full'  - (default) returns the full 2-D convolution,  N9 I' K4 J0 h4 }% K
      'same'  - returns the central part of the convolution
1 ^: Z; ?1 ?3 k: D1 p6 S                that is the same size as A.( N, |0 z' G  \7 r8 S' R1 x
      'valid' - returns only those parts of the convolution0 p6 n3 l* X: E5 s* m3 q- X3 {
                that are computed without the zero-padded edges.
4 [3 K+ {& A+ |8 r+ \                size(C) = max([ma-max(0,mb-1),na-max(0,nb-1)],0).6 o7 F' M& f# a$ z
* j' O0 Z  y9 j* @

9 E4 q& g0 f! ?. P1 Y8 z关于full, same以及valid三种参数的区别,如下面的实例所示:
# P/ k3 _5 w3 R; j! e% J5 F  C  n% F/ p' I
full9 e; v" k2 v7 Y5 Z3 E4 R
( q/ v5 o; O3 u( M
7 Q* \7 ~& b7 e5 Z; R& `( ?
- Z) k6 f% D& d/ B0 J
3 C4 w* y( x5 ~$ w6 E0 |; c( H
same$ Q8 x, T; g3 X( |

3 ~& p3 E- _9 S# y! f; r
6 y) X! F9 _0 D7 F0 L: Y1 {1 e3 f- m2 ]3 i! W  X

# S% H  k0 ~1 d6 k  K  o2 Ovalid
* ]4 V' d3 e: A$ {, z
( T1 F  {3 U/ l; w0 v/ `& l/ X0 T+ |8 p' A- }  p. }3 ^1 B

+ F0 m; w. X, g, U$ n! z3 o. ~4 j  i) j" T5 U8 `
  • 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-10-31 22:04 , Processed in 0.171875 second(s), 26 queries , Gzip On.

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

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

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