function peak_count=level_crossing_count_Edges_MOD(data_level,I_PDC,smooth_fac)
    
        if length(data_level)>=3 %there must be atleast 3 data points for a peak to appear
            data_level=smoothdata(data_level,'gaussian',smooth_fac);
            [~,peak_pos]=findpeaks(data_level,'MinPeakHeight',I_PDC);
            peak_count_up=sum(peak_pos);
   
            [~,peak_pos]=findpeaks(-data_level,'MinPeakHeight',-I_PDC);
            peak_count_low=sum(peak_pos);
            
            peak_count=peak_count_up+peak_count_low;
        else
            peak_count=0;
        end

end