# 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?

조회 수: 5(최근 30일)
CHENG WEI LI 2021년 10월 5일
댓글: Mathieu NOE 2021년 10월 25일
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) ##### 댓글 수: 1표시숨기기 없음
CHENG WEI LI 2021년 10월 5일
I do`not want to use polyfit

댓글을 달려면 로그인하십시오.

### 답변(1개)

Mathieu NOE 2021년 10월 5일
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표시숨기기 이전 댓글 수: 1
Mathieu NOE 2021년 10월 25일
hello again
problem solved ?

댓글을 달려면 로그인하십시오.

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!