Language Reference
DFCONV Function
DFCONV (u, v, <type>) ;
This function is supported by the IML procedure and the iml action.
The DFCONV function computes the convolution of two input vectors, u and v. Assuming that the length of vector u is M and the length of vector v is N, the convolution between these two vectors is defined as
In digital signal processing, convolution plays an important role. The output of a linear time-invariant digital filter, , is the full convolution of its impulse response,
, with the input signal,
.
The input arguments to the DFCONV function are as follows:
- u
specifies the first input data vector. Any missing value in this vector is replaced with 0.
- v
specifies the second input data vector. Any missing value in this vector is replaced with 0.
- type
-
is an optional string that specifies the type of convolution to be computed. It is one of the following three values: "Full", "Same", or "Valid". The three types of convolution are defined as follows:
- Full
is the full convolution, which outputs the results with length
. This is the default type.
- Same
is the same-size convolution, which outputs the central part of the full results with the same length as the first input vector, u.
- Valid
is the valid convolution, which outputs only the results that are computed without the zero-padded samples. If the length of u is less than the length of v, then the output is empty.
The input type string is not case-sensitive. When it is not specified, a full convolution is computed.
The DFCONV function returns the convolution results, the length of which depends on the type of convolution specified.
The following example uses the DFCONV function to convolute two vectors:
u = {1, 0, 3, 5, 2};
v = {6, 3, 5};
conv_type = "full";
y = dfconv(u, v, conv_type);
print y;
Figure 104: Convolution Results of Two Vectors
| y |
|---|
| 6 |
| 3 |
| 23 |
| 39 |
| 42 |
| 31 |
| 10 |