I use matlab to draw the curve between the ID and VDS of the transistor, but there is a jumping point in the middle. How can I smooth the curve?
16 views (last 30 days)
Show older comments
Vgs=1.5;
W=3*10^-6;
L=0.5*10^-6;
Vth0=0.7;
landa=0.1;
u0=350*10^8;
tox=9*10^-9;
garma=0.45;
finf=0.9;
ebso=3.9*8.854*10^-12;
Cox=ebso/tox*10^-12;
kn=u0*Cox;
Vds=(0:0.001:3);
i=1;
for Vds1=(0:0.001:3)
if Vds1<(Vgs-Vth0)
Ids(i)=kn*W/L*[(Vgs-Vth0)*Vds1-0.5*Vds1^2];
i=i+1;
else
Ids(i)=0.5*kn*W/L*(Vgs-Vth0)^2*(1+landa*Vds1);
i=i+1;
end
end
%Idsp=polyval(polyfit(Vds,Ids,10),Vds);
plot(Vds,Ids)
Answers (1)
Mathieu NOE
on 5 Oct 2021
hello
this would be my suggestion; replacing a segment between Vds = 0.5 and 1.5 with its smoothed version
Vgs=1.5;
W=3*10^-6;
L=0.5*10^-6;
Vth0=0.7;
landa=0.1;
u0=350*10^8;
tox=9*10^-9;
garma=0.45;
finf=0.9;
ebso=3.9*8.854*10^-12;
Cox=ebso/tox*10^-12;
kn=u0*Cox;
Vds=(0:0.001:3);
i=1;
for Vds1=(0:0.001:3)
if Vds1<(Vgs-Vth0)
Ids(i)=kn*W/L*[(Vgs-Vth0)*Vds1-0.5*Vds1^2];
else
Ids(i)=0.5*kn*W/L*(Vgs-Vth0)^2*(1+landa*Vds1);
end
i=i+1;
end
%Idsp=polyval(polyfit(Vds,Ids,10),Vds);
ind = find(Vds>0.5 & Vds<1.5);
%% smoothing
Ids_smooth = Ids;
%%%%%%%%%%%%%%%%butterworth LP filtering)
NN = 3;
Wn = 0.003;
[B,A] = butter(NN,Wn);
figure(1)
% Ids_smooth(ind) = filtfilt(B,A,Ids(ind));
tmp = filtfilt(B,A,Ids);
Ids_smooth(ind) = tmp(ind);
plot(Vds,Ids,Vds,Ids_smooth)
legend('original','smoothed');
2 Comments
See Also
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!