TD_CONVOLVE Function Example | Teradata Vantage - TD_CONVOLVE Example - Teradata Vantage

Database Unbounded Array Framework Time Series Functions

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-10-04
dita:mapPath
ncd1634149624743.ditamap
dita:ditavalPath
ruu1634160136230.ditaval
dita:id
ncd1634149624743

Example: TD_CONVOLVE Call with XCONVOLVE_COMPLEX_LEFT Input and CONV_SUMMATION Algorithm

Input Table for XCONVOLVE_COMPLEX_LEFT (Time Series) for CONV_SUMMATION
ID SEQ A_REAL A_IMAG
33 0 1.0 0.2
33 1 2.0 0.8
33 2 -1.0 -0.9
33 3 -2.0 1.9
33 4 -3.0 -0.5
Input Table for Input Table HCONVOLVE_COMPLEX_RIGHT (Filter Series) for CONV_SUMMATION
ID SEQ A_REAL A_IMAG
33 0 1.0 0.55
33 1 2.0 0.65
33 2 0.0 0.45
33 3 -3.0 0.11

TD_CONVOLVE Call with XCONVOLVE_COMPLEX_LEFT Input and CONV_SUMMATION Algorithm

EXECUTE FUNCTION INTO VOLATILE ART(ConvCmplxResB)
         TD_CONVOLVE(
         SERIES_SPEC(TABLE_NAME(XCONVOLVE_COMPLEX_LEFT),SERIES_ID(ID),ROW_AXIS(SEQUENCE(SEQ)),
         PAYLOAD( FIELDS(A_REAL,A_IMAG), CONTENT(MULTIVAR_REAL))),
         SERIES_SPEC(TABLE_NAME(HCONVOLVE_COMPLEX_RIGHT),SERIES_ID(ID),ROW_AXIS(SEQUENCE(SEQ)),
         PAYLOAD( FIELDS(A_REAL,A_IMAG), CONTENT(COMPLEX))),
         FUNC_PARAMS(ALGORITHM("CONV_SUMMATION")),
         INPUT_FMT(INPUT_MODE(MATCH)));

TD_CONVOLVE Output for XCONVOLVE_COMPLEX_LEFT Input and CONV_SUMMATION Algorithm

Display the primary RETURNS TABLE with this statement:

SELECT * FROM ConvCmplxResB;
      
ID  ROW_I  REAL_A_REAL  IMAG_A_REAL   REAL_A_IMAG         IMAG_A_IMAG
-------------------------------------------------------------------------
33  0        2.0         0.0      0.11000000000000001     0.0
33  1        5.0         0.0      0.5700000000000001      0.0 
33  2        1.0         0.0      0.11499999999999994     0.0
33  3        -10.0       0.0      0.8419999999999999      0.0
33  4        -10.0       0.0      0.6429999999999999      0.0
33  5        -3.0        0.0      0.431000                0.0
33  6        6.0         0.0      -0.016000000000000014   0.0
33  7        9.0         0.0      9.05500000000000E       0.0

Example: TD_CONVOLVE with CONV_DFFT Algorithm

Input Table for XCONVOLVE_COMPLEX_LEFT (Time Series) for CONV_DFFT Algorithm
ID SEQ A_REAL A_IMAG B_REAL B_IMAG C_REAL C_IMAG
33 0 2.0 0.2 2.0 0.2 2.0 0.2
33 1 1.0 0.8 1.0 0.8 1.0 0.8
33 2 -1.0 -0.9 -1.0 -0.9 -1.0 -0.9
33 3 -2.0 1.9 -2.0 1.9 -2.0 1.9
33 4 -3.0 -0.5 -3.0 -0.5 -3.0 -0.5
Input Table for Input Table HCONVOLVE_COMPLEX_RIGHT (Filter Series) for CONV_DFFT Algorithm
ID SEQ A_REAL A_IMAG B_REAL B_IMAG C_REAL C_IMAG
33 0 1.0 0.55 1.0 0.55 1.0 0.55
33 1 2.0 0.65 2.0 0.65 2.0 0.65
33 2 0.0 0.45 0.0 0.45 0.0 0.45
33 3 -3.0 0.11 -3.0 0.11 -3.0 0.11

TD_CONVOLVE Call with CONV_DFFT Algorithm

EXECUTE FUNCTION INTO VOLATILE ART(ConvCmplxResB)
   TD_CONVOLVE(
   SERIES_SPEC(TABLE_NAME(XCONVOLVE_COMPLEX_LEFTMULTI),SERIES_ID(ID),ROW_AXIS(SEQUENCE(SEQ)),
   PAYLOAD( FIELDS(A_REAL,A_IMAG,B_REAL,B_IMAG,C_REAL,C_IMAG), CONTENT(MULTIVAR_COMPLEX))),
   SERIES_SPEC(TABLE_NAME(HCONVOLVE_COMPLEX_RIGHTMULTI),SERIES_ID(ID),ROW_AXIS(SEQUENCE(SEQ)),
   PAYLOAD( FIELDS(A_REAL,A_IMAG,B_REAL,B_IMAG,C_REAL,C_IMAG), CONTENT(COMPLEX))),
   FUNC_PARAMS(ALGORITHM("CONV_DFFT")),
   INPUT_FMT(INPUT_MODE(MATCH)));

TD_CONVOLVE Output with CONV_DFFT Algorithm

Display the primary RETURNS TABLE with this statement:

SELECT * FROM ConvCmplxResB;
   

TD_CONVOLVE Output for CONV_DFFT Algorithm

ID SEQ REAL_A_REAL IMAG_A_REAL REAL_B_REAL IMAG_B_REAL REAL_C_REAL IMAG_C_REAL
33 0 1.8899999999999997 1.3000000000000003 1.8899999999999997 1.3000000000000003 1.8899999999999997 1.3000000000000003
33 1 4.430000000000001 3.05 4.430000000000001 3.05 4.430000000000001 3.05
33 2 0.8849999999999998 1.700000000000001 0.8849999999999998 1.700000000000001 0.8849999999999998 1.700000000000001
33 3 -10.842 -1.5799999999999992 -10.842 -1.5799999999999992 -10.842 -1.5799999999999992
33 4 -10.643000000000004 -2.390000000000004 -10.643000000000004 -2.390000000000004 -10.643000000000004 -2.390000000000004
33 5 -3.4310000000000005 -1.2599999999999991 -3.4310000000000005 -1.2599999999999991 -3.4310000000000005 -1.2599999999999991
33 6 6.016000000000003 -7.269999999999998 6.016000000000003 -7.269999999999998 6.016000000000003 -7.269999999999998
33 7 9.055000000000001 1.169999999999999 9.055000000000001 1.169999999999999 9.055000000000001 1.169999999999999