How to fix the error: "Expected Input to be a scalar" when using LMS Update block in Simulink from Matlab Documentation Example

30 views (last 30 days)
Hi
I am currently playing with the following example and corresponding topic Active Noise Control with Simulink Real-Time provided by Mathworks
openExample('audio/ActiveNoiseControlWithSimulinkExample')
I need to use a speech signal as a source insted of a Noise as in example, in my case a speech signal is noise.
So I replace Noise source block to From Multimedia File block and specified a speech file.
Then when I run the model, I am getting the following error:
Simulation 1
05:43 PM Elapsed: 0.260 sec
MATLAB System block 'Test_FilteredX_LMS_ANC/LMS Update' error occurred when invoking 'validateInputsImpl' method of 'dsp.private.LMSUpdate'. The error was thrown from '
'C:\Program Files\MATLAB\R2020a\toolbox\dsp\dsp\+dsp\+private\LMSUpdate.m' at line 373'.
Caused by:
Expected Input to be a scalar.
Component:Simulink | Category:Block error
I tried to fix it by searching on the web, changing Audio output data type inside the From Multimedia File block, but dont really have an idea how to deal with it, since I had not really used Simulink before.
Thank you, I would appreciate your help
Have a nice day

Accepted Answer

jibrahim
jibrahim on 12 Nov 2020
Hi Yurii,
I suspect the issue is that the LMS Update block requires scalar inputs, and the From Multimedia block output is a non-scalar frame. Open the dialog of the To Multimedia block, and set the 'Samples per audio channel' parameter to 1. Alternatively you can put an unbuffer block at the output of the to Multimedia block

More Answers (0)

Categories

Find more on Audio Processing Algorithm Design in Help Center and File Exchange

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!