The use of combination of nonlinear optical materials to control terahertz pulse generation and detection