Name: Towards AI Legal Name: Towards AI, Inc. Description: Towards AI is the world's leading artificial intelligence (AI) and technology publication. Read by thought-leaders and decision-makers around the world. Phone Number: +1-650-246-9381 Email: pub@towardsai.net
228 Park Avenue South New York, NY 10003 United States
Website: Publisher: https://towardsai.net/#publisher Diversity Policy: https://towardsai.net/about Ethics Policy: https://towardsai.net/about Masthead: https://towardsai.net/about
Name: Towards AI Legal Name: Towards AI, Inc. Description: Towards AI is the world's leading artificial intelligence (AI) and technology publication. Founders: Roberto Iriondo, , Job Title: Co-founder and Advisor Works for: Towards AI, Inc. Follow Roberto: X, LinkedIn, GitHub, Google Scholar, Towards AI Profile, Medium, ML@CMU, FreeCodeCamp, Crunchbase, Bloomberg, Roberto Iriondo, Generative AI Lab, Generative AI Lab VeloxTrend Ultrarix Capital Partners Denis Piffaretti, Job Title: Co-founder Works for: Towards AI, Inc. Louie Peters, Job Title: Co-founder Works for: Towards AI, Inc. Louis-François Bouchard, Job Title: Co-founder Works for: Towards AI, Inc. Cover:
Towards AI Cover
Logo:
Towards AI Logo
Areas Served: Worldwide Alternate Name: Towards AI, Inc. Alternate Name: Towards AI Co. Alternate Name: towards ai Alternate Name: towardsai Alternate Name: towards.ai Alternate Name: tai Alternate Name: toward ai Alternate Name: toward.ai Alternate Name: Towards AI, Inc. Alternate Name: towardsai.net Alternate Name: pub.towardsai.net
5 stars – based on 497 reviews

Frequently Used, Contextual References

TODO: Remember to copy unique IDs whenever it needs used. i.e., URL: 304b2e42315e

Resources

Our 15 AI experts built the most comprehensive, practical, 90+ lesson courses to master AI Engineering - we have pathways for any experience at Towards AI Academy. Cohorts still open - use COHORT10 for 10% off.

Publication

Convolution of Signals in 1-Dimension
Mathematics

Convolution of Signals in 1-Dimension

Last Updated on May 22, 2020 by Editorial Team

Author(s): sinchana S.R

Mathematics

Convolution is one of the most useful operators that finds its application in science, engineering, and mathematics

Convolution is a mathematical operation on two functions (f and g) that produces a third function expressing how the shape of one is modified by the other.

Convolution of discrete-time signals

Convolution of Signals in 1-Dimension
Source: https://en.wikipedia.org/wiki/Convolution

A simple way to find the convolution of discrete-time signals is as shown

Input sequence x[n] = {1,2,3,4} with its index as {0,1,2,3}

Impulse response h[n] = {5,6,7,8} with its index as {-2,-1,0,1}

The blue arrow indicates the zeroth index position of x[n] and h[n]. The red pointer indicates the zeroth index position of the output convolved index. We can construct a table, as shown below. Multiply the elements of x and h as shown, and add them up diagonally.

Table showing index position of involved indexes
>> clc;  % clears the command window
>> clear all; % clears all the variables in the workspace
>> close all; % closes all the figure window

Taking the input from the user

>> % 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=');

The output in the command window,

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]

Calculating the index of the convolved signal,

>> % Index of the convolved signal
>> n=min(nx)+min(nh):max(nx)+max(nh);

Convolution

>> y=conv(x,h);

Display

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

The output in the command window,

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

Let’s visualize these signals.

>> subplot(311);
>> stem(nx,x);
>> subplot(312);
>> stem(nh,h);
>> subplot(313);
>> stem(n,y);
Visualizing the convolution signals

You can find the code on Github.

Convolution of continuous-time signals

Source: https://en.wikipedia.org/wiki/Convolution
>> 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);
Visualizing continuous signals

You can find code on Github.

Properties of Convolution

Convolution is a linear operator and has the following properties.

  • The Commutative Property

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

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

  • The Associative Property

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 )

  • The Distributive Property

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 )

  • Associativity with scalar multiplication

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

for any real (or complex) number a

  • Multiplicative identity
  • Complex conjugation
  • Relationship with differentiation
  • Relationship with integration

Applications

Convolution finds its applications in many domains including digital image processing, digital signal processing, optics, neural networks, digital data processing, statistics, engineering, probability theory, acoustics, and many more.

References


Convolution of Signals in 1-Dimension was originally published in Towards AI — Multidisciplinary Science Journal on Medium, where people are continuing the conversation by highlighting and responding to this story.

Published via Towards AI


Take our 90+ lesson From Beginner to Advanced LLM Developer Certification: From choosing a project to deploying a working product this is the most comprehensive and practical LLM course out there!

Towards AI has published Building LLMs for Production—our 470+ page guide to mastering LLMs with practical projects and expert insights!


Discover Your Dream AI Career at Towards AI Jobs

Towards AI has built a jobs board tailored specifically to Machine Learning and Data Science Jobs and Skills. Our software searches for live AI jobs each hour, labels and categorises them and makes them easily searchable. Explore over 40,000 live jobs today with Towards AI Jobs!

Note: Content contains the views of the contributing authors and not Towards AI.