// Earthquake Early Warning! // Earthquake Early Warning! clear; fs=48000; p=atan(1.0)*8.0/fs; f=215*2^([10 15 19 25 30.. 11 16 20 26 31 ]/12); c=5500; b=c*[3.0 2.5 2.0 1.5 1.0 .. 4.5 4.0 3.5 3.0 2.5]-1; a=0; for i=1:5 a=a+[ zeros(1,c*0.5*(i-1)) .. sin([0:b(i)]*p*f(i)).. zeros(1,c*0.8).. zeros(1,c*0.5*(i-1)).. sin([0:b(i+5)]*p*f(i+5)).. zeros(1,c*4.0).. ]/20; end s=ones(a); s((16500-1000):16500).. =(1+exp(((0:1000)/1000-0.5)*10))^(-1); s((45650-1000):45650).. =(1+exp(((0:1000)/1000-0.5)*10))^(-1); a=a.*s; playsnd(a,fs); //savewave("test.wav",a,fs);