We propose and experimentally demonstrate an all-fiber-based approach to generate microwave signals with tunable frequency and pulse width. The adjustable optical power spectrum can be achieved using a spectrum shaper, consisting of a variable differential-group-delay element and a bandwidth-tunable optical filter. Through the frequency-to-time conversion in the dispersive fiber, the frequency and pulse width of the obtained microwave signals can be user defined by modifying the optical spectrum shape.