using triangular basis functions to generate signal