<< 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] .
[link] illustrates the completed block diagram of the numerical convolution.
[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 .
Next, consider the convolution of the two signals
and
for , where
denotes a step function at time 0 and
rect
a rectangular function defined as
Let . [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.
[link] illustrates the corresponding front panel where
,
and
are plotted in different graphs. Convolution
and equal
signs are placed between the graphs using the LabVIEW function
Decorations
.
In this third example, compute the convolution of the signals shown in [link] .
[link] shows the block diagram for this third convolution example and [link] the corresponding front panel. The signals , and are displayed in different graphs.
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.
Notification Switch
Would you like to follow the 'An interactive approach to signals and systems laboratory' conversation and receive update notifications?