简体   繁体   English

Matlab中频谱图的平滑冲浪图

[英]Smooth surf plot of spectrogram in Matlab

I want a 3d spectrogram This is what I have done so far. 我想要一个3D频谱图,这是我到目前为止所做的。

urlwrite('http://goo.gl/D1uAn','sample.wav');
%reads from web and saves the wav file in local folder with name sample.wav
%this might not save the file if so please download the file from the link

[W,fs]=wavread('sample');
%[W,fs]=wavread(FileName);

[~,~,T,P]=spectrogram(W(:,end),200,200/2,256,fs);
%[~,~,T,P]=spectrogram(W(:,end),tres,tres/2,fres,fs);
I=flipud(-log(P));
% I is the image of spectrogram in 2D matrix now

% I want to plot this spectrogram in 3d
h = surf(I.*-1);
set(h, 'edgecolor','none');

%this does the job however it is very blocky I want to smooth this

If you increase your overlap, it will be smoother: 如果增加重叠量,它将更加平滑:

[~,~,T,P]=spectrogram(W(:,end),200,199,256,fs);

But will also take longer to calculate. 但是将需要更长的时间来计算。 That's the trade-off. 这就是权衡。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM