1D integration with symbolic limit

조회 수: 1 (최근 30일)
Wardo
Wardo 2017년 1월 21일
답변: Walter Roberson 2017년 1월 22일
Hi all
I wish to calculate the measured response of a photodiode.
The photodiode has a gaussian instrument response function (IRF) while the input of the photodiode is a decaying exponential.
The IRF is defined as follows:
IRF = @(t) 1./(w*sqrt(2*pi)).*exp(-1/2*(t./w).^2);
where w is a numerical, known measured value.
The input decaying exponential signal is defined as follows:
decay_true = @(t) heaviside(t).*exp(-t/tau);
where tau is a numerical value.
The measured response at time t is the casual convolution of these two signals:
measured_signal = @(t) integral(@(tprime) IRF(tprime).*decay_true(t-tprime),tprime,-Inf,t)
I wish to pass this function a numerical array of "times" as follows
time = -1:0.001:1;
y = measured_signal(time);
plot(time,y);
However, MATLAB does not like variable integration limits, giving the error:
Error
A and B must be floating-point scalars.
Can anyone suggest how this integral can be computed with reasonable speed? I wish to pass this to a fitting algorithm later.
Thanks in advance!
Sincerely,
Ward Newman

답변 (1개)

Walter Roberson
Walter Roberson 2017년 1월 22일
If you have the Symbolic Toolbox then
syms IRF(t) decay_true(t) measured_signal(t)
syms tprime tau w Pi real
Pi = sym('pi');
IRF(t) = 1./(w*sqrt(2*Pi)).*exp(-1/2*(t./w).^2)
decay_true(t) = heaviside(t).*exp(-t/tau)
measured_signal(t) = int(IRF(tprime).*decay_true(t-tprime),tprime,-inf,t)
time = -1:0.001:1;
y = measured_signal(time);
You will find that this general solution depends upon sign(w). Also, I make the possibly unwarranted assumption that w and tau are real valued.

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by