How to use 'drawnow' to create an animated surface plot from audio measurements taken in a matrix of 10 x 10 microphone positions
24 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
KALYAN ACHARJYA
el 30 de Sept. de 2020
Editada: KALYAN ACHARJYA
el 30 de Sept. de 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 comentarios
Ver también
Categorías
Más información sobre Audio and Video Data en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!