The analysis of the voltage fluctuation and flicker is important to inhibit flicker. Mathematical morphology filter testing methods are proposed in this paper on the basis of Hilbert transform. Using Hilbert transform to extract flicker envelope, and the mathematical morphological filtering method is used to filter out high frequency noise of the grid. Simulation results show that this method can realize flicker signal detection, determine spectrum of flicker signal through mathematical morphology filtering method, and the measurement precision compared with spectrum amplitude of the signal with noise have larger increase.