function [ error ] = block_error(data_block, D, Gamma_block)
n_feats = size(D, 1);
n_atoms = size(D, 2);
n_signals = size(data_block, 1)/n_feats;
error = sum((reshape(data_block, [n_feats n_signals]) - ...
             D*reshape(Gamma_block, [n_atoms n_signals])).^2);
end
