function E_rasta = rastaenergie(Fx, x, fs)
%% Vypocet energie v n RASTA pasmech formantu

% vypocet delky nahravky
full_time = length(x)/fs;
% vypocet noveho vzorkovaciho kmitoctu pro formanty
new_fs = floor(length(Fx)/full_time);

% first compute power spectrum
pspectrum = powspec(Fx, new_fs);

% Pocet filtrovanych pasem
nbands = size(pspectrum,1);
  % put in log domain
  nl_aspectrum = log(pspectrum);

  % next do rasta filtering
  ras_nl_aspectrum = rastafilt(nl_aspectrum);

  % do inverse log
  pspectrum = exp(ras_nl_aspectrum);

  % Vypocet energie v jednotlivych pasmech
  E_rasta = sum(abs(pspectrum.').^2).';

  