How to use 'drawnow' to create an animated surface plot from audio measurements taken in a matrix of 10 x 10 microphone positions
12 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
KALYAN ACHARJYA
2020-9-30
编辑:KALYAN ACHARJYA
2020-9-30
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
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graphics Performance 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!