How to plot multiple audio files horizontally in MATLAB

 Accepted Answer

n = 1000;
t = (0:n-1)'*.0001;
x = randn(n, 6); % 1000 samples 6 channels
y = 0.2*x + (1:6); % scale the x by 0.2, add offset for each channel
plot(t, y)
xlabel('t (s)');
set(gca, 'YTick', (1:6), 'YTickLabel', "ch"+(1:6))

5 Comments

@Chunru thank you
i want to plot audio files like this,is it possible ....? ??
if i browse one directory(audio files), then i want to plot all the audio files from it like above figure
You can store the data from files as a matrix. Different files may have different length. You may need to append 0 for short files in that case.
how to store the data from files as matrix?

Sign in to comment.

More Answers (0)

Categories

Find more on Audio I/O and Waveform Generation in Help Center and File Exchange

Asked:

on 10 Nov 2021

Commented:

Rik
on 10 Nov 2021

Community Treasure Hunt

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

Start Hunting!