1

I'm using Simulink to output 2 sine waves through my audio output (headphones) 3.5mm jack. I want one of the sinusoids to be sent out Channel 1, and the other sinusoid sent out Channel 2.

I have tried using 2 sine wave blocks wired to 2 "To Audio Device" blocks, each with a different channel specified which gives the error 'A given audio device may only be opened once.'

I have tried wiring both sine blocks to a single "To Audio Device" block which do not connect.

I have tried using the Mux, Vector Concatenate and Matrix Concatenate blocks to combine the sinusoids before feeding the output into the To "Audio Device Block", which gave undesirable results.

I have got both sine waves working individually, but not both simultaneously.

ronan
  • 11
  • 3
  • 1
    Try creating a matrix with each column corresponding to a channel and then send it to audio device. Your first sine wave can be first column and second sine wave can be second column. – Navan Apr 26 '16 at 13:13
  • Thanks, i tried this with the matrix concatenate block. The scope block read this correctly as 2 different colored signals on the same graph. However, when I read the output with an oscilloscope it seems to have superimposed the higher frequency signal onto the lower frequency signal, making sort of a wonky sine wave. The second channel is identical but with a higher amplitude... – ronan Apr 27 '16 at 15:17

1 Answers1

0

Implement a custom function implementation in Simulink using components from the Data Acquisition toolbox. Here's an example of 5 channel output (5.1 channel sound system) - https://www.mathworks.com/help/daq/multichannel-audio-input-and-output-1.html#bt_9lng-5

bimbi
  • 70
  • 10