Transimpedance Amplifier transfer function behaving differently in Matlab as well as Simulink than expected
조회 수: 17 (최근 30일)
이전 댓글 표시
Added reference code and pictures for the reference
-For the given TIA transfer function of gain 158.8dB at 3KHz frequency -
-I have i_mean = 3.5763e-9 and amp = 1.7881e-9 (variable input in the code)
-which means my G_TIA output should give me a wave of peak to peak between 0.1557V and 0.4672V and mean 0.3115V. (Expected Results)
Issue - After using lsim (and even when used in Simulink model) - the TIA peak to peak gives me about 0.2V to 0.51V - with mean about 0.35V. (Simulated Results)
- This simulated output are 0.05V higher than the calculated (expected) ones (when multiplied by the TIA gain with the input wave)
- what could be the issue? Might it be the numerical solver issue or something else?
clc;
clear all;
G_TIA_num = [-6666666666666.7 -5.5555555555556E+23];
G_TIA_den = [1 166666700000 5.5555555555556E+15];
G_TIA = tf(G_TIA_num,G_TIA_den);
fs = 1e6; % Sampling frequency
t = 0:1/fs:0.1; % Time vector
f = 3000; % Sine wave frequency in Hz
mean_current = i_mean; % Mean current (A)
amp = (i_mean*1.5 - i_mean*0.5) / 2; % Amplitude (A)
u = i_mean + amp * sin(2*pi*f*t); % Input signal
[y, t_out] = lsim(G_TIA, u, t);
figure(1);
plot(t_out, y);
xlabel('Time (s)');
ylabel('TIA Output Voltage (V)');
title('TIA Response');
grid on;

댓글 수: 0
채택된 답변
Andrew Ouellette
2025년 7월 15일
The results of lsim are as expected. The mean value will be the dc gain of the system multiplied by the mean value of the input. The amplitude of the output will be the gain at the input wave frequency multiplied by the amplitude of the input wave. (At steady state for both assertions)
i_mean = 3.5763e-9;
G_TIA_num = [-6666666666666.7 -5.5555555555556E+23];
G_TIA_den = [1 166666700000 5.5555555555556E+15];
G_TIA = tf(G_TIA_num,G_TIA_den);
fs = 1e6; % Sampling frequency
t = 0:1/fs:0.1; % Time vector
f = 3000; % Sine wave frequency in Hz
mean_current = i_mean; % Mean current (A)
amp = (i_mean*1.5 - i_mean*0.5) / 2; % Amplitude (A)
u = i_mean + amp * sin(2*pi*f*t); % Input signal
y_amp = abs(freqresp(G_TIA,2*pi*f))*amp;
y_mean = dcgain(G_TIA)*i_mean;
lsimplot(G_TIA, u, t,'b');
grid on;
yline(y_mean+y_amp,'r','ymax');
yline(y_mean,'g','ymean');
yline(y_mean-y_amp,'r','ymin');
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
