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

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

[复制链接]

该用户从未签到

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

EDA365欢迎您登录!

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

x

, a" X- |- u9 a% M/ Q3 c# r+ D, D5 E' ]
matlab中的conv2是用于对二维数据进行卷积运算,有三个参数可供选择,下面是help content of conv2
; a# W/ G$ N: t% D6 ]: N7 B1 A7 [" e  Z4 ?1 o# \/ f  K8 W
conv2 Two dimensional convolution.4 x0 V% N" O- s& r& w' \

* W& _) w( y! H' ^    C = conv2(A, B) peRForms the 2-D convolution of matrices A and B.2 D' e8 k3 j) u# K* [" d
    If [ma,na] = size(A), [mb,nb] = size(B), and [mc,nc] = size(C), then; d# S. V9 p, D2 w$ a
    mc = max([ma+mb-1,ma,mb]) and nc = max([na+nb-1,na,nb]).
! a% S7 g6 ?, V' G5 N ' Q) `& \4 M- X: i9 H* n3 E: m3 z& X: t1 ~
    C = conv2(H1, H2, A) first convolves each column of A with the vector
9 y  R: ?6 h$ q( X( ?& K) \    H1 and then convolves each row of the result with the vector H2.  If/ i: J0 \- Z# T4 E5 g+ o, E% q$ F
    n1 = length(H1), n2 = length(H2), and [mc,nc] = size(C) then
; O0 |+ D1 P: G8 r    mc = max([ma+n1-1,ma,n1]) and nc = max([na+n2-1,na,n2]).
2 D' _) r" z' j; P    conv2(H1, H2, A) is equivalent to conv2(H1(:)*H2(:).', A) up to
* u4 E  f( N! {& W    round-off.
, Y3 W. k8 t9 S0 [: ?8 @2 C * H1 {3 D' Q  e0 L
    C = conv2(..., SHAPE) returns a subsection of the 2-D
5 v$ d8 Q- r5 L% @2 J: f    convolution with size specified by SHAPE:
4 s& v4 }$ o! y      'full'  - (default) returns the full 2-D convolution,/ L) T9 Z- l/ L5 D1 ?
      'same'  - returns the central part of the convolution5 H+ Q! u+ C- J
                that is the same size as A.) z# n& u, u) }- {. A
      'valid' - returns only those parts of the convolution0 x, v$ Q! B& S. z! M, p
                that are computed without the zero-padded edges.
* B. U6 c! K. e3 u" C- M                size(C) = max([ma-max(0,mb-1),na-max(0,nb-1)],0).7 R2 w; u6 c  d+ J3 Y
) Y8 E& B/ D* k- l
9 D# z0 J; B/ c2 S: {: O% C
关于full, same以及valid三种参数的区别,如下面的实例所示:
' l  @: w" g! Q1 u# K/ X, [; i) f
full/ o  T" `6 }1 |5 Z0 k
* K1 U7 z2 |0 k/ n* a6 i

7 R5 W% R8 o" D; w
4 q; ^4 z0 e' [/ W% q1 L
" v2 u( u8 C* X2 Msame
$ D5 {- ]0 y( W5 K/ }- c( h% z
- w9 k& S5 K0 v# t8 O% x3 [* Y
% x  s8 b" l) j3 s. c! _& d2 }! e* k6 T

' s8 K7 C; N% nvalid3 d9 v. M- u6 t) Y6 H, B, _

# N3 W* V9 w1 a2 M2 {$ I7 v$ ?) I2 N7 D
% A) ~  }( b: g5 [7 w$ j

5 M" |+ @1 @2 P+ }) p/ ]  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-7-21 05:35 , Processed in 0.140625 second(s), 26 queries , Gzip On.

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

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

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