How do I mark on a figure's spectrogram?
-
14-07-2021 - |
Question
Using a figure to create a new one, then spectrogram to plot on it, how do I mark a certain point on the existing figure?
Solution
Use the hold feature:
hold on
This way, you can make another plot and it will overlay the spectrogram.
An example (you probably didn't see your marker because it wasn't large enough):
>> t=0:0.001:2; % 2 secs @ 1kHz sample rate
>> y=chirp(t,100,1,200,'q'); % Start @ 100Hz, cross 200Hz at t=1sec
>> spectrogram(y,128,120,128,1E3); % Display the spectrogram
>> hold on
>> plot(200,1,'bx','MarkerSize',20,'LineWidth',20); %Overlay a large, blue X
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow