function etccurve=etc(varargin)
% p1: adat, p2: ir smooth vagy hilb, p3: dB (külső) smooth
switch nargin
    case 3
        if strcmp(varargin{2},'hilb'),
            data=abs(hilbert(varargin{1},2*length(varargin{1}))); data=data(1:end/2);
        else
        data=varargin{1};
        end;
%         semmi=varargin{2};
        etccurve=smooth(20*log10(abs(data)),varargin{3});
    case 2
        if strcmp(varargin{2},'hilb'),
            data=abs(hilbert(varargin{1},2*length(varargin{1}))); data=data(1:end/2);
        else
            data=smooth(varargin{1},varargin{2});
        end;
        etccurve=20*log10(abs(data)); 
    otherwise
        data=varargin{1};
        etccurve=20*log10(abs(data));
end;