
function mse = MSE(v,w,t)

% MSE -- apply soft threshold + compute MSE
%  Usage
%    mse = MSE(v,w,t)
%  Inputs
%    v      clean values
%    w      input coefficients
%    t      threshold (must be scalar)
%  Outputs
%    mse    the value of the mse
%  Description
%    Applies soft-threshold t to all elements of w and computes MSE
%  Note
%    w and v can be 1D or 2D

N = size(w,1)*size(w,2);
wt = WST(w,t);
mse = sum(sum((wt-v).*(wt-v)))/N;
