Two trains $$A$$ and $$B$$ are moving with speeds $$20\ m/s$$ and $$30\ m/s$$ respectively in the same direction on the same straight track, with $$B$$ ahead of $$A$$. The engines are at the front ends. The engine of train $$A$$ blows a long whistle.
Assume that the sound of the whistle is composed of components varying in frequency from $$f_{1}=800\ Hz$$ to $$f_{2}=1120\ Hz$$ as shown in the figure. The speed in the frequency (highest frequency lowest frequency) is thus $$320\ Hz$$. The speed of sound in still air is $$340\ m/s$$.