Complex sentence: If their uncle Mike Martin was the engineer he would wave and produce a long whistle, followed by two short ones, which functioned as a signal to the brothers.
Split into simpler sentences: If their uncle Mike Martin was the engineer he would wave and produce a long whistle, followed by two short ones. That functioned as a signal to the brothers.