Why my spectrogram looks so bad? (white lines)
조회 수: 12 (최근 30일)
이전 댓글 표시
I have an audio called audio.mp3 and I do:
[u Fs]=audioread('audio.mp3');
And then:
figure; spectrogram(u);
figure; spectrogram(u,Fs);
But in both cases I have an awful spectrogram, with white lines in it:
using spectrogram(u):
using spectrogram(u,Fs):
I hope you can help me. I really need this to work properly
댓글 수: 0
답변 (3개)
Star Strider
2017년 2월 27일
The spectrogram plot is a surf plot, so if you want to see what the white lines actually mean, use the view function to see it as a 3D plot.
This is from the spectrogram documentation:
Fs = 1000;
t = 0:1/Fs:2-1/Fs;
y = chirp(t,100,1,200,'quadratic');
figure(1)
spectrogram(y,100,80,100,Fs,'yaxis')
view(-77,72)
shading interp
colorbar off
grid on
댓글 수: 2
Star Strider
2017년 2월 27일
There may be white lines that are hidden by the peaks. You may have to rotate it to see them. You can do this interactively using the ‘Rotate 3D’ icon in the plot GUI window. (It has an anti-clockwise circular arrow around a 3D box.)
Also, the white lines could simply be a problem with the resolution. Experiment with the input arguments to see if increasing the fft length, changing the overlap, and others could improve the plot.
Steve Jenkins
2017년 3월 22일
I have the same problem. It seems like with older OpenGl renderers, these artifacts appear. The only methods I've found are to use a new version of OpenGl, or to switch to using painters as a renderer.
set(gcf, 'renderer','painters');
댓글 수: 0
Greg Dionne
2017년 3월 22일
I've heard sometimes updating NVidia drivers help or maybe using the -softwareopengl switch when starting MATLAB. But if all you want is a 2-D image, try something like:
[~,f,t,P] = spectrogram(...)
imagesc(t,f,10*log10(abs(P)+eps))
xlabel('time')
ylabel('freq')
colorbar
댓글 수: 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!