]> git.parisson.com Git - telemeta.git/commitdiff
Tuned max sample lengths to reasonable values
authoryomguy <>
Sun, 27 May 2007 22:18:37 +0000 (22:18 +0000)
committeryomguy <>
Sun, 27 May 2007 22:18:37 +0000 (22:18 +0000)
telemeta/visualization/octave/spectrogram2img.m
telemeta/visualization/spectrogram2.py
telemeta/visualization/waveform2.py

index 9294bae1099dab2fe655c3abd5c0939792d3e22d..52a1e1f4355d5e4dcef2f8bb3bc9b43e2f772ccc 100644 (file)
@@ -27,15 +27,18 @@ step = 6;   % spectral slice period (ms)
 % step_length = fix(5*Fs/1000);
 window = 30;   % filter window (ms)
 % window = fix(40*Fs/1000);
-lim_x_length = 10; % (s)
+time_limit = 30; % length limit of the displayed sample (s)
 
 [x, Fs] = wavread(wav_file);
 x = x(:,1);  % mono
-lim_x_samples = Fs.*lim_x_length;
-if length(x) > lim_x_samples;
- x = x(1:lim_x_samples);
-end
+lx = length(x);
 
+% LIMITING time
+lx_lim = Fs.*time_limit;
+if lx > lx_lim;
+ x = x(1:lx_lim);
+end
+    
 %fftn = 2^nextpow2(window); % next highest power of 2
 [S, f, t] = spectrogram(x, Fs, window, step, 4000, 'hanning', -30);
 S = flipud(20*log10(S));
index 6afe0b40635e6a9f2374b51df31d5216997ef3d9..574aad0c0e623c5e0d688fdf47cb86a2120883a8 100644 (file)
@@ -26,7 +26,7 @@ class SpectrogramVisualizer2(OctaveCoreVisualizer):
         return "spectrogram2"
 
     def get_name(self):
-        return "Spectrogram2"
+        return "Spectrogram2 (< 300s)"
     
     def render(self, media_item, options=None):
         """Generator that streams the spectral view as a PNG image"""
index 30ee273bbabe4a017b124b6c44d95a8b61602bc6..f9c8248c0997693156c9344880cfa68b490584c7 100644 (file)
@@ -26,7 +26,7 @@ class WaveformVisualizer2(OctaveCoreVisualizer):
         return "waveform2"
 
     def get_name(self):
-        return "Waveform2"
+        return "Waveform2 (< 30s)"
     
     def render(self, media_item, options=None):
         """Generator that streams the temporal view as a PNG image"""