[SIMULINK] Sound interface, multiple inputs and outputs

3 ビュー (過去 30 日間)
José M. Requena Plens
José M. Requena Plens 2020 年 8 月 3 日
編集済み: Carlos Sanchis 2020 年 8 月 25 日
Hello,
I am using Simulink to emit and receive signals with a sound interface with multiple inputs and outputs (8 inputs / 20 outputs).
The "Audio Device Reader" block only has one signal, how can I get the signals from all the inputs?
Thanks!

採用された回答

Carlos Sanchis
Carlos Sanchis 2020 年 8 月 24 日
編集済み: Carlos Sanchis 2020 年 8 月 25 日
The "Audio Device Reader" block can output all channels through the same port as an m by n matrix where m is the number of samples per frame and n is the number of channels: https://www.mathworks.com/help/audio/ref/audiodevicereader.html#bu_1463-1-A.
Below are the steps to enable this along with screenshots from an example with my laptop's 2-channel microphone array as the audio device.
First double-check the dimmensions of each signal by going to “DEBUG” > “Information Overlays” > “Signal Dimensions”.
Now double click on the "Audio Device Reader" block to setup the "Number of channels" (also the number of "Samples per frame" if needed).
You can check the number of available channels in your audio device by clicking on "Info".
If you need to split each channel into its own signal, you can accomplish it in different ways.
Option B: use the "Multiport Selector" block in DSP System Toolbox (https://www.mathworks.com/help/dsp/ref/multiportselector.html). Prof Requena introduced me to this and indeed it looks much cleaner.
Option A is illustrated below...

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 8 月 3 日
編集済み: Walter Roberson 2020 年 8 月 5 日
The block will read all of the channels unless you choose the channel mapping and give a vector that does not include all the channel numbers.

カテゴリ

Help Center および File ExchangeAudio I/O and Waveform Generation についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by