function updata = upsample(data, N, method)

updata = zeros(N * size(data));
updata(1:N:end, 1:N:end) = data;

switch method
    case 'rect'
        filt = ones(N, N);
    otherwise
        error('downsample:invalid_argument', ...
            'Invalid downsampling method: ''%s''', method);
end

updata = conv2(updata, filt, 'same');

end
