Simulink Raspberry pi ALSA audioCapture data type miss match

1 回表示 (過去 30 日間)
중범
중범 2022 年 10 月 27 日
回答済み: Brandon Stevens 2022 年 11 月 10 日
Hi.
I'm trying to get 32bit audio data from the raspberry pi microphone array.
But i got this error:
For '?' of 'simulink_test/ALSA Audio Capture', the 'stepImpl' method of the System object 'codertarget.raspi.internal.RaspiALSAAudioCapture' returned a value that has data type 'int16'. This data type does not match the type 'int32' returned by the 'getOutputDataTypeImpl' method, inherited from System object 'codertarget.linux.blocks.ALSAAudioCapture'. To override the inherited behavior, customize 'getOutputDataTypeImpl' for System object 'codertarget.raspi.internal.RaspiALSAAudioCapture'.
With this microphone array, data can only be received in 32-bit, and my deep learning model was also trained with 32-bit data.
How can I fix this error?
Thank you.

回答 (1 件)

Brandon Stevens
Brandon Stevens 2022 年 11 月 10 日
For the 'ALSA Audio Capture' block there is a block paramater called 'Device bit depth' that you would want to change to 32-bit.
This parameter specifies what data type the audio data should be cast to. The default is 16-bit which seems to be what your parameter is set to.
For more information, check out the documentation page for the block:
https://www.mathworks.com/help/supportpkg/raspberrypi/ref/alsaaudiocapture.html

カテゴリ

Help Center および File ExchangeRun on Target Hardware についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by