In music, an ostinato is a short pattern of notes which is repeated several times throughout a song or piece of music. The word "ostinato" is related to the word obstinate. It is like a musical idea which is being obstinate and will not go away. The plural can be either "ostinati" or "ostinatos".
An ostinato can last for a section of a piece or it might last for the whole piece of music.
A ground bass, or basso ostinato, is an ostinato pattern in the lowest notes, which keeps playing while the melodies in the higher notes change. This was often used in baroque musical works. An example is the famous Canon in D by Pachelbel.
An example of a rhythmic ostinato is the first movement from the Planets Suite by Gustav Holst. This is the movement in 5/4 time which describes Mars. Boléro by Maurice Ravel also uses a repeated rhythm all the way through the piece.