Transimpedance Amplifier transfer function behaving differently in Matlab as well as Simulink than expected

17 visualizzazioni (ultimi 30 giorni)
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;

Risposta accettata

Andrew Ouellette
Andrew Ouellette il 15 Lug 2025
Hello @Jayesh N,
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');
  1 Commento
Jayesh N
Jayesh N il 16 Lug 2025
Thank you for your feedback. It has been helpful.
In the simulink model, after the TIA, I also have a Band pass filter in the signal chain. I have attached the simulink model for your reference.
So, the bandpass filter output is different for the 2 different solvers. That was the problem I was going through.
Using Variable step ode15s and ode23s (stiff system solvers). I am getting expected results for ode23s.

Accedi per commentare.

Più risposte (0)

Prodotti


Release

R2025a

Community Treasure Hunt

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

Start Hunting!

Translated by