MATLAB Answers

Warning: Invalid playback selection

1 view (last 30 days)
Anonym
Anonym on 5 Dec 2020
Answered: Shraddha Jain on 23 Dec 2020
I am working with the three primary types of filters; the low-pass filter, the high-pass filter and the band pass filter, and creating some effect-spectres of them.
I am getting a warning regarding my playback, which I do not quite know how to fix it. Pop-ups like an error. This is what the console prints:
Warning: Invalid playback selection. Playback will start at the beginning.
> In audioplayer/play (line 67)
In EffectSpectras (line 10)
And that's the code:
%'handel is a MAT-file which is shipped with MATLAB as an example
load handel;
% Volume
x = y/1; % Decrease volume
% Plays
player = audioplayer(x, Fs);
play(player,[1 (get(player, 'SampleRate')*10)]);
% Shows result
[Rows, Cols] = size(x);
Ylo = FDLowpass(x);
Ybd = FDBandpass(x);
Yhi = FDHighpass(x);
POVylo = PowerSpecFFT(Ylo);
POVybd = PowerSpecFFT(Ybd);
POVyhi = PowerSpecFFT(Yhi);
plot(1:Rows, POVylo)
title('The low-pass')
hold on
plot(1:Rows, POVybd)
title('The band-pass')
hold on
plot(1:Rows, POVyhi)
title('The high-pass')
Also my problem is that i want all 3 plots to be displayed separately, and preferably in one window where you can see all at once, or if that's not possible then where all 3 figure-windows will appear.

Answers (1)

Shraddha Jain
Shraddha Jain on 23 Dec 2020
Hi,
I understand that you are getting this warning when the play function is executed. This occurs because the stop index value (get(player, 'SampleRate')*10) specified in the arguments of play function exceeds the end index value of audio variable x.
To answer you question regarding displaying figures seperately, you can use the following code,
figure
plot(1:Rows, POVylo)
figure
plot(1:Rows, POVybd)
figure
plot(1:Rows, POVyhi)

Community Treasure Hunt

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

Start Hunting!