1. Introduction
Since the invention of fast Fourier transform (FFT) in the 1960s [
1] and the discrete cosine transform (DCT) in the 1970s [
2], digital and image processing algorithms have been widely used in many applications, including acoustic processing [
3], voice recognition [
4], face recognition [
5], remote sensing [
6], and many others. In the processing pipeline, continuous signals are discretized to discrete sequences. We normally expect the discrete signals to be the sampled versions of the corresponding continuous signals. This is mostly true when the sampling rate is high. However, in some cases such as the convolution of two step functions, there is a small difference between the discrete time and the continuous time versions. In particular, the convolution of unit step functions
and
is given by
in the continuous domain from Table 2 in [
7]; the convolution of
and
in the discrete domain is given by
according to Table 3 in [
7]. If one samples
, one will obtain a sequence of
, not
. Why is the sampled version of
different from the discrete convolution of two discrete time step functions of
? Moreover, the discrete convolution formulae in Table 3 [
7] do not have any connection with the sampling interval
T. The consequence is that the continuous convolution outputs and the discrete convolution outputs are not the same.
Another example is the convolution between the unit step
and the ramp function
, which is given by
from Table 2 of [
7]. However, if one carries out the discrete time convolution between the corresponding discretized functions
and
, one obtains
from Table 3 of [
7]. The sampled version of
is, however,
, which is different from
. Multiplying
to
will close the gap between the sampled version,
, and the scaled discrete version,
. But why do we need to multiply by
? What is going on here? Engineers may be confused by the above observations. Actually, there are many instances where the discrete-time convolution results are different from the sampled versions of the continuous convolution.
In this paper, we use examples with equations, figures, and metrics to illustrate the above issues between continuous-time convolutions and their sampled discrete counterparts. We then identify the root causes of the observed differences. One root cause is the discontinuity at t = 0 for functions such as the unit step u(t). A second root cause is the sampling-period scaling that arises when continuous-time convolution is approximated in discrete time. Classical results from Fourier analysis and distribution theory show that, at a point of jump discontinuity, the inverse transform reconstruction converges to the average of the left- and right-hand limits. The present paper does not claim this midpoint result as new. Rather, the goal is to apply it systematically to sampled sequence representations and to show its consequences for convolution formulae when the underlying signal is a sampled continuous-time signal with a discontinuity at the sampling instant.
It is important to distinguish between two different objects. A native discrete-time sequence is defined directly on the integer index n and may legitimately adopt the standard engineering convention u [0] = 1. A sampled continuous-time sequence, by contrast, is obtained from a continuous-time signal x(t) evaluated at t = nT. When x(t) has a jump discontinuity at the sampling instant, a midpoint-consistent sampled representation uses the average of the one-sided limits at that point. The results in this paper concern the latter setting. Therefore, our conclusions should be interpreted as a consistency analysis for sampled continuous-time representations at discontinuities, not as a universal replacement for standard native discrete-time DSP conventions.
For notational clarity,
Section 3 will denote native discrete-time sequences by
and sampled sequences by
.
Classical Fourier analysis and distribution-theoretic results establish the midpoint value at jump discontinuities under inverse-transform reconstruction. Standard DSP textbooks [
7,
8,
9,
10,
11], however, often adopt native discrete-time conventions for practical modeling. Sampled-data and digital-control texts [
12,
13,
14], on the other hand, emphasize the relationship between continuous-time systems, sampling, and discrete-time approximations. The present paper focuses on the interface between these two viewpoints: it examines how the classical midpoint rule should be represented when a discrete sequence is interpreted specifically as a sampled version of an underlying continuous-time signal, and how that choice affects sampled-data convolution formulae.
Our contributions are as follows. First, we clarify the distinct roles of midpoint sampling at discontinuities and sampling-period scaling in explaining why sampled continuous-time convolution results can differ from conventional discrete formulae. Second, we present midpoint-consistent sampled representations for several representative functions and a general class of transfer functions. Third, we derive the corresponding implications for sampled convolution formulae. Finally, we use several examples, including a filter example, to compare conventional discrete results, midpoint-consistent sampled results, and sampled continuous-time results.
This paper is organized as follows. In
Section 2, we will use an example to illustrate some issues in the convolution of two discrete unit step functions. In
Section 3, we will provide the background for the inverse Fourier transform and Laplace transform. We will illustrate that the initial value
of the inverse Fourier transform of
is one-half of the magnitude of the discontinuity. Similarly, we will illustrate that the initial value
of the inverse Laplace transform of
is also one-half of the magnitude of the discontinuity. We will also review the proper relationship between continuous convolution and discrete convolution. We then present the root cause of the issues raised in
Section 2. In
Section 4, we will then derive and present the formulae for discrete sample sequences of continuous functions with and without discontinuities and the formulae for discrete convolutions. In
Section 5, we present four examples to illustrate the differences between various convolution outputs, including continuous convolution, conventional discrete convolution, and the midpoint-consistent sampled convolution. Finally, we conclude the paper with a few remarks in
Section 6. In the
Appendix A,
Appendix B,
Appendix C,
Appendix D and
Appendix E, we present detailed derivations for those formulae mentioned in
Section 4.
2. Issues
Let us use the convolution of two step functions to illustrate the issues. The continuous step function is defined as
The conventional discrete-time step sequence, denoted later by
, is defined as [
7]
When one performs the continuous convolution of two step functions, one obtains (Table 2 of [
7])
When one performs the discrete convolution of two step functions, one gets (Table 3 of [
7])
If we compare (3) and (4), one immediately notices that the sampling interval
T is not explicitly present in (4). One should always keep in mind that at each discrete index
n, the time at the
nth sample is
nT. We will see in
Section 3 that, in order to ensure the discrete convolution outputs to have a similar magnitude as the continuous convolution outputs, we need to multiply one of the input sequences by
T. Hence, the discrete convolution output in (4) should be replaced by
We call the discrete convolution output in (5) the scaled discrete convolution output.
Now let us use a table and a figure to illustrate another issue between continuous and discrete convolutions.
Table 1 tabulates the continuous and discrete convolution results for several time instants. Here, we assume that the sampling interval
T is 0.1 s. First, we observe from
Table 1 that the discrete convolution outputs in row 4 are an order of magnitude larger than the continuous values. Second, even if we take the sampling interval
T into account by multiplying the discrete convolution outputs in row 4 by
T, the continuous (row 3) and scaled discrete convolution outputs (row 5) are still different.
Figure 1 shows the difference between the continuous and the scaled discrete convolution results. Of course, one can argue that the difference is so small and can be ignored if
T is small. However, in some applications, the sampling interval may not be small and this error may have some undesirable consequences.
3. Background and Explanations of the Issues in Section 2
Before presenting the transform-based arguments, we distinguish three related objects. Let denote a continuous-time signal. Let denote a native discrete-time sequence defined directly on the integer index n. Let denote a sampled sequence obtained from with sampling period T. If is continuous at t = nT, then . If has a jump discontinuity at t = 0, then under the midpoint-consistent sampled convention used in this paper, we set = [x(0−) + x(0+)]/2. Throughout the paper, we use δ(t) to denote the continuous-time Dirac delta and δ[n] to denote the discrete-time Kronecker impulse.
Let us consider a signal with discontinuity at
t = 0,
where
p > 0 and
is the unit step function. Note that for
there is a jump of 0 to 1 from
to
. The corresponding Fourier transform
and Laplace transform
are respectively given by
3.1. Inverse Fourier Transform of at t = 0
The inverse Fourier transform of (7) is given by
Substituting
t = 0 into (9), we have
To evaluate the above integral, we first evaluate the following definite integral [
15]
Therefore, after taking the limit of
to
, we have
For a general discontinuity at
t = 0, Papoulis [
16] gives the standard midpoint formula
Equation (12) is a special case of (13). For the unit step, and , and therefore .
3.2. Inverse Laplace Transform of at t = 0
By definition [
7], the inverse Laplace transform of (8) is given by
where
c is a constant. Replacing
s with
s′ +
c in (14) yields
Using another substitution of
s′ =
, (15) becomes
Setting
t = 0 in (16) yields
Following the same procedures as the inverse Fourier transform, we evaluate the following definite integral
When the relative degree of a Laplace transform is greater than one, the inverse transform does not have a discontinuity at t = 0. For example, the inverse Laplace transform of is , which is zero at t = 0. In general, we can apply the initial value theorem to prove that, for any Laplace transform function with a relative degree greater than one, the inverse transform value at t = 0 is always zero, meaning that there are no discontinuities at t = 0.
For a general strictly proper transfer function
, we can decompose
into the sum of first-order transfer functions by using partial fraction expansion. That is,
where
are the poles and
are the corresponding residues.
By repeatedly using the results from (15)–(18), the inverse Laplace transform of
evaluated at
t = 0 yields
An alternative and simple method for determining (20) is as follows. For a general function and its corresponding Laplace transform that is strictly proper, we can determine the appropriate discrete value at t = 0 by first determining the value of at t = 0+. This can be done by using the initial value theorem, which states that, for a strictly proper function , . If and are nonzero, then the value of x(0) should take the average of and .
3.3. Continuous Convolution and Discrete Convolution
Let
,
, and
denote the continuous-time input, impulse response, and output, respectively. By definition, the convolution between two functions in time is given by
Given a sampling period
T, (21) can be discretized
Define the sampled impulse-response sequence
Then the sampled-data convolution can be written as
where
is the sampled input sequence and
is the sampled output sequence. Under this notation, the factor
T is carried explicitly by the sampled impulse response
. This does not redefine native discrete-time convolution; it only specifies the sampled-data convention used to approximate the continuous-time convolution integral.
Equation (23) ensures that
and
have similar magnitudes. The discrete time convolution is shown in
Figure 2b. Actually, people usually forget about the importance of the factor
T in discrete time convolution, resulting in a factor of
T difference between continuous time and discrete time convolution results. Books [
17,
18] related to optics, however, do explicitly take the discretization factor (sampling period) into account to ensure continuous signals have similar magnitudes as the discrete counterparts.
3.4. Explanations of the Issues in Section 2
We can now apply the above material to explain the issues in
Section 2. Under the midpoint-consistent sampled convention used here, the sampled step satisfies
.
To address the scaling factor
T, we treat one sequence as the sampled impulse response and multiply it by
T following the sampled-data interpretation in
Figure 2b. With this convention, the resulting discrete calculation is designed to match the sampled continuous-time convolution result as closely as possible. For this reason, we refer to the result below as a midpoint-consistent sampled convolution, rather than a universally corrected discrete convolution. Consequently, the discrete convolution of two step functions should be
Now we tabulate the various convolution outputs in
Table 2. It can be clearly seen that the midpoint-consistent sampled convolution samples (row 6 in
Table 2) more closely match the continuous convolution outputs (row 3 in
Table 2). To easily compare the various convolution outputs, we also plot them in
Figure 3.
Table 3 also summarizes the maximum absolute error (MAE) and the normalized root-mean-square-error (NRMSE) metrics for three sampling periods. It can be seen that the midpoint-consistent sampled convolutions are much closer to the continuous convolution results.
5. Experimental Results
Here, we include a few examples to compare the conventional and midpoint-consistent formulae in
Table 5.
Example 1: Convolution of one step and one ramp function.
The corresponding formulae for the convolution of one step and one ramp function are shown in row 3 of
Table 5.
Table 6 compares the various convolution results for a few samples. One can see that the continuous and midpoint-consistent sampled convolution results are exactly the same.
Figure 4 also plots the three convolution outputs up to 1 s. It can be seen that the gap between the conventional discrete and the midpoint-consistent sampled convolution results grows bigger as time increases. This demonstrates the importance of using a sampled-data formulation consistent with the continuous-time model under the stated assumptions.
Table 7 also summarizes the MAE and the NRMSE metrics for three sampling periods. The midpoint-consistent sampled convolution outputs are closely matched to the continuous convolution results.
Example 2: Convolution between a step and an exponential function.
Here, we want to show the convolution between
and
with
= 5. The corresponding formulae are shown in row 4 of
Table 5. The sampling interval
T = 0.1 s.
Figure 5 shows the convolution outputs. We can see that for this growing-exponential example, the absolute difference increases with
n.
Table 8 contains results from four time instants. At
t = 1 or
n =10, the difference between the conventional discrete response
and midpoint-consistent sampled responses
is about 8.08 for the reported example, which is non-negligible. This large difference is simply caused by the small discontinuity at
t = 0.
Table 9 also summarizes the maximum absolute error (MAE) and the normalized root-mean-square-error (NRMSE) metrics for three sampling periods. The same trend is observed in
Table 9: the midpoint-consistent sampled result has substantially smaller MAE and NRMSE than the conventional discrete result.
Example 3: Convolution between two exponential functions.
This is the convolution between two exponential functions:
and
with
and
. From row 5 of
Table 5, the convolution of the continuous functions gives
Also from
Table 5, the conventional discrete convolution output is
Finally, from
Table 5, the midpoint-consistent sampled convolution output is
Table 10 tabulates a few samples for the various convolution outputs.
Figure 6 also shows those convolution outputs. One can see that as time increases, the difference between the discrete and continuous outputs grows progressively larger. For instance, at
t = 1 s, the difference is close to 10.
Table 11 also summarizes the MAE and the NRMSE metrics for three sampling periods. The midpoint-consistent sampled convolution outputs have approximately two-order of magnitude smaller errors in MAE and NRMSE as compared to the conventional convolution outputs.
Example 4: Step response of a bandpass filter.
The continuous step input is
, the conventional native discrete-time step sequence is
, and the midpoint-consistent sampled sequence is
. For a given bandpass filter
its continuous impulse response is given by
For a sampling period of
T, the conventional discrete impulse response sequence is given by
Since there is a discontinuity from 0 to 4 at
t = 0 for the bandpass filter, a correction term of 2 is needed for the midpoint-consistent impulse response sequence
. Hence, the expression for the midpoint-consistent sampled impulse response sequence of the filter is given by
The left column of
Figure 7 shows the conventional native discrete-time step function and the scaled discrete impulse response of the bandpass filter. The right column of
Figure 7 shows the midpoint-consistent sampled unit step function and the scaled sampled impulse response of the filter. It can be clearly seen that the differences between the left and right columns of
Figure 7 are at
n = 0. The impact of these small differences is actually quite substantial, which can be seen in
Figure 8. We can clearly see that the conventional discrete convolution response of the bandpass filter is quite different from that of the continuous step response. After adding the small correction at
n = 0, the midpoint-consistent sampled step response is almost overlapping the continuous step response.
To further quantify the performance improvement of using the midpoint-consistent sampled sequences, we compute the errors between the conventional discrete convolution and the continuous convolution, and also the errors between the midpoint-consistent sampled convolution and the continuous convolution.
Table 12 tabulates the maximum absolute error (MAE) and normalized root-mean-square-error (NRMSE) values for the two error sequences. There are three sampling periods:
T = 0.02 s,
T = 0.05 s, and
T = 0.1 s. One can see that the performance gain from using the midpoint-consistent sampled sequences is substantial because an order of magnitude improvement can be seen in the NRMSE values.