Digital phase-sensitive detector (PSD) as accumulator-sampler and its implementation in FPGA