Self-phase modulation and frequency generation with few-cycle optical pulses in nonlinear dispersive media