def conv(signal1, signal2):
    """Discrete convolution by definition"""

    n = len(signal1) + len(signal2) - 1
    out = []
    
    for i in range(n):
        s = 0
        
        for j in range(i + 1):
            if j < len(signal1) and i - j  < len(signal2):
                s += signal1[j] * signal2[i - j]
                
        out.append(s)

    return out