Real-time signal processing techniques and hardware implementation for optical metrology