LTPDA Toolbox™ | contents | ![]() ![]() |
Let's run our first exercise by means of the graphical programming environment called LTPDA Workbench.
As you remember, details on how to use the Workbench were given in previous steps of this tutorial,
such as here. Anyways ...
To start the workbench, issue the following command on the MATLAB terminal, or click on the
"LTPDA Workbench" button on the launch bay.
LTPDAworkbench
Now let's go ahead and create a new pipeline, or analysis diagram. There are many ways to do this: hit ctrl-n (cmd-n on Mac OS X), or select "New Pipeline" from the "Pipeline" menu. (For more details on this and the other commands using the workbench environment please refert to the appropriate section of the user manual.)
Let's use the command "Pipeline -> Rename Pipeline" to give this diagram a more significant name, such as, for instance, "LTPDA Training Session PSD1". You should see a window like the one below:
The idea of the first exercise is the following:
There are many different ways to simulate a white noise time series data. Here we choose a pretty powerful one. Add an LTPDA Algorithm block to the canvas, selecting the block in the LTPDA library, and either
You can also use the "Quick Block" dialog. This is especially useful if you know the name of the block you are looking for. To open the Quick Block dialog, hit ctrl-b (cmd-b on Mac OS X) on the Canvas.
To get the ao constructor block we want, just start typing in the "method" edit field. Once the block ao is top of the list, just hit enter to add it to the canvas. You can also double-click on the block list to add any of the blocks in the list. Hit escape or click "Done" to dismiss the Quick Block dialog.
Now select the new AO block and choose the "From Waveform" option set from the "Parameters" drop-down list. Hit "Set" to assign this choice to the currently selected ao constructor block.
We can now tune the parameters of the ao constructor: in particular, let's double click on the value of the parameter line with the key WAVEFORM, so we can choose "noise" from the drop-down list that will appear. If needed, more help can be found here.
Then let's make the time series last longer by setting the number of seconds (nsecs) to 1000.
Eventually, we set the units of the noise to be meters by selecting the "Yunits" parameter and entering 'm'.
Now let's go ahead and search within the library for the psd method of the ao class. To do that, just click on the "Library" button on the top left of the screen, and type the word in the "search" box. Once we found the psd method, let's add it to the diagram, and then connect its input to the output of the ao constructor block. Some details and hints on connecting blocks can be found here.
The next step is to choose the parameters. After selecting the "Default" set and clicking "Set", we can proceed to modify the parameters. Let's discuss the parameters and their meaning:
If the user does not specify any value for the parameters, the routine applies the default values. When called within the LTPDAworkbench graphical environment, the default parameters are explicitly shown after selecting the "Default" set and clicking "Set".
In this case, we will use the default parameters:
For this exercise, we proceed by computing the square root of the calculated spectrum. Notice: by default, as described in its help, ao/sqrt applied to fsdata and tsdata objects acts only on the y (dependent) variable. We'll see later that is possible to choose different outputs so as to avoid this step, if we wanted to, by selecting the "Value" 'ASD' for the "Key" 'Scale'.
For now, let's add the sqrt method to the diagram and connect it to the output of the psd method.
What remains is just to plot the calculated square root of the PSD of the input white noise. Just add an iplot block and connect it ... and why not add another iplot to look at the original time-series signal.
So at the end we should have a situation like the following:
Notice that we also renamed the individual blocks, by double clicking on them and typing in the new names. We also changed the zoom amount by using the mouse scroll wheel or the commands available under the "View" menu.
The shape of the arrows, the color of the blocks and many other features can be adjusted by selecting "File->Preferences" when a Workbench is selected. |
Now we can execute the diagram, by clicking on the "Run" button on the bottom center, and the calculation should end up with 2 figures. The second one should be the following:
Please notice:
![]() |
Power Spectral Density estimation | Example 2: Windowing data | ![]() |
©LTP Team