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

  Evaporative crystallizer operating

An aqueous solution of potassium hydroxide is fed at a rate of 875 kg/h to an evaporative crystallizer operating at 10°C, producing crystals of KOH·2H2O. A 5 g aliquot of the feed solution is titrated to neutrality with 22.4 mL of 0.85 molar H2SO4..

  Determine the arrival rate

Determine the arrival rate assuming that it is unchanged over the duration of the observation period (from the beginning to the end of this 5.78-vehicle-minute delay cycle).

  Problems based on determination of laplace transformation

For the circuit shown below, find the input/output differential equation.

  Describe in detail the water treatment plant

Describe in detail the water treatment plant - The polyelectrolyte dosing process and the sludge blanket conditioning (TFG) and control within the upward flow clarifier

  Write a technical documentation on study & performance of

Write a Technical Documentation on "Study & Performance of Wearable Robot Knee Joint Oscillation Reduction"

  Calculate the resonant frequency

Use the Waveform generator to produce an input: 2.5Vpk and frequency set to the resonant frequency.

  Summarize the sensory pathways to the brain for gustatory

Summarize the sensory pathways to the brain for gustatory and olfactory sensations.Analyze and describe the process of hearing from the external to inner ear.Analyze and describe how the ear provides equilibrium and balance for the body.

  Determine the numerical values of the first three outputs

ECET345- A simulation diagram is shown below. We apply a unit impulse to such a system. Determine numerical values of the first three outputs. You are free to use MATLAB where appropriate or do it entirely by hand.

  Compare the values of tplh and tphl

Consider a four-input CMOS NAND gate for which the transient response is dominated by a fixed-size capacitance etween the output node and ground. Compare the values of tPLH and tPHL, obtained when the devices are sized as in Fig. to the values obt..

  Calculate the gasoline savings

How much gasoline do vehicles with the following fuel efficiencies consume in one year? Calculate the gasoline savings, in gallons per year, created by the following two options. Show all your work, and draw boxes around your answers.

  Maximum vertical distance between the jumper

A ski jumper starts with a horizontal take-off velocity of 25 m/s and lands on a straight landing hill inclined at 30o. Determine

  Draw shear-force and moment diagram of the steel frame

Draw shear-force and moment diagram of the steel frame and design the member and calculate the structural design calculation and detailing in the form of a drawing

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