Moving vertical line as time marker
7 ビュー (過去 30 日間)
古いコメントを表示
I am working on matlab to analyse whale recordings (I have to mark every breath). For this purpose I have a tool (programmed by an expert) which shows sections of 100 seconds plotting the sound (frequency) and the depth of the animal. When you press 'f', the next section (next 100 seconds) is shown, and so on.
When you press 'p', the audio of the section is played. I want to be able to track the audio display, so I have thought I could plot a real-time moving red vertical line, meaning: it starts at t=0 and ends at t=100.
This is the coding for the 'p' function in which I think I would have to incorporate the ploting of the real-time red vertical line.
case 'p'
chk = min(size(x,2),2) ;
if ~isempty(bs),
xf = filter(bs,as,x(:,1:chk)) ;
if SOUND_DF<0,
sound(volume*xf,-afs/SOUND_DF,16) ;
else
sound(volume*decdc(xf,SOUND_DF),afs/SOUND_DF,16) ;
end
else
if SOUND_DF<0,
sound(volume*x(:,1:chk),-afs/SOUND_DF,16) ;
else
sound(volume*decdc(x(:,1:chk),SOUND_DF),afs/SOUND_DF,16) ;
end
end
0 件のコメント
回答 (1 件)
Seth Furman
2021 年 3 月 22 日
Check out the xline function, which lets you plot a vertical line as well as update its position.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Animation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!