%
%  add_sine_tones.m  ver 1.3  March 13, 2013
%
function[amp,velox,dispx,full]=...
          add_sine_tones(amp,tw,dt,NW,mH,mr_choice,h_choice,den,fstart,iunit)
%
disp(' ');
disp(' Enter number of tones  ');
ntones=input(' ');
%
nss=length(amp);
%
sine_amp=zeros(nss,1);
%
for i=1:ntones
        out1=sprintf('\n\n Enter freq(Hz) for tone %d ',i);
        disp(out1);
        sfreq=input(' ');
        out1=sprintf('\n Enter Accel(G) for tone %d ',i);
        disp(out1);  
        samp=input(' ');
%
        sine_amp=sine_amp + (samp*sin(2*pi*sfreq*tw(1:nss)))';
%
end
%   
%
sine_amp=fix_size(sine_amp);
%
n=length(amp);
%
mmm = 2^fix(log(n/NW)/log(2));
%
nov=0;
%    
%
amp=amp+sine_amp;
%
kvn=1;
[amp,velox,dispx]=velox_correction(amp,dt,kvn,fstart,iunit);
%
full=zeros(mH,1);
%
for ijk=1:(2*NW-1)
%
    amp_seg=zeros(mmm,1);
    amp_seg(1:mmm)=amp((1+ nov):(mmm+ nov));  
    nov=nov+fix(mmm/2);
%
    [mag_seg]=FFT_core(amp_seg,mmm,mH,mr_choice,h_choice);
%
    mag_seg=fix_size(mag_seg);
%
    full=full+mag_seg(1:mH);
end
%
full=full/den;