Activity No 4
Activity No 4
4
Fundamental Convolution Application
Course Code: CPE 416 Program: BSCPE
Course Title: Digital Signal Processing and Applications Date Performed: 09/22/2022
Section: CPE41S1 Date Submitted: 09/22/2022
Name/s: Alejandro, Ruel Z. Instructor: Engr. Mon Arjay
Malbog
1. Objective:
This activity aims to introduce the convolutional process by demonstrating with the programmatic
processing of both arbitrarily generated signals and collected data using simple convolution techniques,
3. Discussion :
In mathematics (in particular, functional analysis), convolution is a mathematical operation on two
functions (f and g) that produces a third function (f*g) that expresses how the shape of one is modified by
the other. The term convolution refers to both the result function and to the process of computing it. It is
defined as the integral of the product of the two functions after one is reversed and shifted. The integral
is evaluated for all values of shift, producing the convolution function.
Convolution has applications that include probability, statistics, acoustics, spectroscopy, signal
processing and image processing, engineering, physics, computer vision and differential equations.
The convolution can be defined for functions on Euclidean space and other groups.For example, periodic
functions, such as the discrete-time Fourier transform, can be defined on a circle and convolved by
periodic convolution. A discrete convolution can be defined for functions on the set of integers.
Generalizations of convolution have applications in the field of numerical analysis and numerical linear
algebra, and in the design and implementation of finite impulse response filters in signal processing.
Computing the inverse of the convolution operation is known as deconvolution.
4. Resources:
The activity will require the following software, tools and equipment:
5. Directions:
1. Programmatically generate a sinusoidal wave, running at 500hz, an amplitude of 5 volts, with a
sampling rate of 100, starting at time 0 with 0 offset. Store the sine wave in an array.
4. Create an 10-element array containing the following kernel function with values:
A=[0 0 0 0 0 1 1 1 1 1]. Also, Plot and save the image.
5. Perform a convolution of both the sine wave and the generated array. Use the convolve function
provided by NumPy. This will generate a new array for you to plot.
B = [1 1 1 1 1 0 0 0 0 0]
C = [-1 -1 -1 -1 -1 0 0 0 0 0]
D = [0 0 0 0 0 -1 -1 -1 -1 -1]
E = [-1 -1 -1 -1 -1 0 0 0 0 0]
F = [ 0 0 .5 .5 1 1 .5 .5 0 0]
7. Compare and analyses the different effects of the kernels to the original signal and each other.
8. Generate another kernel arrays using the scipy wavelet library and convolve with the sine wave. This
time use the following:
Daubechie wavelet
signal.wavelets.daub(8)
Morlet wavelet
signal.wavelets.morlet2(20,4,2)
Ricker wavelet
signal.wavelets.ricker(20,1)
8. Compare and analyses the different effects of the kernels to the original signal and each other.
9. Apply the kernels A-G and the three(3) wavelets to the mean and standard deviation summaries from
activity 1.
6. Procedures
First, I created a program that could generate a 500 Hz sinusoidal wave with an amplitude of 5 V, a
sampling rate of 100 Hz, and an offset of 0 milliseconds at time 0. and data array
I was able to produce and visualize the sign wave using this formula
When I convolve the sine wave using the numpy supplied function, I use both the sine wave's given
array and the array that was produced.
As you can see, I produced it using each of the kernels from A to G. Create another array for plotting as
well.
I used the SciPy wavelet module to construct an extra kernel array, which I then merged with the sine
wave. Using the:
Daubechies wavelet
Morlet wavelet
Ricker wavelet
7. Results(sample)
https://drive.google.com/drive/folders/1ZDcgKRf3cnmSdpmvelFnJhFd3YKAQv_w?usp=sharing
8. Data Analysis
*what did you do to contribute to this activity? What new learnings, methods and techniques did you pick
up? Describe in detail.