  In this article we consider the detection of compact sources in maps of the
Cosmic Microwave Background radiation (CMB) following the philosophy behind the
Mexican Hat Wavelet Family (MHWn) of linear filters. We present a new
analytical filter, the Biparametric Adaptive Filter (BAF), that is able to
adapt itself to the statistical properties of the background as well as to the
profile of the compact sources, maximizing the amplification and improving the
detection process. We have tested the performance of this filter using
realistic simulations of the microwave sky between 30 and 857 GHz as observed
by the Planck satellite, where complex backgrounds can be found. We demonstrate
that doing a local analysis on flat patches allows one to find a combination of
the optimal scale of the filter R and the index of the filter g that will
produce a global maximum in the amplification, enhancing the signal-to-noise
ratio (SNR) of the detected sources in the filtered map and improving the total
number of detections above a threshold. We conclude that the new filter is able
to improve the overall performance of the MHW2, increasing the SNR of the
detections and, therefore, the number of detections above a 5 sigma threshold.
The improvement of the new filter in terms of SNR is particularly important in
the vicinity of the galactic plane and in the presence of strong galactic
emission. Finally, we compare the sources detected by each method and find that
the new filter is able to detect more new sources than the MHW2 at all
frequencies and in clean regions of the sky. The BAF is also less affected by
spurious detections, associated to compact structures in the vicinity of the
galactic plane.
