Talk:CSI Adelaide: Was Trayvon Martin murdered?
Hellp people..
I wrote a little bit of Matlab / GNU-octave code to generate spectrograms.
Question: Is there any space on the Wiki that I can use to upload source-code and atat et cetera...
Source code is as follows:
clear
%% An example of a Speech spectrogram, in GNU Octave
filename_01 = "trayvon_martin_gunshot.wav"
[x, Fs] = auload(file_in_loadpath(filename_01)); % load the audio file
% reduce to a single chanel, for now... x = mean(x,2);
% trace print the number of samples Sx = size(x) % trace print eh sampling frequency Fs
% set up some important parameters step = fix(2*Fs/1000); % one spectral slice every 2 ms window = fix(20*Fs/1000); % 20 ms data window fftn = 2^nextpow2(window); % next highest power of 2
% take the spectrogram [S, f, t] = specgram(x, fftn, Fs, window, window-step);
% adjust the spectrogram data S = abs(S(2:fftn*4000/Fs,:)); % magnitude in range 0<f<=4000 Hz. S = S/max(S(:)); % normalize magnitude so that max is 0 dB. S = max(S, 10^(-40/10)); % clip below -40 dB. S = min(S, 10^(-3/10)); % clip above -3 dB.
% display the data imagesc(t, f, flipud(log(S))); % display in log scale title("An example spectrogram"); xlabel("time (s)"); ylabel("freq. (Hz.)"); grid on
print -djpeg "trayvon_martin_gunshot.jpg"
Just a quick Math test.
\int_{-N}^{N} e^x\, dx \int_{-N}^{N} e^x\, dx