A class of model-based filters for extracting trends and cycles in economic time series is presented. These lowpass and bandpass filters are derived in a mutually consistent manner as the joint solution to a signal extraction problem in an unobserved-components model. The resulting trends and cycles are computed in finite samples using the Kalman filter and associated smoother. The filters form a class which is a generalization of the class of Butterworth filters, widely used in engineering. They are very flexible and have the important property of allowing relatively smooth cycles to be extracted from economic time series. Perfectly sharp, or ideal, bandpass filters emerge as a limiting case. Applying the method to quarterly series on U.S. investment and GDP shows a clearly defined cycle.