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 个)

类别

Help CenterFile Exchange 中查找有关 Time-Frequency Analysis 的更多信息

产品


版本

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by