function featVec=challenge_features_chop(recordName,n_start,n_win)

[~,signal,Fs,~]=rdmat(recordName);

signal = zscore(signal);

signal = signal(n_start:n_start+n_win);

[QRS,~,~] = qrs_detect2(signal',0.25,0.6,Fs);

R_height   = nan(size(QRS));
QRS_height = nan(size(QRS));
R_interv   = diff(QRS)';
R_acc      = diff(R_interv);

if isempty(R_interv)
    R_interv = 0;
end

if isempty(R_acc)
    R_acc = 0;
end

T_height   = nan(size(QRS));
T_area     = nan(size(QRS));

for i=1:size(QRS,2)
    try 
        QRS_tmp       = signal(QRS(i)-10:QRS(i)+10);
        R_height(i)   = max(abs([min(QRS_tmp) max(QRS_tmp)]));
        QRS_height(i) = max(QRS_tmp) - min(QRS_tmp);

        T_tmp       = signal(QRS(i)+30:QRS(i)+100);
        T_height(i) = max(T_tmp);
        T_area(i)   = sum(abs(T_tmp));
    catch
    end
end

median_freq = zeros(1,10);


for i=1:10
    [b,a] = butter(2,[(i-1)*2+.01 i*2]/(Fs/2));
    median_freq(i) = median(filtfilt(b,a,signal).^2);
end


featVec = [...
min(R_height,[],'omitnan'),...
max(R_height,[],'omitnan'),...
mean(R_height,'omitnan'),...
median(R_height,'omitnan'),...
std(R_height,'omitnan'),...
min(QRS_height,[],'omitnan'),...
max(QRS_height,[],'omitnan'),...
mean(QRS_height,'omitnan'),...
median(QRS_height,'omitnan'),...
std(QRS_height,'omitnan'),...
min(R_interv,[],'omitnan'),...
max(R_interv,[],'omitnan'),...
mean(R_interv,'omitnan'),...
median(R_interv,'omitnan'),...
std(R_interv,'omitnan'),...
min(R_acc,[],'omitnan'),...
max(R_acc,[],'omitnan'),...
mean(R_acc,'omitnan'),...
median(R_acc,'omitnan'),...
std(R_acc,'omitnan'),...
min(T_height,[],'omitnan'),...
max(T_height,[],'omitnan'),...
mean(T_height,'omitnan'),...
median(T_height,'omitnan'),...
std(T_height,'omitnan'),...
min(T_area,[],'omitnan'),...
max(T_area,[],'omitnan'),...
mean(T_area,'omitnan'),...
median(T_area,'omitnan'),...
std(T_area,'omitnan'),...
median_freq];

end
