From d86333ea42098b5da4d8f638919ab2f4600f65f1 Mon Sep 17 00:00:00 2001 From: Yan Michalevsky Date: Tue, 25 Feb 2014 19:55:59 -0800 Subject: [PATCH] Plot spectrum using original spectrogram function --- plot_spectrums.m | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plot_spectrums.m b/plot_spectrums.m index ab8c516..86365ea 100644 --- a/plot_spectrums.m +++ b/plot_spectrums.m @@ -21,7 +21,13 @@ function plot_spectrums(to_plot, fs, flt) for k = 1:3 figure; - % specgram(samples(:, k), 128, 120); - spectrogram(samples(:, k), hanning(NFFT), round(NFFT * 0.9), NFFT, fs); + spectrogram(samples(:, k), NFFT, round(NFFT*0.9), NFFT); + % Using AuditoryToolbox spectrogram +% spec = spectrogram(samples(:, k), NFFT, 2, 2); +% x = (0 : size(spec, 2) - 1) / fs; +% y = 0 : size(spec, 1) - 1; +% imagesc(x, y, spec); +% xlabel('Time [sec]'); +% ylabel('Freq [Hz]'); end; end \ No newline at end of file