DSP: Development Test Bench example code indexing error
Afficher commentaires plus anciens
So I tried this example code:
frameLength = 256;
fileReader = dsp.AudioFileReader(...
'Counting-16-44p1-mono-15secs.wav',...
'SamplesPerFrame',frameLength);
deviceWriter = audioDeviceWriter(...
'SampleRate',fileReader.SampleRate);
scope = dsp.TimeScope(...
'SampleRate',fileReader.SampleRate,...
'TimeSpan',16,...
'BufferLength',1.5e6,...
'YLimits',[-1 1]);
dRG = noiseGate(...
'SampleRate',fileReader.SampleRate,...
'Threshold',-25,...
'AttackTime',10e-3,...
'ReleaseTime',20e-3,...
'HoldTime',0);
visualize(dRG);
configureMIDI(dRG);
while ~isDone(fileReader)
signal = fileReader();
noisySignal = signal + 0.0025*randn(frameLength,1);
processedSignal = dRG(noisySignal);
deviceWriter(processedSignal);
scope([noisySignal,processedSignal]);
end
release(fileReader);
release(deviceWriter);
release(scope);
release(dRG);
It gives me the following error:
Array formation and parentheses-style indexing with objects of class 'dsp.AudioFileReader' is not allowed. Use objects
of class 'dsp.AudioFileReader' only as scalars or use a cell array.
Error in workbench (line 30)
signal = fileReader();
I can't figure out how to solve it, please help.
Réponses (1)
Merry Dai
le 14 Mai 2018
0 votes
the problem that I meet is below

Catégories
En savoir plus sur Applications dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!