首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

1D卷积入门:一维卷积是如何处理数字信号的

卷积是在科学、工程和数学中应用最广泛的运算符之一

卷积是对两个函数(f和g)进行的一种数学运算,它产生的第三个函数表示其中一个函数的形状如何被另一个函数修改。

离散时间信号的卷积

一种求解离散时间信号卷积的简单方法如下所示

输入序列x[n] =,其索引为

脉冲响应h[n] =,其索引为{- 2,1,0,1}

蓝色箭头表示x[n]和h[n]的第0个索引位置。红色指针表示输出卷积索引的第零索引位置。我们可以构造一个表,如下所示。如图所示,将x和h的元素相乘,然后对角相加。

>> clc; % clears the command window

>> clear all; % clears all the variables in the workspace

>> close all; % closes all the figure window

从用户那里获取输入

>> % x[n] is the input discrete signal.

>> x=input('Enter the input sequence x =');

>> nx=input('Enter the index of the input sequence nx=');

>> % h[n] is the impulse response of the system.

>>h=input('Enter the impulse response of the system,second sequence h=');

>> nh=input('Enter the index of the second sequence nh=');

输出

Enter the input sequence x =[1 2 3 4]

Enter the index of the input sequence nx=[0 1 2 3]

Enter the impulse response of the system,second sequence h=[5 6 7 8]

Enter the index of the second sequence nh=[-2 -1 0 1]

计算卷积信号的索引

>> % Index of the convolved signal

>> n=min(nx)+min(nh):max(nx)+max(nh);

卷积计算

>> y=conv(x,h);

显示

>> disp('The convolved signal is:');

>> y

>> disp('The index of convolved sequence is:');

>> n

>> The convolved signal is:y =5 16 34 60 61 52 32

>> The index of convolved sequence is:n =-2 -1 0 1 2 3 4

可视化

>> subplot(311);

>> stem(nx,x);

>> subplot(312);

>> stem(nh,h);

>> subplot(313);

>> stem(n,y);

时间序列信号的卷积

>> clc;

>> clear all;

>> close all;

>> t=-3:0.01:8;

>> x=(t>=-1 & t=-1 and t

>> subplot(311);

>> plot(t,x);

>> h1=(t>=1 & t=1 & t

>> h2=(t>3 & t3 & t

>> h=h1+(2*h2);

>> subplot(312);

>> plot(t,h);

>> y=convn(x,h);

>> y=y/100;

>> t1=2*min(t):0.01:2*max(t);

>> subplot(313);

>> plot(t1,y);

卷积的属性

卷积是一个线性算子,具有以下性质。

交换律

x[n] * h[n] = h[n] * x[n] ( in discrete time )

x(t) * h(t) = h(t) * x(t) ( in continuous time )

结合律

x[n] * (h1[n] * h2[n]) = (x[n] * h1[n]) * h2[n] ( in discrete time )

x(t) * (h1(t) * h2(t)) = (x(t) * h1(t)) * h2(t) ( in discrete time )

分配律

x[n] * (h1[n] + h2[n]) = (x[n] * h1[n]) + (x[n] * h2[n]) ( in discrete time )

x(t) * (h1(t) + h2(t)) = (x(t) * h1(t)) + (x(t) * h2(t)) ( in discrete time )

标量乘法结合律

a(f * g) = (af) * g

乘法单位

复共轭性

与微分的关系

与积分的关系

应用程序

卷积在许多领域得到了应用,包括数字图像处理、数字信号处理、光学、神经网络、数字数据处理、统计学、工程学、概率论、声学等等。

作者:Sinchana S R

DeepHub

  • 发表于:
  • 原文链接https://kuaibao.qq.com/s/20200525A04M4500?refer=cp_1026
  • 腾讯「腾讯云开发者社区」是腾讯内容开放平台帐号(企鹅号)传播渠道之一,根据《腾讯内容开放平台服务协议》转载发布内容。
  • 如有侵权,请联系 cloudcommunity@tencent.com 删除。

扫码

添加站长 进交流群

领取专属 10元无门槛券

私享最新 技术干货

扫码加入开发者社群
领券