Aims. We analysed 3-min oscillations of microwave and extreme ultraviolet (EUV) emission generated at different heights of a sunspot atmosphere, studied the amplitude and frequency modulation of the oscillations, and its relationship with the variation of the spatial structure of the oscillations. Methods. High-resolution data obtained with the Nobeyama Radioheliograph, TRACE and SDO/AIA were analysed with pixelised wavelet filtering (PWF) and wavelet skeleton techniques. Results. Three-minute oscillations in sunspots appear in the form of recurring trains of 8-20 min duration (13 min in average). The typical interval between the trains is 30-50 min. The oscillation trains are transient in frequency and power. The relative amplitude of 3-min oscillations was about 3-8% and sometimes reached 17%. Recurring frequency drifts of 3-min oscillations were detected during the development of individual trains, with the period varying in the range 90-240 s. A wavelet analysis showed that there are three types of oscillation trains: with positive drifts (to high frequencies), negative drifts, and without a drift. Negative drifts, i.e., when the 3-min oscillation period gradually increases, were found to occur more often. The start and end of the drifts coincides with the start time and end of the train. Sometimes two drifts co-exist, i.e. during the end of the previous drift, a new drift appears near 160 s, when the frequency is in the low-frequency part of the 3-min spectrum, near 200 s. This behaviour is seen at all levels of the sunspot atmosphere. The speed of the drift is 4-5 mHz/h in the photosphere, 5-8 mHz/h in the chromosphere, and 11-13 mHz/h in the corona. There were also low-frequency peaks in the spectrum, corresponding to the periods of 10-20 min, and 30-60 min. The comparative study of the spatial structure of 3-min oscillations in microwave and EUV shows the appearance of new sources of the sunspot oscillations during the development of the trains. Conclusions. These structures can be interpreted as waveguides that channel upward propagating waves, which in turn are responsible for the 3-min oscillations. A possible explanation of the observed properties are two simultaneously operating factors: dispersive evolution of the upward propagating wave pulses and the non-uniformity of the oscillation power distribution over the sunspot umbra with different wave sources that correspond to different magnetic flux tubes with different physical conditions and line-of-sight angles.