ECET345 Signals and Systems Class Room Activity #13 Convolution of signals

profileschoolbench
 (Not rated)
 (Not rated)
Chat

DeVry University

ECET345 Signals and Systems

Name of Student:

Class Room Activity #13

Convolution of signals

 

Objective of the lab experiment:

The objective of this experiment is to demonstrate how the convolution is used to process signals entering a system.

Equipment list:

·         Experimentally measured characteristics plus input and output of a filter (available in Doc Sharing as listed below)

·         MATLAB

 

Software and/or other files needed:

·         Filter_IO_and_impulse_response.mat

·          is a graphical demo of how convolution of two discrete time sequences is carried out. This file is located in Doc Sharing.

·         Example_of_convolution.m: This file is located in Doc Sharing. It is a MATLAB m file that demonstrates how sequences are convolved in MATLAB.

Theory

We learned earlier in the lecture that the output of a linear time invariant (LTI) system, in time domain, is simply the input to the system convolved with its impulse response. We also learned that impulse response is the transfer function of the system inverted back into time domain, thus establishing the equivalence of the two pieces of knowledge. Recall also that convolution of two continuous functions of time f(t) and g(t) is defined as

  where  is simply one of the signals reflected ( and delayed in time by t seconds. Thus, if  is the impulse response of the system, its output for any signal input can be obtained by evaluating this integral. The equivalent sum in discrete or sampled systems is given by


,

where  is the discrete sequence coming out of the system,  is the input sequence entering the system,  is the discrete time impulse response of the system, and the symbol  is used to denote the convolution. When input sequences and impulse response are causal and of finite length, as is the case in practice for many systems, the limits of summation are changed from zero to a finite upper number, instead of minus to plus infinity. In other words, the convolution for finite length sequences and impulse response becomes


,

where N is a finite number. Because in the modern world we store the signals after sampling, we shall use the discrete time definition of convolution. This makes it possible to compute the convolution sum,, using a computer, which is what we shall do in this lab. For short enough signals and impulse responses, the sum can be computed manually as shown in the demo example stored in Doc Sharing under the heading Example_of_Convolution_of_discrete_sequences.docx.

For the purpose of this lab, we have measured and stored the impulse response as well as the input to and output from a 50 Hz low-pass filter for a variety of signals. These data are stored in in the MATLAB data file Filter_IO_and_impulse_response.mat,whichcan be downloaded from Doc Sharing.

Completing the Lab

Step 1

Download the file Filter_IO_and_impulse_response.matfrom Doc Sharing onto your desktop. If it is in a compressed (.zip) form, decompress it on the desktop of the computer you are using.

Open MATLAB version 7 (or higher) and change the directory to your desktop. See the tutorial at the end of the lab on how to change the directory when using a Citrix server and load the file Filter_IO_and_impulse_response.mat into MATLAB.

To load the data file, go to the command window of MATLAB and give the command load Filter_IO_and_impulse_response.matas shown below.

>> load Filter_IO_and_impulse_response.mat

This will cause the data to be loaded into MATLAB memory. Then give the command whos as shown below.

Your workspace should show an output as shown below. From this information, one can deduce which signals are present in the MATLAB memory, how many data points are there in each signal, and the total amount of memory that the data are using up.

>> whos

 Name Size Bytes Class

 

 IR 6694x1 53552 double array

 sixty_sine_input 32768x1 262144 double array

 sixty_sine_out 32768x1 262144 double array

 ten_sine_input 32768x1 262144 double array

 ten_sine_output 32768x1 262144 double array

 time 32768x1 262144 double array

 tri_input 32768x1 262144 double array

 tri_output 32768x1 262144 double array

 

Grand total is 236070 elements using 1888560 bytes

Here is an explanation of signals that are now loaded in the MATLAB memory.

IR                    Experimentally recorded impulse response of the 50 Hz low-pass filter

Sixty_sine_input                   Vector of experimentally recorded 60 Hz sine wave input to the filter

Sixty_sine_out                       Vector of experimentally recorded 60 Hz sine wave output from the filter      

ten_sine_input                      Vector of experimentally recorded 10 Hz sine wave input to the filter               

ten_sine_output                   Vector of experimentally recorded 10 Hz sine wave output from the filter

tri_input                   Vector of experimentally recorded 10 Hz triangular wave input to the filter

tri _output                           Vector of experimentally recorded 10 Hz triangular wave output from the filter

time                    Vector of time showing time points at which experimental data were recorded.

 

At this point, the data are loaded in MATLAB memory and we are ready to perform convolution of different signals. One of the signals that is loaded into memory is the impulse response of a 50 Hz cutoff low-pass filter whose Bode plot is shown below.

               

Figure 1. Experimentally measured frequency response (Bode plot) of a 50 Hz low-pass filter

The impulse response of the filter was recorded experimentally by applying an approximation of the impulse to the filter using the Tower board and storing the output using data acquisition equipment. We shall convolve this impulse response with the various inputs we apply to this filter to check whether we get an output that agrees with the output that was measured experimentally. In this effort, you can use, as your template, the MATLAB file Example_of_convolution.m.

As a first step, using the plot command of MATLAB, plot the impulse response (MATLAB memory variable IR) as a function of time. If you are not familiar with the plot command, run the MATLAB file Example_of_convolution.m located in Doc Sharing. You may also look up help for this command in the MATLAB help menu, where clear examples of how to use this command are given, and also read the MATLAB tutorial MATLAB_intro located in Doc Sharing.

One of the difficulties that you will encounter as you do so is that MATLAB may give you an error saying that “vectors must be of same length.” In order to overcome this difficulty, use the length command of MATLAB to force the two vectors to be of same length, as shown in the MATLAB file Example_of_convolution.m. Study this file, run it in MATLAB, and follow it as a template in your own attempts of convolving signals.

Paste the plot of IR as a function of time here. Be sure to label the axes and give a suitable title to the plot or you will suffer a penalty.

 

 

 

Step 2

Write a MATLAB program that convolves the 10 Hz triangular input with the impulse response of the filter, and plot the following variables as a function of time on a single graph. To see how it is done, run the MATLAB file Example_of_convolution.m located in Doc Sharing. For the purpose of plotting use a proper scaling_factor for convolved output before you plot it. This will allow us to see the shapes of all variables properly in a single plot (see the file Example_of_convolution.m for an example of how scaling factor is used). If you do not scale the variable with the largest amplitude, then you will not be able to see the shape of signals whose amplitude is significantly smaller. Choose an appropriate number of points so that output from 0–0.5 seconds is displayed and use a line width of 2, as is done in the sample program.

1.       Obtain 10 Hz triangular input in blue

2.       Output obtained by convolving the 10 Hz triangular input with the impulse response in red

3.       Be sure to label the axes and give a title to the plot or you will suffer a penalty.

Paste the plot as asked for in step 2 here. Be sure to label the axes and give a suitable title to the plot or you will suffer a penalty.

 

Step 3

Modify your MATLAB program such that it convolves the 10 Hz sine wave input with the impulse response of the filter, and plot the following variables as function of time on a single graph. For the purpose of plotting, use a proper scaling_factor for convolved output before you plot it. This will allow us to see the shapes of all variables properly in a single plot (see the file Example_of_convolution.m for an example of how scaling factor is used). If you do not scale the variable with the largest amplitude, then you will not be able to see the shape of signals whose amplitude is significantly smaller. Choose an appropriate number of points so that output from 0–0.5 seconds is displayed and use a line width of 2, as is done in the sample program.

1.       Obtain 10 Hz sine wave input in blue

2.       Output obtained by convolving the 10 Hz sine wave input with the impulse response in red

3.       Be sure to label the axes and give a title to the plot or you will suffer a penalty.

 

Paste the plot as asked for in step 3 here. Be sure to label the axes and give a suitable title to the plot or you will suffer a penalty.

 

Step 4

Modify your MATLAB program such that it convolves the 60 Hz sine wave input with the impulse response of the filter, and plot the following variables as function of time on a single graph. For the purpose of plotting, use a proper scaling_factor for convolved output before you plot it. This will allow us to see the shapes of all variables properly in a single plot (see the file Example_of_convolution.m for an example of how scaling factor is used). If you do not scale the variable with the largest amplitude, then you will not be able to see the shape of signals whose amplitude is significantly smaller. Choose an appropriate number of points so that output from 0–0.5 seconds is displayed and use a line width of 2, as is done in the sample program.

1.       Obtain 60 Hz sine wave input in blue

2.       Output obtained by convolving the 60 Hz sine wave input with the impulse response in red

3.       Impulse response of the filter in green

4.       Be sure to label the axes and give a title to the plot or you will suffer a penalty.

 

Paste the plot as asked for in step 4 here. Be sure to label the axes and give a suitable title to the plot or you will suffer a penalty.

 

Now answer the questions below.

1.       Convolution in the time domain is equivalent to what mathematical operation in the frequency domain?

 

 

2.       When we convolve the triangular 10 Hz input with the impulse response of the 50 Hz low-pass filter, why is it that the peaks of output become rounded and not a sharp point as in the input triangular function?

 

 

 

3.       Why is it that we get no (or very little) output when we convolve the 60 Hz sinusoid with the impulse response of the filter?

 

 

 

 

4.       When we apply the 10 Hz output, which is within the pass band of the filter, we see that we get nearly the same sinusoid in the output except for a time delay. How is the time delay a signal experiences as it passes through a system related to the phase characteristic of the system response?

 

 

Conclusion

 

 

    • 10 years ago
    THIS WAS GRADED A+++ USE AS A GUIDE
    NOT RATED

    Purchase the answer to view it

    blurred-text
    • attachment
      ecet345_ilab5_convolutionofsignals.docx