Help to plot the LED Characteristic Curve
조회 수: 5 (최근 30일)
이전 댓글 표시
I am trying to plot the LED characteristic curve, but I am not getting the correct curve.The theoretical curve is below.
The curve I'm finding is this. A little different than expected.
Someone could help me with what I'm wrong. I'm submitting my code below.
% LED information
Vt = 0.5;
Is = 0.5;
% LED model
K = 0.5;
imax = 0.5;
threshold = 150;
sigmaV2 = (imax./threshold).^2;
% number of bits
L = 1e4;
SNRdB = 40;
% Signal-to-Noise Ratio Lin.
SNR = 10.^(SNRdB/10);
r = 10.^(SNRdB/10);
% signal standard deviation (power)
sigmaX2v = SNR.*sigmaV2;
% Maximum number of iterations for a single SNR
max_run = 100;
for sk = 1:length(SNRdB)
for tk = 1:max_run
s = linspace(0,100,10000); % input
s1 = s.';
stdS = std(s1);
X = zeros(1,4.*L);
X(2:2:end) = [s1; conj(s1(end:-1:1))];
xTD = ifft(X);
xTD = (sqrt(sigmaX2v(sk))).*xTD./std(xTD);
xx = xTD;
ind = find(xTD < 0);
xx(ind) = zeros(size(ind));
ss = xx;
iLED = Is.*(exp(ss./Vt) - 1);
xLED = iLED./((1 + (iLED./imax).^(2.*K)).^(1./(2.*K)));
y = xLED;
Nframe = length(y);
Xhat = (fft(y)+10);
Shat = Xhat(2:2:Nframe/2);
Shat = stdS.*Shat./std(Shat);
Y = Shat; % output
end
end
plot(s1,Y)
댓글 수: 0
답변 (1개)
Sulaymon Eshkabilov
2021년 9월 10일
The answer in signal-to-noise ratio value, e.g:
SNRdB = 20; % Gives a nice looking one!
댓글 수: 3
Sulaymon Eshkabilov
2021년 9월 10일
Your obtain curve shape changes because of the SNR value. Thus, whichever value is your actual value for simulation that would be appropriate. You can simulate your code with different values of SNR and see how SNR inluences your curve shape.
참고 항목
카테고리
Help Center 및 File Exchange에서 Digital Filter Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!