function cout = spec2(cin, fensterlen, fenster, vorschub)

% core/spec2
%
% cout = spec2(cin, fensterlen, fenster, vorschub)
%
% cin=core object
% fensterlen=window size
% fenster=type of window
% vorschub=moving step
%
% spectrogramm of data using short time fft

win = data(window(fensterlen, fenster));
x = data(cin);

n = floor((length(x) - fensterlen)/vorschub);

tmp = zeros(n, fensterlen);

for i=1:n
	offset = (i-1)*vorschub;
	tmp(i, 1:fensterlen) = (x(offset+1:offset+fensterlen) .* win)'; %'
end

tmp = abs(fft(tmp, [], 2));
cout = core(tmp(:,1:ceil(fensterlen/2)+1)/ceil(fensterlen/2));


