How can I save spectrograms as a high resolution image?
1 次查看(过去 30 天)
显示 更早的评论
I have a song file and I would like to save its spectrogram as an image.
*How do I change the image dimensions to make a rectangle without reducing the resolution of the image? I wanted the shape to be something like pbaspect([30 1 1]), but when I do this I get a really tiny image (attached) *How do I smooth the spectrogram data? I'm guessing that because of the low resolution, my image is very very pixelated? Or maybe it's just the spectrogram output that isn't highly resolved?
This is the code I'm using, if anyone has any suggestions for how to make this better, I would greatly appreciate it! :)
read_audio = @audioread
[song, Fs] = read_audio(soundfile);
spectrogram(song, 4000, [], [], Fs, 'yaxis');
ylim([1 8])
caxis([-90 -85])
xlim([0 30])
pbaspect([30 1 1])
axis off
colorbar('off')
edit For my second question, just changing the second argument in spectrogram to 400 did the trick, I can now have smooth data yay
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!