Question, how can I determine the impulse response function of a first order hold? On Wikipedia it is simply stated as:
$$ h_{\mathrm{FOH}}(t)\,= \frac{1}{h} \mathrm{tri} \left(\frac{t}{h} \right) = \begin{cases} \frac{1}{h} \left( 1 - \frac{|t|}{h} \right) & \mbox{if } |t| < h \\ 0 & \mbox{otherwise} \end{cases} \ $$
But given it's implementation $$f(t) = f(kh) + \frac{t - kh}{h}(f((k+1)h) - f(kh)) \text{ with }kh \leq t < (k+1)h$$
how do I obtain $h_{FOH}(t)$?
--edit--
So if $f(kh)=δ(0)$ for $k=0$.
For $k=−1$, e.g., $−h≤t<0$ we get $f(t)=f(−h)+\frac{t+h}{h}(f(0)−f(−h))$ combined with $f(−h)=0$ this results in $f(t)=\frac{t+h}{h}\delta(0)$.
For $k=0$, e.g., $0≤t<h$ we get $f(t)=f(0)+\frac{t}{h}(f(h)−f(0))=δ(0)−\frac{t}{h}\delta(0)$.
So we get $h_{\mathrm{FOH}}(t)\,= \begin{cases} \frac{t + h}{h} \delta(0) & \mbox{if } -h \leq t < 0 \\ \delta(0) - \frac{t}{h} \delta(0) & \mbox{if } 0 \leq t < h \\ 0 & \mbox{otherwise} \end{cases}$
what then follows, is that you have to "see" that this equals the formula with $\text{tri}$ function, as at the start of this message.
clear all;
close all;
clc;
h = 0.01;
t = -1:h:1;
for i = 1:length(t)
if -h <= t(i) && t(i) < 0
y(i) = (t(i) + h) / h;
elseif 0 <= t(i) && t(i) < h
y(i) = 1 - t(i)/h;
else
y(i) = 0;
end
end
fohImpl = @(t,h) triangularPulse(t/h);
figure(1);
plot(t,y);
hold all;
plot(t,fohImpl(t,h));