<< Chapter < Page Chapter >> Page >

With this code, a time vector t is generated by taking a time interval of Delta for 8 seconds. Convolve the two input signals, x1 and x2, using the function conv. Compute the actual output y_ac using Equation (1). Measure the length of the time vector and input vectors by using the command length(t). The convolution output vector y has a different size (if two input vectors m and n are convolved, the output vector size is m+n-1). Thus, to keep the size the same, use a portion of the output corresponding to y(1:Lt) during the error calculation.

Use a waveform graph to show the waveforms. With the function Build Waveform (Functions → Programming → Waveforms → Build Waveforms) , one can show the waveforms across time. Connect the time interval Delta to the input dt of this function to display the waveforms along the time axis (in seconds).

Merge together and display the true and approximated outputs in the same graph using the function Merge Signal (Functions → Express → Sig Manip → Merge Signals) . Configure the properties of the waveform graph as shown in [link] .

Waveform Graph Properties Dialog Box

[link] illustrates the completed block diagram of the numerical convolution.

Block Diagram of the Convolution Example

[link] shows the corresponding front panel, which can be used to change parameters. Adjust the input exponent powers and approximation pulse-width Delta to see the effect on the MSE .

Front Panel of the Convolution Example

Convolution example 2

Next, consider the convolution of the two signals x ( t ) = exp ( 2t ) u ( t ) size 12{x \( t \) ="exp" \( - 2t \) u \( t \) } {} and h ( t ) = rect ( t 2 2 ) size 12{h \( t \) = ital "rect" \( { {t - 2} over {2} } \) } {} for , where u ( t ) size 12{u \( t \) } {} denotes a step function at time 0 and rect a rectangular function defined as

rect ( t ) = { 1 0 . 5 t < 0 . 5 0 otherwise size 12{ ital "rect" \( t \) = left lbrace matrix { 1 {} # - 0 "." 5<= t<0 "." 5 {} ## 0 {} # ital "otherwise"{}} right none } {}

Let Δ = 0 . 01 size 12{Δ=0 "." "01"} {} . [link] shows the block diagram for this second convolution example. Again, the .m file textual code is placed inside a LabVIEW MathScript node with the appropriate inputs and outputs.

Block Diagram for the Convolution of Two Signals

[link] illustrates the corresponding front panel where x ( t ) size 12{x \( t \) } {} , h ( t ) size 12{h \( t \) } {} and x ( t ) h ( t ) size 12{x \( t \) * h \( t \) } {} are plotted in different graphs. Convolution ( ) size 12{ \( * \) } {} and equal ( = ) size 12{ \( = \) } {} signs are placed between the graphs using the LabVIEW function Decorations .

Front Panel for the Convolution of Two Signals

Convolution example 3

In this third example, compute the convolution of the signals shown in [link] .

Signals x1(t) and x2(t)

[link] shows the block diagram for this third convolution example and [link] the corresponding front panel. The signals x1 ( t ) size 12{x1 \( t \) } {} , x2 ( t ) size 12{x2 \( t \) } {} and x1 ( t ) x2 ( t ) size 12{x1 \( t \) * x2 \( t \) } {} are displayed in different graphs.

Block Diagram for the Convolution of Two Signals

Front Panel for the Convolution of Two Signals

Convolution properties

In this part, examine the properties of convolution. [link] shows the block diagram to examine the properties and [link] and [link] the corresponding front panel. Both sides of equations are plotted in this front panel to verify the convolution properties. To display different convolution properties within a limited screen area, use a Tab Control (Controls Modern Containers Tab Control) in the front panel.

Front Panel of Convolution Properties
Block Diagram of Convolution Properties

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, An interactive approach to signals and systems laboratory. OpenStax CNX. Sep 06, 2012 Download for free at http://cnx.org/content/col10667/1.14
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'An interactive approach to signals and systems laboratory' conversation and receive update notifications?

Ask