function S = SM(f,L,h,x)
%function S = SM(f,L,h,x)
%Computes S_Mf(z) for z in G
%G = {0,1,...,L-1} with addition mod L
%H = {0,h,2h,...,L-h}
%f = row vector of length L/h, with sampled 
% values on x+H.
% x = shift. Need x in {0,...,h-1}

chi = zeros(1,L);
chi(1:L/h) = fft(f);
S = h*ifft(chi);
if x > 0 
  tmp = S(L-x+1:L);
  S(x+1:L)=S(1:L-x);
  S(1:x) = tmp;
end
%----------------------------------------

