Plot a line of maximum frequencies over spectrogram
3 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Time-Frequency Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!