An Efficient and Flexible Window Function for Memristor Model and its Analog Circuit Application