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

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

[复制链接]

该用户从未签到

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

EDA365欢迎您登录!

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

x

/ N5 V' o/ Y. o; ?7 P3 O% z2 C
. T) G5 a, o  L3 W4 Z7 }matlab中的conv2是用于对二维数据进行卷积运算,有三个参数可供选择,下面是help content of conv2. G3 z/ `6 e7 P3 B7 V& y

4 B; M- ~& z- H" x; g  ~conv2 Two dimensional convolution.
. w1 |* N: G3 x4 l0 x' z
2 r% x- I* a  k" X5 j    C = conv2(A, B) peRForms the 2-D convolution of matrices A and B.
, Z. O4 p/ K! t5 b" V# q    If [ma,na] = size(A), [mb,nb] = size(B), and [mc,nc] = size(C), then& e% G1 \5 _7 P1 S; q  c* k
    mc = max([ma+mb-1,ma,mb]) and nc = max([na+nb-1,na,nb]).
& I/ R- F' ~( Z% k ; p2 e% w) o2 h: q
    C = conv2(H1, H2, A) first convolves each column of A with the vector
" |- v# Z0 x! d/ F, k" O% L    H1 and then convolves each row of the result with the vector H2.  If
1 k, p5 P( Z" Q( |/ Z- p6 f    n1 = length(H1), n2 = length(H2), and [mc,nc] = size(C) then5 k; s' n3 g' a% M* u
    mc = max([ma+n1-1,ma,n1]) and nc = max([na+n2-1,na,n2]).* O1 }$ L0 Z6 W2 n
    conv2(H1, H2, A) is equivalent to conv2(H1(:)*H2(:).', A) up to
. q9 W$ E2 x" m& p    round-off.; \  b" w3 Q5 n) F  K* q
" z8 l$ G# r; n8 D) s
    C = conv2(..., SHAPE) returns a subsection of the 2-D
0 \8 ~. F2 f: @( Z    convolution with size specified by SHAPE:
4 G- c8 j: Y  d: _. D4 C      'full'  - (default) returns the full 2-D convolution,
3 ]! q& L0 ~, Z- h$ z. M) D& ?2 c      'same'  - returns the central part of the convolution
4 X2 j$ j% E/ \: M3 V) R                that is the same size as A.3 J' o/ Z4 e0 g: V- ]
      'valid' - returns only those parts of the convolution
5 U; n: E; ?* N& B( d6 u& i/ l                that are computed without the zero-padded edges.
: b& `  R& j, L4 X& u, ~+ F                size(C) = max([ma-max(0,mb-1),na-max(0,nb-1)],0).7 z" S# b3 ~6 ^9 x, f0 I# N
  P; _: \7 Q" y* T- G2 y2 a
/ x& `- F! |3 h& L
关于full, same以及valid三种参数的区别,如下面的实例所示:/ m6 @! ^3 I2 C% k  s, K

' g8 B* D' @  O$ a. Wfull6 U  n; w- _6 i1 {- z% N

  E8 V, ^7 V1 e+ } 9 [3 U0 G0 G- `  I. J; z

5 p! Z# b! s3 j- ~4 m
( M) _$ q. W' m2 r5 W! k- rsame' r! |" T9 Z, N2 U9 p

* M( e% Z; j3 t% s/ d
+ H. H4 {6 W- R$ {; z; y; ?3 j4 d6 E* k5 \( w; K

( [. a3 G; Q7 C7 U: H0 w3 D" hvalid% S9 u& Z7 N$ v5 M2 ]% i' }

2 C5 p3 B: s- d! z
% O$ H5 F" R# F: G. q+ e
7 ]$ h% m6 ~. G4 U0 \( \# d
+ i+ o' Y2 e6 B5 I
  • 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 20:58 , Processed in 0.171875 second(s), 26 queries , Gzip On.

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

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

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