Core Concept




Parts List

  • myDAQ/myRIO
  • Stereo Speakers/Headphones

Learn It

1 Create a Signal

Smiley face
On the block diagram, place a Basic Function by right clicking
in an empty area on the block diagram and navigate to Signal Processing >> Waveform Generation >> Basic Function

2 Create a Signal

Click on that function to select it then copy and paste a second one by pressing Ctrl+C and Ctrl+V. These two functions will create the two signals you will be using for this portion of the module.

Can you pick up the full audio range of frequencies with a single speaker? Explain why or why not and propose a solution if not.

3 Create a Signal

Smiley face
Create controls for the “frequency”, “phase” and “signal type” terminals on
each Basic Function by hovering your mouse over the
corresponding terminal on the function until it turns into the wiring tool,
then right clicking and choosing Create>>Control. The amplitude of each
function can be controlled separately but it will be easier if there is one
amplitude control to interact with so for this portion of the module make
one control for the amplitude and wire it to both functions.

4 Create a Signal

Create a constant for the “sampling info” terminal by following the same procedure as creating a control but instead choosing the constant option. The sample info constant contains two values, the top value is the sample rate in samples per second and the bottom value is number of samples. Change the sample rate value to ‘41000’ and the number of samples to ‘4100’ then wire the constant to the other Basic Function

5 Create a Signal

Place an Add function on your block diagram by right clicking and navigating to Programming>>Numeric>>Add. Wire the signal out of both of the Basic Function blocks to the Add function. Adding the two outputs together will allow for you to hear both signals you’ve created once you output them to your myDAQ.

What is the significance of the sample rate being 41000 Sa/s?

6 Create a Signal

Place a Merge Signals function on your block diagram by right clicking and navigating to Express>>Signal Manipulation>>Merge Signals. We need this in order to wire into our Analog output function once we place it. Wire the output of your Add function to both of the inputs
of the Merge Signals Function. This will produce a single signal that contains information for the
left and right audio output for your sound.

Explain how to create the effect of a sound coming from a specific direction. What more does that involve?

7 Create a Signal

Place a DAQ Assistant on your block diagram by right clicking and navigating to Measurement I/O>>NI-DAQmx>>DAQ Assistant. This should open a configuration window once it is placed
down. In that window select Generate Signals>>Analog Output>>Voltage. This should
lead you to another configuration window which should list your myDAQ device if it is
connected and has been detected by your computer, as well the channels it has that can
generate an analog output. Click on audioOutputLeft, press and hold Shift then click
audioOutputRight to select the two channels, now click Finish.

8 Create a Signal

On the next configuration window, change the generation mode to Continuous Samples and click
Ok. You will be prompted to automatically place a while loop around your DAQ Assistant
function, choose No. Wire the output of the Merge Signals function to the data input of the DAQ Assistant.

What is the maximum amplitude you can achieve for each individual signal if you are going to be adding them together and outputting on the AudioOut channel of the myDAQ? What happens as you increase the amount of signals added?

9 Create a Signal

Right click on your block diagram and navigate to Programming>>Structures>>While Loop. This should change how your cursor looks to indicate you can now select the area that will be
enclosed in your while loop. Click and drag around the code you have created up to this point,
this should place a while loop around it. Hover your mouse over the Loop condition terminal,
right click and select Create Control to create the stop button for the VI.

10 Create a Signal

Smiley face
Switch to the front panel by pressing Ctrl + E, and
place a Waveform Graph indicator by right clicking
and navigating to Silver>>Graph>>Waveform
Graph. Switch back to the block diagram and wire
the output of the Add function to the Waveform
Graph indicator. Switch back to the front panel
and run your code. Change the amplitude and
frequency of the two signals and see the impact on the overall signal.

Bootstrap Slider

Build It

Click on the hardware that you have to get specific instructions.