ADC_data_lim17_GAIN25=load('Data_Lim_17_GAIN_25');
dec_limit=17
f_RD_not=892.858e3;
normalization_coffient=(19.6e-3)/(25*15e-3)
real_data_ADC=ADC_data_lim17_GAIN25.real_data_ADC;
I_real=real_data_ADC*normalization_coffient;
real_data_comperator_output=ADC_data_lim17_GAIN25.real_data_IN_driver;
t=(1/f_RD_not)*(1:length(real_data_comperator_output));
figure(52);
plot(t,I_real,' red -- d ','linewidth',1);
hold on ;
plot(t,1*dec_limit*normalization_coffient*ones(size(t)),' black ','linewidth',3);
hold on ;
min_y_of_switch=min(real_data_ADC(length(t)/2:end));
max_y_of_switch=max(real_data_ADC(length(t)/2:end));
line=(max_y_of_switch-min_y_of_switch);
title([' I_1(t) from ADC , Boundery Limit Current=' num2str(dec_limit*normalization_coffient) '[A]']);
ylabel('I[A]');xlabel('time[ mSec]');grid on;grid minor;
legend_1=legend ('I_{real}','boundery limit','comperator output');
set(legend_1,'FontSize',16);
xticks([0:0.0002:t(end)]);
ylim([ 0 max(I_real)]);
yticks([ 0:0.1:max(I_real)]);
I_real_6=I_real;
figure(2);
Fs = f_RD_not;
T = 1/Fs;
L = 2040;
t_fft = (0:L-1)*T;
Y = fft(I_real_6);
P2 = abs(Y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);
f = Fs*(0:(L/2))/L;
plot(f,P1);
title('Single-Sided Amplitude Spectrum of I_1(t) from ADC ')
xlabel('f (K Hz)');
ylabel('|P1(f)|') ;
set(gca,'FontSize',12);grid on;
ax = gca;
ax.XAxis.Exponent = +3;
xticks([0:10e3:f(end)]);