Code covered by the BSD License  

Highlights from
Circular convolution using DCT and DST

from Circular convolution using DCT and DST by Reju VG
circular convolution using Discrete sine and cosine transforms

dsS2e=dS2e(s)
function dsS2e=dS2e(s)
N=length(s);
sS2e=DST2e(s); %n=0:N-1, k=1:N

if rem(N,2)==0  %For even N

    temp=sS2e(2:2:end-2);
    dsS2e=[0; temp; sS2e(end); flipud(temp); 0];
      
else    %For odd N
   
    temp=sS2e(2:2:end-1);
    dsS2e=[0; temp; flipud(temp); 0];
    
end

Contact us at files@mathworks.com