I have a few problems on LabVIEW that I am trying to solve but I get stuck on some steps because I'm new and just learning it, would be possible to describe the steps in videos or pictures of the problems so I can know which code or thing that i have to use in order to solve the questions.
3. Create a VI that takes a 2D array of numbers and returns a 1D array that contains the average of each of the rows. Make a control for the 2D array input by placing an empty array on the front panel and placing a Numeric Control inside (see Section 2.1). Add a dimension to the array (since the default is a 1D array) and then populate a few rows and columns of the array with numbers in order to test your code. Make an indicator on the front panel consisting of a 1D array that will show the results of the averaging (place a Numeric Indicator inside another empty array). You can use a “for” loop in your block diagram to perform calculations on the rows of the array one at a time: when a 2D array enters such a loop through an auto-indexing tunnel (see Section 2.1.2), each iteration of the loop will use one row of the array (and the number of iterations will be the number of rows).
• Modify your code so that it can average either the rows or columns of the given array. Add a
Boolean control (switch or button) to the front panel which controls whether the 2D array is
transposed before its rows are averaged. Test your program by making sure that the averaging is
successful in both “row” and “column” configurations.
• Configure this VI for use as a subVI by connecting both controls and the indicator to terminals
on the “connector” diagram, then save the VI with an appropriate name.
4. Select “VI Properties” (under the File menu, or using Ctrl-I), choose the “Executive” category, and check the “Clear indicators when called” checkbox. Now, whenever you run the code, all indicators and charts will be cleared and show the values from the new run.
5. Write a VI that creates a sinusoidal signal contaminated by noise and then averages multiple instances of the signal to remove the noise. You can use the “Simulate Signal” Express VI, described in Section 2.4.2, to create the signal, placed within a “for loop” structure so that the signal is created many times. You’ll need to check the “Add noise” box in the configuration popup window to add noise contamination to the signal. Configure the “Simulate Signal” Express VI so that there are at least 2 or 3 oscillations of the sinusoid during the signal’s duration (you may wish to adjust the signal’s frequency, the number of samples per rate, and/or the number of samples). Also, select the “Reset phase, seed, and time stamps” option so that each time the signal is created, the sinusoid will start at the same point in its cycle.
In addition to the “Simulate Signal” Express VI in a “for” loop, your front panel should feature:
• Controls for the signal’s amplitude, the amplitude of the noise, and the number of averages used
to suppress the noise (the number of times to run the “for” loop).
• Indicators including:
– one graph displaying a single instance of the signal, which will change each time through the
loop
– a second graph that displays the current averaged signal (updated each time through the loop,
it should look less and less noisy because more and more measurements are being averaged)
– an indication of how many averages have taken place so far
Helpful Hints
• The output of the “Simulate Signal” VI is a wire of type “Dynamic Data.” The Convert From
Dynamic Data express VI will allow you to convert this directly to a 1D array of numbers, or to
convert it to a waveform, from which you can then extract the array of numbers you need to work
as well as the timing information using the “Get Waveform Components” function.
• You can use Shift Registers to assemble the 1D arrays generated by the “Simulate Signal” VI into larger and larger 2D arrays as the loop repeats.
• Call the subVI you created in problem 4 to perform the averaging calculation.
• Make sure the labels on your graphs are correct. Plot amplitude vs. time if you can, otherwise,
be sure to indicate the plots are amplitude vs. sample number.