How can I save spectrograms as a high resolution image?

1 visualizzazione (ultimi 30 giorni)
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

Risposte (0)

Categorie

Scopri di più su Time-Frequency Analysis in Help Center e File Exchange

Prodotti


Release

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by