Data Acquisition Toolbox
  Function/Property:
    Search    Help Desk 

Outputting Data with a Sound Card

In this example, sine wave data is generated in MATLAB, output to the D/A converter on the sound card, and sent to a speaker. The setup is shown below.


As described in "The Data Acquisition Session", using the Data Acquisition Toolbox to access the capabilities of your D/A hardware involves these steps:

For this example, one hardware channel is added to the analog output object, two seconds of data is queued in the engine with two putdata calls, and a manual trigger is issued to initiate the output. The complete data acquisition session for the sound card is shown below.

Initialization: Create the analog output object AO for a sound card. The installed adaptors and hardwrae ID's are found with daqhwinfo.

Configuration: Add one channel to AO, define an output time of four seconds, assign values to the basic setup properties, generate data to be queued, and queue the data with one call to putdata.

Termination: Delete AO.

Note:
You must add channels to AO before queueing data with the first putdata call.



[ Previous | Help Desk | Next ]