In terms of acoustic science, an octave consists of two pitches where one pitch is exactly double the frequency of the other. This refers to the number of vibrations per second that are required to produce the pitches. Pitches in octaves are similar to each other in sound, and there is enough space between octave notes for a wide range of other pitch frequencies. For this reason, the octave is used as a fundamental large-scale unit of pitch in many musical systems, including those for Western music.
Pitches in octaves are given the same letter note names to indicate their similarity. However, they are differentiated from one another in how they are notated on staffed music. They may also be given numbers which correspond to their positions on a piano keyboard; for example, the leftmost "A" on the piano is called "A1," the next "A" is "A2" (and so on). The range of octaves used in Western music is more limited than the number of octaves that are scientifically possible, since this keeps the music in a range that is comfortable for the human ear to hear.
Two notes that are an octave apart are notated on a five-line staff exactly three lines and four spaces apart. This may include the use of leger lines to temporarily extend the staff upwards or downwards. In some cases, composers avoid the use of too many leger lines by writing music an octave above or below the desired pitch, then writing the instruction "8va" to indicate playing the passage an octave up, or "8va basso" to indicate playing the pitch an octave down.
The octave is considered to be the ultimate type of what's known as a "perfect" interval, meaning that it has the most consonant, pleasant and resolved sound possible (with the exception of unison, where two instruments are playing the exact same pitch). Composers use passages of music written in octaves as a way of strengthening the sound of a phrase and tying the activities of different instruments together.
In Western music, the octave outlines the distance between the very bottom and very top of any diatonic scale. The notes of a diatonic scale spell out the eight pitches of a key signature, or the selection of pitches to be used in a piece of music. These pitches are selected from the twelve half steps, or semitones, that are located between two octave notes.