The adaptive algorithm satisfies the present needs on technology for diagnosis biosignals as lung sound signals (LSSs) and accurate techniques for the separation of heart sound signals (HSSs) and other background noise from LSS. This study investigates an improved adaptive noise cancellation (ANC) based on normalized last-mean-square (NLMS) algorithm. The parameters of ANC-NLMS algorithm are the filter length (Lj) parameter, which is determined in 2n sequence of 2, 4, 8, 16,…, 2048, and the step size (μn), which is automatically randomly identified using variable μn (VSS) optimization. Initially, the algorithm is subjected experimentally to identify the optimal μn range that works with 11 Lj values as a specific case. This case is used to study the improved performance of the proposed method based on the signal-to-noise ratio and mean square error. Moreover, the performance is evaluated four times for four μn values, each of which with all Lj to obtain the output SNRout matrix (4 × 11). The improvement level is estimated and compared with the SNRin prior to the application of the proposed algorithm and after SNRouts. The proposed method achieves high-performance ANC-NLMS algorithm by optimizing VSS when it is close to zero at determining Lj, at which the algorithm shows the capability to separate HSS from LSS. Furthermore, the SNRout of normal LSS starts to improve at Lj of 64 and Lj limit of 1024. The SNRout of abnormal LSS starts from a Lj value of 512 to more than 2048 for all determined μn. Results revealed that the SNRout of the abnormal LSS is small (negative value), whereas that in the normal LSS is large (reaches a positive value). Finally, the designed ANC-NLMS algorithm can separate HSS from LSS. This algorithm can also achieve a good performance by optimizing VSS at the determined 11 Lj values. Additionally, the steps of the proposed method and the obtained SNRout may be used to classify LSS by using a computer.