[英]How to make stem plot for convolution in Matlab?
I am new to Matlab. 我是Matlab的新手。 I am learning convolution of function. 我正在学习函数的卷积。 So far I know, generally 到目前为止,我知道,一般
Convolution is multiplication of two function, or combining to signal to create a third signal. 卷积是两个函数的乘法,或者组合成信号以产生第三个信号。
Please amend me if I am wrong. 如果我错了,请修改我。
I am given two function which are f(n)
and g(n)
, in order to find the convolution of f(n)*g(n)
, I did the coding like this: 我给了两个函数f(n)
和g(n)
,为了找到f(n)*g(n)
的卷积,我做了这样的编码:
n=-10:10;
w=conv(f,g,'same');
stem(n,w)
Is these the correct method? 这些是正确的方法吗? What should I do if I want to find convolution of f(n)*f(n)*f(n)
? 如果我想找到f(n)*f(n)*f(n)
卷积,我该怎么办?
Convolution is multiplication of signal when signals are taken in frequency domain, not in time domain. 当在频域中而不是在时域中获取信号时,卷积是信号的倍增。 For 1-d convolution, 对于一维卷积,
ch=conv(x,y); CH = CONV(X,Y);
stem(ch); 干(CH); works 作品
For 2-d convolution, 对于二维卷积,
ch=conv2(x,y) CH = CONV2(X,Y)
use of stem3 would be better. 使用stem3会更好。 But mesh can also be used. 但也可以使用网格。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.