function peak_list_ppm = inc2ppm(peak_list_inc, header_data)
% peak_list_ppm = inc2ppm(peak_list_inc, header_data)
%    map a peak list (in incriment units) to corresponding ppm values

Ni_row = header_data(26,:);
num_dims = min(size(peak_list_inc,2),sum(Ni_row > 1));
num_peaks = size(peak_list_inc,1);
Ni_row = Ni_row(1:num_dims);

right_ppm = header_data(16,1:num_dims)./header_data(14,1:num_dims);
sw = header_data(20,1:num_dims)./header_data(14,1:num_dims);
left_ppm = right_ppm + sw;

peak_list_ppm = (-repmat(sw,num_peaks,1)./repmat(Ni_row,num_peaks,1)).*peak_list_inc(:,1:num_dims) + repmat(left_ppm,num_peaks,1);