Matlab中光谱图的平滑冲浪图

时间:2013-07-11 14:37:24

标签: matlab signal-processing spectrogram

我想要一个三维谱图这是我到目前为止所做的。

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

1 个答案:

答案 0 :(得分:1)

如果你增加重叠,它会更顺畅:

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

但也需要更长的时间来计算。这是权衡。