How to use 'drawnow' to create an animated surface plot from audio measurements taken in a matrix of 10 x 10 microphone positions
24 views (last 30 days)
Show older comments
I am attempting to code for an animated surface plot of audio data.
The measurements were taken in ten steps of ten channels to create a 10 x 10 matrix of microphone measurement positions, and so 100 resultant recordings of equal length.
In principle, I want each value in a 10 x 10 x Z(ampliude) surface plot to be "fed" by data from an audio vector, whether sample by sample or at increments (every 100th sample, for example); whatever balances computational efficiency with satisfactory visualisation. So, position x = 1, y = 1 in the "new"/empty matrix (that will become the animated plot) will be "fed" values from its corresponding audio recording. Basically, the plot should redraw itself for each sample (or sample increment) of the 100 recordings.
So far, I think using the 'drawnow' function call is the way to go, but I'm not sure where to go from here. Do I need to create 100 'for' loops; one for each position in the animated matrix?
I'm at the very start of figuring this out, so have no code to show. I hope I've managed to explain what I'm trying to achieve. Thanks in advance for any help anyone may be able to provide.
Cheers!
0 Comments
Answers (1)
KALYAN ACHARJYA
on 30 Sep 2020
Edited: KALYAN ACHARJYA
on 30 Sep 2020
for i=1:100
data=rand(10,10); % Choose your incoming audio data here
fig=surf(data);
grid on;
pause(0.1); % Animation speed hold time
clf(fig); % It clear the privious data and plot next in same figure
end
2 Comments
See Also
Categories
Find more on Audio and Video Data in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!