The advantages of measuring the volume of a phase object through off-axis quantitative phase imaging include fast acquisition rate, great temporal stability, and high spatial phase sensitivity. However, the accuracy of a measured volume is limited by the different noises of measurement system and finite bandpass filter applied in the phase-extraction algorithm. To improve the accuracy of the volume measurement, it has been recommended to apply an appropriate bandpass filter in the procedure of phase retrieval. An optimum size of bandpass filter can provide better accuracy by passing sample phase information and blocking unwanted noises. The present study introduce a smart method which can provide optimum bandpass filter for each object so that the accuracy of phase volume measurement increases as much as possible. Different type of windows is studied in the phase retrieval procedure and by comparing the results, the Gaussian window function is suggested to be utilized in the smart algorithm. Finally, the feasibility of the method is proved by applying the smart algorithm on our previous experiment results related to quantitative phase imaging on a bead, an optical fiber, and a spherical mirror. The results obtained by the smart algorithm method are in good agreement with the optimum filter obtained by testing different filter sizes.