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

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

[复制链接]

该用户从未签到

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

EDA365欢迎您登录!

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

x

9 m7 d+ o' F% T, n: w  q: X+ w( x3 Y9 S# x% M9 j' [
matlab中的conv2是用于对二维数据进行卷积运算,有三个参数可供选择,下面是help content of conv2
: d" d& [- k3 R2 W
5 S2 H8 d) e, j% E% K) v/ s# \conv2 Two dimensional convolution.! D" Z+ y0 _2 C& d9 W7 k

  Q2 P+ R$ a' A* A    C = conv2(A, B) peRForms the 2-D convolution of matrices A and B.' E; x1 G& I  {0 @
    If [ma,na] = size(A), [mb,nb] = size(B), and [mc,nc] = size(C), then
' N2 v( B6 E+ h' ~    mc = max([ma+mb-1,ma,mb]) and nc = max([na+nb-1,na,nb]).8 B; g4 \. Y+ V9 Y  y
- z) S) \  D( }4 P3 F: p0 ^* @7 O% G
    C = conv2(H1, H2, A) first convolves each column of A with the vector
0 w* C( f9 ~' O! K' W. d    H1 and then convolves each row of the result with the vector H2.  If2 {; j( c9 K9 ]- l6 ?1 u: {
    n1 = length(H1), n2 = length(H2), and [mc,nc] = size(C) then
4 e. F  C' {. C+ d. S" W. F9 r( e    mc = max([ma+n1-1,ma,n1]) and nc = max([na+n2-1,na,n2]).
$ B" \% y- q# v% b0 M  `    conv2(H1, H2, A) is equivalent to conv2(H1(:)*H2(:).', A) up to
3 z5 \. c7 h0 m- q0 v+ o# W    round-off.
8 g4 N8 ]* T. v* o3 P& m& f
) W! ], u# p5 P6 D" X9 S( ]    C = conv2(..., SHAPE) returns a subsection of the 2-D4 X7 u9 F, q) |, t5 a( k
    convolution with size specified by SHAPE:
7 N1 N4 L$ f: q, i- ]" w      'full'  - (default) returns the full 2-D convolution,9 ^5 C; I) ~1 r* u
      'same'  - returns the central part of the convolution0 K( J6 F2 o1 e$ [, _% Z7 J
                that is the same size as A.8 y' `. {+ V* |4 e/ C
      'valid' - returns only those parts of the convolution  a. ]5 _# h' X4 y; `' p6 f+ h
                that are computed without the zero-padded edges.% m1 j5 [+ i  m9 R" F
                size(C) = max([ma-max(0,mb-1),na-max(0,nb-1)],0).2 S# Q2 x! }/ o- ~

1 b1 U% m  ^/ ?% @# `. ?; N5 I0 d8 v  Y( C* Y/ U) O, L9 }
关于full, same以及valid三种参数的区别,如下面的实例所示:
, r7 m5 N' E( [' ~% h5 O& A) h$ V, k& F7 o* e" N7 s
full
6 W( ?' n! a" J* x! d1 b0 A# R" v; f
; j  g6 i3 s: \$ r; p. k# r
# g6 }) T- c9 [. E' X5 x
$ H' {4 @% Y5 c1 F
same
$ B$ v/ w' W4 w% N' z. w" U  z  k5 W2 u' m: W5 f& z
: u! G) F) }4 Y, {1 c0 L
$ h$ h, ~5 V! v
. ~% A8 K: d2 W% `$ p
valid3 ~% P8 I" v# }, d- S7 b% U
4 L+ r6 e- C  e% m. T% ?! P
9 l0 ^8 L- B6 C! s' r

8 `6 H7 c) B( N( e/ \; N$ _6 @7 O% k2 ?) \% O4 J
  • 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-7-19 23:36 , Processed in 0.125000 second(s), 26 queries , Gzip On.

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

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

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