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

## 离散时间信号的卷积

``` >> 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

## 应用程序

0 条评论

• ### 手写批量线性回归算法：在Python3中梯度下降方法实现模型训练

在这篇文章中，我们将看一个使用NumPy作为数据处理库的Python3编写的程序，来了解如何实现使用梯度下降法的（批量）线性回归。

• ### PU Learning简介:对无标签数据进行半监督分类

假设您有一个交易业务数据集。有些交易被标记为欺诈，其余交易被标记为真实交易，因此您需要设计一个模型来区分欺诈交易和真实交易。假设您有足够的数据和良好的特征，这似...

• ### 如何利用机器学习和Gatsby.js创建假新闻网站​

我们生活在一个真理不再是非黑即白的世界。在我们生活的世界里，媒体明白，影响人们的最佳方式不是通过逻辑，而是通过情感。他们明白我们人类不是通过有意识的思考和逻辑处...

• ### What is PCA ?

figure cited here, recommend reading: A step by step explanation of Principal Co...

• ### SAP CDS view自学教程之一：如何测试基于SAP CDS view自动生成的OData服务

I am a newbie of CDS view related topic and recently I have to learn it. I will ...

• ### Kubernetes Scheduler Extender浅析

Scheduler 组件可以视为一种监视 watche 和将 Pod 分配 assign 到 Node 的特殊类型控制器 controller。在 Kubern...

• ### JDBC读取数据优化-fetch size

最近由于业务上的需求，一张旧表结构中的数据，需要提取出来，根据规则，导入一张新表结构中，开发同学写了一个工具，用于实现新旧结构的transformation，

• ### Educational Codeforces Round 44 (Rated for Div. 2)A. Chess Placing

You are given a chessboard of size 1 × n. It is guaranteed that n is even. The c...

• ### Using factor analysis for decomposition分解之因子分析

Factor analysis is another technique we can use to reduce dimensionality. Howeve...

• ### RND 笔记

RND： https://blog.openai.com/reinforcement-learning-with-prediction-based-reward...