function lidar_proc=hard_target(lidar)
%create laser pulse shape Note:10ns time division for 3m range gate seperation
dt=(lidar.ranges(2) - lidar.ranges(1)) / .3;
t=[-150:dt:150];
sig=180/2/sqrt(2);
nearly=ceil(72/(lidar.ranges(2) - lidar.ranges(1)));
R=exp(-(t/sig).^2); % gaussian temporal shape with full width of 180ns at 1/e^2
[na,nr]=size(lidar.SNR);
SNR=lidar.SNR;
SNRdb=lidar.SNRdb;
RWS=lidar.RWS;
Beta=lidar.Beta;
lidar_proc=lidar;
lidar_proc.hard.xh=[];
lidar_proc.hard.yh=[];
lidar_proc.hard.zh=[];
lidar_proc.hard.lath=[];
lidar_proc.hard.lonh=[];
lidar_proc.hard.hh=[];


for ja=1:na
    ihard=1;
    P=lidar.SNR(ja,:);
    for j=1:20
%         B=imfilter(P,R,'replicate','conv');
%         BB=imfilter(P./B,R,'replicate','conv');
         B=ConvolutionDft( P,R,'Same' );
         BB=ConvolutionDft(P./B,R,'Same');

        pp=P.*BB;
        P=pp;
    end
    [locs pks]=peakseek(P,10,4);
    if ~isempty(locs)
        % first look at meanRWS in small window
        minp=locs(1)-lidar.gatelengthinpts/2;
        if minp<1
            minp=1;
        end
        maxp=locs(1)+lidar.gatelengthinpts/2;
        if maxp>nr
            maxp=nr;
        end
        rwsmean=mean(lidar.RWS(ja,[minp:maxp]));

        % fix window for NaN'ing RWS around buildings (extended to end of
        % range)
        minp=locs(1)-nearly;
        if minp<1
            minp=1;
        end

        if abs(rwsmean)<.4
            lidar_proc.hard.xh(ja,ihard)=lidar.xd(ja,locs(1));
            lidar_proc.hard.yh(ja,ihard)=lidar.yd(ja,locs(1));
            lidar_proc.hard.zh(ja,ihard)=lidar.zd(ja,locs(1));
            lidar_proc.hard.lath(ja,ihard)=lidar.lat(ja,locs(1));
            lidar_proc.hard.lonh(ja,ihard)=lidar.lon(ja,locs(1));
            lidar_proc.hard.hh(ja,ihard)=lidar.h(ja,locs(1));
            
            ihard=ihard+1;

            SNR(ja,minp:nr)=NaN;
            RWS(ja,minp:nr)=NaN;
            Beta(ja,minp:nr)=NaN;
        end

        
    end


end
ind=find(SNRdb<-19);
SNR(ind)=NaN;
SNRdb(ind)=NaN;
RWS(ind)=NaN;
Beta(ind)=NaN;
lidar_proc.SNR_filt=SNR;
lidar_proc.SNRdb_filt=SNRdb;
lidar_proc.RWS_filt=RWS;
lidar_proc.Beta_filt=Beta;

return