Code generation for signals