A multiscale windowed Fourier transform for phase extraction of fringe patterns is presented. A local stationary length of signal is used to control the window width of a windowed Fourier transform automatically, which is measured by an instantaneous frequency gradient. The instantaneous frequency of the fringe pattern is obtained by detecting the ridge of the wavelet transform. The numerical simulation and experiment have proved the validity of this method. The combination of the windowed Fourier transform and the wavelet transform makes the extracted phase more precise than other methods.