Skip to content
All library documents

Discrete One-Dimensional Convolution for Signal Processing

Article TradingView scripts

Summary

This library implements discrete, linear convolution for two numeric arrays: a signal and a filter of weights. For each output position, it multiplies aligned signal and filter elements and sums the products that overlap. The output includes the full, unbounded convolution, so its length is determined by the sizes of both inputs rather than being restricted to the original signal length. Empty inputs raise runtime errors.

An example initializes sample arrays and plots the resulting sequence; commented examples show other simple inputs. The document frames convolution as a general signal-processing operation and points to external mathematical references, but it does not apply the method to market data or define a trading signal. It offers no tests of predictive value, trading rules, or performance results. In a quantitative workflow, convolution can provide a building block for filtering or transforming a series, while filter choice and boundary treatment determine how a particular application should be interpreted.

Key ideas

  • Convolution combines a signal and a weight filter by summing overlapping pairwise products.
  • The function returns the full linear convolution, whose length depends on both input arrays.
  • The library rejects empty signals and empty filters.
  • The examples illustrate computation and plotting, not a financial application or trading result.
  • The choice of filter and handling of output boundaries matter when adapting convolution to time series.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.