Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Tutorial
NI Supported: Yes
Publish Date: Sep 27, 2006


Feedback


Yes No

Related Categories

Related Links - Developer Zone

Related Links - Products and Services

Learn LabVIEW DSP in 3 Hours - Example 1: Simulating and Analyzing a Signal

5 ratings | 3.80 out of 5
Print

LabVIEW DSP has new features like LabVIEW Project

To learn more about this feature follow the link below for step-by-step instructions.

Using the LabVIEW Project with LabView DSP Module

 

Complete the following steps to create a VI that simulates a sine wave and displays its time and frequency domains in graphs.

  1. Launch LabVIEW 7.1 Embedded Edition. By default the execution is targeted to Windows. Target the LabVIEW DSP Module to execute on NI SPEEDY-33 by choosing SPEEDY33 for Execution Target.
  2. Open a blank VI and build the following front panel.


    [+] Enlarge Image
    Figure 1. Front Panel of Example 1


    1. Place a waveform graph, located on the Controls»Graphs palette and change the label from default Waveform Graph to Input Signal - Time Domain (by double clicking on the label). We will simulate a sine wave and display it in this graph. The timing characteristics of the sine wave will be the following: samples per second: 8000, number of samples: 128.
    2. From the Properties shortcut menu, under Scales tab disable the Autoscale options for X and Y Axis. Change the x-axis minimum value to 0 and maximum value to 128. Change the y-axis minimum value to be -5000 and maximum value to 5000.
    3. Place another waveform graph to display the frequency domain of the input signal and label it Input Signal - Frequency Domain.
    4. From the Properties shortcut menu, under the Scales tab disable the Autoscale options for the both axis. For x-axis change the name to Frequency (Hz), and set the minimum value to 0 and maximum value to 4000. Since we will sample at 8000 Hz with 128 number of samples, set the Multiplier to 62.5 (8000/128). For y-axis set the minimum value to 0 and maximum value to 5000.


      Figure 2. Input Signal - Frequency Domain Graph Properties

    5. Place two Horizontal Pointer Slides from Controls»Numeric palette and label them Frequency (Hz) and Amplitude. Set the maximum scale range of Frequency (Hz) slider to 2000 and the maximum scale range of Amplitude slider to 5000.

  3. Build the following block diagram.

    Figure 3. Block Diagram of Example 1


    1. Place the Simulate Signal Express VI located on the Functions» Embedded Signal Generation palette. Double click on the Express VI and configure it to have a Signal Type of Sine. Check the Add noise box and choose Uniform White Noise for the Noise type. Wire the Amplitude and Frequency (Hz) terminals to corresponding inputs of the Simulate Signal Express VI. Wire the Sine with Uniform output of the VI to Input Signal – Time Domain graph terminal.


      [+] Enlarge Image
      Figure 4. Configuration Window for Simulate Signal Express VI

    2. Place the Spectral Measurements Express VI from Functions»Signal Processing»Frequency Domain palette. Double click on the Express VI to configure it. Select the Magnitude (peak) option under Spectral Measurement and click OK. Wire the Sine with Uniform output of Simulate Signal VI to Signals input of Spectral Measurements.
    3. Wire the FFT – (Peak) output of the Express VI to Input Signal – Frequency Domain graph terminal.
    4. Place a While Loop located under Functions»Structures palette, on the block diagram.
    5. Save the VI as Example 1.vi.

  4. Adjust the Frequency and Amplitude values and run the VI. LabVIEW DSP Module Status Monitor dialog box will open. After being compiled and downloaded to target, the VI starts running on the target hardware. As the VI runs, change these values and observe the graphs in time and frequency domains.
  5. Target the LabVIEW DSP Module to execute on Windows by choosing Operate»Switch Execution Target»LabVIEW for Windows from the menu.
  6. Run the VI again.
  7. Save and close Example1.vi. You will use it again in the next example.


To get a solution VI for this example refer to Learn LabVIEW DSP in 3 Hours - Solutions To Examples document linked below.


5 ratings | 3.80 out of 5
Print

Reader Comments | Submit a comment »

 

Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).