Plot a line of maximum frequencies over spectrogram

조회 수: 6 (최근 30일)
Noah Frere
Noah Frere 2016년 7월 24일
I know this has been explored before, and I have been trying things from earlier posts. I plot a spectrogram. Then, for some reason, even though "hold on" is called before I plot the line, the spectrogram is erased and the line plots on a white background. I got it to work just fine using the example in Matlab Docs under the spectrogram section.
{As a side note, and perhaps relevant: I also noticed that changing the parameters of Fs and N had a similar result when Fs and N were almost the same. (The relationship changed for different sized N, but generally speaking, if Fs was above 90% to 99% of N, then the red line (max values at each frequency bin) would not plot at all). }
I have made sure that the z-value for the red line is above the z-values on the spectrogram, and also that the zlimit allows for these values.
if true
%
spectrogram(y,100,80,100:2500,Fs,'yaxis')
view(-77,72)
shading interp
colorbar off
view(2)
[s,f2,t,p] = spectrogram(y,100,80,100:2500,Fs);%t=1.294
[q,nd] = max(10*log10(p));
hold on
plot3(t,nd,q*.2,'r','linewidth',4)
xlim([0 1.294])
ylim([100 2500])
zlim([-100 10])
end
If anybody can help I would sure appreciate it! Thanks, Noah

답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by