Help to plot the LED Characteristic Curve
3 次查看(过去 30 天)
显示 更早的评论
I am trying to plot the LED characteristic curve, but I am not getting the correct curve.The theoretical curve is below.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/735029/image.jpeg)
The curve I'm finding is this. A little different than expected.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/735034/image.png)
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!