This paper considers the problem of compact source detection on a Gaussian background in 1D. Two aspects of this problem are considered: the design of the detector and the filtering of the data. Our detection scheme is based on local maxima and it takes into account not only the amplitude but also the curvature of the maxima. A Neyman-Pearson test is used to define the region of acceptance, that is given by a sufficient linear detector that is independent on the amplitude distribution of the sources. We study how detection can be enhanced by means of linear filters with a scaling parameter and compare some of them (the Mexican Hat wavelet, the matched and the scale-adaptive filters). We introduce a new filter, that depends on two free parameters (biparametric scale-adaptive filter). The value of these two parameters can be determined, given the a priori pdf of the amplitudes of the sources, such that the filter optimizes the performance of the detector in the sense that it gives the maximum number of real detections once fixed the number density of spurious sources. The combination of a detection scheme that includes information on the curvature and a flexible filter that incorporates two free parameters (one of them a scaling) improves significantly the number of detections in some interesting cases. In particular, for the case of weak sources embedded in white noise the improvement with respect to the standard matched filter is of the order of 40%. Finally, an estimation of the amplitude of the source is introduced and it is proven that such an estimator is unbiased and it has maximum efficiency. We perform numerical simulations to test these theoretical ideas and conclude that the results of the simulations agree with the analytical ones.