Write a matlab program that convolves the triangular input

Assignment Help Other Engineering
Reference no: EM131378008

Assignment: Signals and Systems

Class Room Activity: Convolution of signals

Objective of the lab experiment:

The objective of this experiment is todemonstrate 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:It contains data you will need to complete this lab. It is available in Doc Sharing. If not, it is also available fromProfessor Ajeet Singh of DeVry University, Fremont, CA ([email protected]).

Example_of_Convolution_of_discrete_sequences.docx: Thisis 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 MATLABm 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

y(t)= ∫_0^t f(τ)g(t-τ)dτ where g(t-τ) is simply one of the signals reflected (g(τ)replaced by g(-τ)) and delayed in time by t seconds. Thus, if f(t) is the impulse response of the system, its output for any signal input g(t)can be obtained by evaluating this integral. The equivalent sum in discrete or sampled systems is given by

y[n]=x[n]?h[n]=∑_(i=-∞)^∞ x[i]h[n-i] =∑_(i=-∞)^∞ x[n-i]h[i] ,

wherey[n] is the discrete sequence coming out of the system,x[n] is the input sequence entering the system,h[n] 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

y[n]=x[n]?h[n]=∑_(i=0)^N x[i]h[n-i] =∑_(i=0)^N x[n-i]h[i] ,

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, y[n], 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 headingExample_of_Convolution_of_discrete_sequences.docx.

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

Completing the Lab

Step 1

Download the file Filter_IO_and_impulse_response.matfromDoc 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 tochange the directory when using a Citrix server and load the fileFilter_IO_and_impulse_response.matinto MATLAB.

To load the data file, go to the command window of MATLAB and give the command loadFilter_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

NameSizeBytesClass

IR6694x153552double array
sixty_sine_input32768x1262144double array
sixty_sine_out32768x1262144double array
ten_sine_input32768x1262144double array
ten_sine_output32768x1262144double array
time32768x1262144double array
tri_input32768x1262144double array
tri_output32768x1262144double 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_outVector 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 plotcommand of MATLAB,plot the impulse response (MATLAB memory variable IR)as a function of time. If you are not familiar with the plotcommand, 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_factorfor 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.

Obtain 10 Hz triangular input in blue

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

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

Obtain 10 Hz sine wave input in blue

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

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.

Obtain 60 Hz sine wave input in blue

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

Impulse response of the filter in green

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.

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

Multiplication

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?

This is because a 10 Hz triangular wave consists of many harmonics at multiples of 10 Hz, eg. 60 hz, 70 Hz etc.

The filter cuts out these harmonics which round the peak.

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?

60Hz is 10Hz higher than the highest frequency that the filter was designed to pass, 50Hz.

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?

Time delay = (phase lag in degrees/360)*period of th

Attachment:- Convolution of signals.rar

Reference no: EM131378008

Questions Cloud

Explain how csma ca dcf works : How does Wi-Fi differ from shared Ethernet in terms of topology, media access control, and error control, Ethernet frame?- Explain how CSMA/CA DCF works.
Who do you feel is accountable in these situations why : It could be argued that the creature did not consider itself a monster and didn't do awful things until people treated him like a monster. What are some real world instances in which people's actions could be a reaction to abuse from others? Who d..
Identify two ads or examples of pricing strategies : Identify two ads or examples of pricing strategies. Include the example or describe it. Provide a discussion of what two potential types of pricing are displayed in the ad or example. Because we are studying the hospitality and tourism industry, t..
What are the best practice recommendations for wlan design : What are the best practice recommendations for wired LAN design?- What are the best practice recommendations for WLAN design?
Write a matlab program that convolves the triangular input : ECET345- 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.
What is a bottleneck and how can you locate one : What is a bottleneck and how can you locate one?-  Describe three ways to improve network performance on the server.
What connections do you see between these two readings : What connections do you see between these two readings
What is the relationship between alcohol and breast cancer : For patients of 70 years and older, how effective is the use of the influenza vaccine at preventing flu as compared to patients who have not received the vaccine? What is the relationship between alcohol and breast cancer
Assess the value of healthcare professionals : Defend or critique the importance of considering the complex nature of health and healthcare when examining the economic principles related to healthcare delivery.

Reviews

Write a Review

Other Engineering Questions & Answers

  The media example of an extraneous variable

Is it a positive or negative correlation? How did you determine this to be the case?

  Determination of a sized design layout

Requires the determination of a sized design layout of an aircraft concept to meet a given mission specification.

  Personal narrative essay - the purpose-inspired life

"This is the true joy in life, being used for a purpose recognized by yourself as a mighty one, being thoroughly worn out before you are thrown on the scrap heap, being a force of nature instead of a feverish little clod of ailments and grievances..

  Calculate the shot noise limited current for the detector

Calculate the shot noise limited current for the detector (Assume dark current is small and T = 300 K). The responsivity of the detector is 0.7 A/W. Calculate the received optical power for the detector.

  What does the amplifier response time become

For VDD = 1.2 V, what value of Gm of each of the inverters in the amplifier is required to cause the outputs to reach 0.1VDD and 0.9VDD [from initial values of 0.5VDD - (0.1/2) and 0.5VDD + (0.1/2) volts, respectively] in 2 ns? If for the matched ..

  Design the frp shear strengthening

Design the FRP shear strengthening for both continuous and discontinuous distribution utilizing the following FRP material:  f'fu = 3640 MPa,  ε'fu = 0.016, tf = 0.2 mm.

  Geometric brownian motion

Write the expressions in the form S(i)T = const + 0∫T.....dt + 0∫T.....dWt, i = 1, 2 - solve the stochastic differential equation

  Show the initial led display and the result of the button

The video clip for this exercise should show the initial LED display and the result of the button being pushed. Please repeat by letting go and pushing the button again, two or three times.

  Report on an engineering failure of a consumer product

ENGG100 Assessment A6: Failure analysis. Write a report (max. 4 pages) on an engineering failure of a consumer product. Present the failure analysis in the style of a technical report. Introduce the failure with supporting information

  Write a matlab program to simulate 2pam digital transmitter

Write a Matlab program to simulate 2PAM baseband digital transmitter with truncated Sine pulse. The 2PAM signal corresponds to X(t) = i=0∑N-1Adip(t - iTs)

  Determine the percentage increase due to skin effect

Assuming an increase in resistance of 2% for spiraling, calculate and verify the dc resistance - Then calculate the dc resistance at 50°C, and determine the percentage increase due to skin effect.

  Describe any challenges encountered during the project

The final project packet will be due on the day of the final exam. The final project presentation will be held, however, on May 7th. The presentation must be 7-10 minutes and must include what design your group worked on. Introduce your part and..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd