N=10000;
F=[0 50 100 200 215 500 1000 2850 3600 3660 3680 44100/2]/(44100/2);
A=10.^([-30 -25.8 -12.8 17.4 17.8 12.2 7.2 0 -2 -20 -30 -60]/20);

voicedST=[-155 276 517 578 491 302 86 -103 -207 -198 -60 190 543 ...
            948 1362 1741 2043 2276 2422 2500 2552 2595 2655 2758 2896 3060 ...
            3224 3370 3500 3569 3603 3603 3595 3586 3595 3638 3724 3819 3922 ...
            4000 4043 4034 3974 3862 3724 3577 3439 3336 3267 3224 3198 3172 ...
            3192 3043 2914 2750 2560 2353 2155 1991 1853 1750 1672 1603 1534 ...
            1440 1310 1146 965 776 603 448 345 276 250 250 267 267 ...
            241 190 103 -9 -138 -267 -388 -491 -569 -638 -698 -759 -813 ...
            -888 -957 -1034 -1103 -1146 -1181 -1190 -1198 -1215 -1259 -1327 -1457 -1629 ...
            -1853 -2121 -2414 -2707 -3017 -3319 -3612 -3913 -4224 -4560 -4922 -5301 -5715 ...
            -6137 -6560 -6948 -7301 -7568 -7732 -7758 -7620 -7310 -6810 -6155 -5344 -4439 ...
            -3474 -2508 -1595 -802];
    
voicedST16=voicedST'*ones(1,16);
voicedST16=voicedST16(:)';

ik=rand(3715,1)>.5;
ikneg=-ik(end:-1:1);
H=305360*exp(j*[ik; 0; ikneg]*pi);
htime=real(ifft(ifftshift(H),8192));
htime=[htime; htime(1:628)];%repeat about 1.077 times which is 628 time steps

B=fir2(N,F,A);
unvoicedST=conv(B,htime);
unvoicedST=unvoicedST(N/2+1:N/2+length(htime));

ST=[voicedST16 unvoicedST zeros(1,4471) -voicedST16 -unvoicedST zeros(1,4471)];
ST=ST'*ones(1,16);
ST=ST(:)';

voicedDT=[-198 -112 -9 103 233 388 543 724 896 1060 1233 1388 1517 1638 1747 1810 1845 1845 1802 1707 1569 1379 ...
            1146 871 560 233 -121 -491 -871 -1250 -1638 -2043 -2465 -2896 -3345 -3819 -4310 -4810 -5319 -5836 -6353 -6853 -7353 -7836 ...
            -8292 -8715 -9077 -9370 -9542 -9524 -9361 -8956 -8327 -7465 -6396 -5163 -3827 -2448 -1103 155 1293 2241 3034 3655 4138 4517 ...
            4827 5094 5344 5594 5827 6043 6215 6344 6413 6422 6379 6310 6215 6120 6051 6000 5991 5991 6000 6008 5991 5939 ...
            5853 5715 5560 5387 5215 5043 4879 4732 4586 4439 4276 4086 3870 3629 3370 3086 2801 2534 2267 2034 1819 1612 ...
            1422 1224 1026 819 603 388 181 9 -181 -328 -448 -543 -629 -707 -784 -871 -948 -1026 -1112 -1181 -1241 -1276 ...
            -1293 -1302 -1293 -1267 -1250 -1233 -1224 -1224 -1224 -1224 -1215 -1198 -1172 -1129 -1077 -1026 -974 -922 -888 -871 -845 -828 ...
            -810 -793 -767 -741 -698 -672 -638 -603 -595 -586 -595 -603 -621 -629 -938 -638 -638 -638 -638 -638 -647 -644 ...
            -690 -724 -767 -793 -819 -845 -853 -871 -879 -888 -896 -922 -948 -974 -1009 -1026 -1052 -1069 -1077 -1069 -1060 -1060 ...
            -1052 -1043 -1043 -1052 -1060 -1060 -1060 -1052 -1034 -1017 -991 -957 -931 -905 -888 -862 -845 -819 -793 -767 -724 -672 ...
            -621 -560 -509 -457 -397 -345 -276 -207 -112];
    
voicedDT14=voicedDT'*ones(1,14);
voicedDT14=voicedDT14(:)';

ik=rand(3715,1)>.5;
ikneg=-ik(end:-1:1);
H=305360*exp(j*[ik; 0; ikneg]*pi);
htime=real(ifft(ifftshift(H),8192));
htime=[htime; htime(1:628)];%repeat about 1.077 times which is 628 time steps

B=fir2(N,F,A);
unvoicedDT=conv(B,htime);
unvoicedDT=unvoicedDT(N/2+1:N/2+length(htime));

DT=[voicedDT14 unvoicedDT zeros(1,5614) -voicedDT14 -unvoicedDT zeros(1,5614)];
DT=DT'*ones(1,14);
DT=DT(:)';

ST=resample(ST);
DT=resample(DT);

writeCSS(ST,'ST11_2sec');
writeCSS(DT,'DT11_2sec');