160 likes | 306 Views
Torpedo Striker Overview. Attenuation. Balance. ***Normalized to one in code. Overall Falloff. Sonar Sound Generation I. Quality sound from Dr. Kepuska (exp based) Too much processing time. Sonar Sound Generation II. Less quality sound I developed (sinc based)
E N D
Balance ***Normalized to one in code
Sonar Sound Generation I • Quality sound from Dr. Kepuska (exp based) • Too much processing time
Sonar Sound Generation II • Less quality sound I developed (sinc based) • Still too much processing time function [xg] = SonarSynthe(fs, dur, varargin); d = dur*fs; % dur in sec t = 0:d; % t in number of samples h=2*pi*(8*t./fs-0.6); xx=2*sin(h)./h+0.6; decayz=exp(-3*t./fs); env1=xx.*decayz; chime=exp(-3*t./fs).*sin(2*pi*62*t./fs); env2=env1+chime+1.5; env3=env2.*0.3.*exp(-3*t./fs); fc=1500; x=sin(2*pi*fc.*t./(fs*dur)); xg=x.*env3; figure; plot(t./fs,xg); grid on; xlabel('Time [s]'); title('Sythesised Signal'); soundsc(xg, fs);
Sonar Sound Generation III • Linear falloff to avoid exp calculations • Now recognizable on DSP, but not perfect
Sonar Sound Generation IV • Output Dr. Kepuska’s sound from Matlab as array and store in SDRAM • Cycle through array elements at sampling frequency for playback
Sub Noise • Background noise for continual sense of location • Low frequency 300Hz tone • y=sin(2*pi*300*t./d)
Dead Beat Tone • To signify a torpedo miss • Single 1200Hz tone like dead beat life support • y=sin(2*pi*1200*t./d);
Explosion Noise I • Random number generation for sine wave • Linear interpolation between random number generation • model
Explosion Noise II • void (Explosiond)(void) • { • scalar=(statrand/35); • c = (long)((co-cprev)*scalar + cprev); // linear interpolation… y=mx+b • randfunc=cosf(2*pi*c/ 1073741823); • decay2=2*(te/d2)*expf(-3*(te)/fs); • z=decay2*randfunc; • z=z*40000000; • scalar2=(statrand2/75); • c2 = (long)((co2-cprev2)*scalar2 + cprev2); • randfunc2=cosf(2*pi*c2/ 1073741823); • decay2b=4*(te/d2)*expf(-3*(te+2)/fs); • z2=decay2*randfunc2; • z2=z2*40000000; • te=te+1; • statrand = statrand +1; • statrand2 = statrand2 +1; • if (statrand >= 35) • { statrand=1; • cprev=co; • srand(te); • co=rand(); • } • if (statrand2 >= 75) • { statrand2=1; • cprev2=co2; • srand(te+1); • co2=rand(); • } • if (te >d) • { • te =0; • exptrig=0; • } • z=z+z2; • iChannel0LeftIn = (int) z; • iChannel0RightIn = (int) z; • }
Problems • Processing time and real time audio • Overcome with simplified algorithms and stored audio in SDRAM • Intermittent Ping • Added background noise for sense of location
Concluding Remarks • Design of Torpedo Striker has been rewarding process • Special thanks to Dr. Kepuska for Sonar Sound and additional help • Special thanks to Za and SDRAM help