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

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

[复制链接]

该用户从未签到

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

EDA365欢迎您登录!

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

x
: w5 A; S* V6 W8 i% l7 |3 t

7 U- r9 Y0 l3 [3 dmatlab中的conv2是用于对二维数据进行卷积运算,有三个参数可供选择,下面是help content of conv2- `/ l5 p* l: t  |& d( E* x: t
  r7 l+ S& _8 j% R9 J$ q; A2 D$ A- Y* b
conv2 Two dimensional convolution.
5 p  E. I, M* x; a1 N% W
8 G! m  ~  J/ `- \, n8 z/ T1 H! K* L% U    C = conv2(A, B) peRForms the 2-D convolution of matrices A and B.
5 f; k) v- _" ]0 t+ T& j" k7 _    If [ma,na] = size(A), [mb,nb] = size(B), and [mc,nc] = size(C), then+ j" Q/ C, @( {# R" |9 {
    mc = max([ma+mb-1,ma,mb]) and nc = max([na+nb-1,na,nb]).
! D* r3 r5 o# x( W7 J! K3 _( N 6 p; k0 B) A  I# ~
    C = conv2(H1, H2, A) first convolves each column of A with the vector- B5 S$ i- _: B* t8 S4 U# P% t& n9 ~& L3 e
    H1 and then convolves each row of the result with the vector H2.  If8 b/ C1 E9 r8 i8 }; C/ `
    n1 = length(H1), n2 = length(H2), and [mc,nc] = size(C) then
0 ]2 ~% t- v$ ^3 ^: X" |3 h    mc = max([ma+n1-1,ma,n1]) and nc = max([na+n2-1,na,n2]).
8 P2 U8 d+ U7 j3 Q9 ~, R    conv2(H1, H2, A) is equivalent to conv2(H1(:)*H2(:).', A) up to0 i! z3 }  k2 N6 N8 J6 c6 j
    round-off.$ O" S7 {* Z$ M# V) v+ F  f: u
6 C. _) O4 P! M% V0 f* I" ^) Z
    C = conv2(..., SHAPE) returns a subsection of the 2-D
. C2 C+ f. {6 f5 I& p# j    convolution with size specified by SHAPE:4 q, j# P  U$ B& p& }9 d# @) h, ]" X+ s
      'full'  - (default) returns the full 2-D convolution,  n: {3 B$ h! K4 f: Q7 o
      'same'  - returns the central part of the convolution5 I8 t2 Q# J3 R! w$ I, [
                that is the same size as A.3 l/ V2 `' a3 l  G$ m* z
      'valid' - returns only those parts of the convolution8 p5 }" S& C# E$ {* _5 w
                that are computed without the zero-padded edges.
, @% V) m& x: u                size(C) = max([ma-max(0,mb-1),na-max(0,nb-1)],0).. b4 p) I5 [; S+ q1 S

3 N( w9 A2 U3 x% G! U) _6 W- S( \( d
关于full, same以及valid三种参数的区别,如下面的实例所示:9 v9 I0 z  R( _! U* ]

7 u5 S, ~" h5 _+ E9 Y& I+ c$ rfull# N& I. r& J/ G7 Q5 S1 T

5 [: b+ U) y4 |7 F2 v ) J- A8 i! }3 F3 s# V; r
2 l" O. r& H! `: {, E: i
, h5 M4 s7 a! c7 }; F$ D
same
! Y; `6 q2 F+ W/ y* R9 J: t9 B& q

4 k! E7 P# f$ R: k; A" I
3 P+ k' T; K0 q: p
- C! |3 O: m7 f; h( Z/ X( q, F: Uvalid
2 A# F' l# ~7 S5 ^: ?& _
: m% @9 D! U9 F& v* Y( A4 ]
0 L1 ?) I8 |* g% p
3 p! R6 P' a. r1 @  h8 k6 |. g5 w6 t6 Z- {% Z3 |
  • 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-6-15 12:42 , Processed in 0.078125 second(s), 26 queries , Gzip On.

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

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

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