ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

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

2020-05-26 13:01:24  阅读:287  来源: 互联网

标签:sequence 卷积 h1 数字信号 h2 1D Enter input


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

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

离散时间信号的卷积


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

输入序列x[n] ={1,2,3,4},其索引为{0,1,2,3}

脉冲响应h[n] ={5,6,7,8},其索引为{- 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); % pulse that exists for t>=-1 and t<=1
>> subplot(311);
>> plot(t,x);
>> h1=(t>=1 & t<=3); % pulse that exists for t>=1 & t<=3
>> h2=(t>3 & t<=4); % pulse that exists for t>3 & t<=4
>> 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

标签:sequence,卷积,h1,数字信号,h2,1D,Enter,input
来源: https://blog.csdn.net/m0_46510245/article/details/106326365

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有