As long as a wave has a definite period, and as long as the polarity keeps switching back and forth between positive and negative, it is ac, no matter how complicated the actual shape of the waveform. Above Figure shows an example of a complex ac wave. There is a definable period, and therefore a definable frequency. The period is the time between two points on succeeding wave repetitions.
With some waves, it can be difficult or almost impossible to ascertain the period. This is because the wave has two or more components that are of nearly the same amplitude. When this happens, the frequency spectrum of the wave is multifaceted. That means the wave energy is split up more or less equally among multiple frequencies.