A sample is any use of someone else’s music in your new track, and this applies to both parts of a piece of music: 
 
  1.  The recording (master) using any portion of the original audio 
 
  2.  The composition using recognisable elements of the song itself (melody, lyrics, chords, hook, riff, etc.) 
 
This means: 
 
  *   Even if you don’t use the original audio (for example, you resing or replay the part), you may still be sampling the composition. 
 
  *   Even very small, distorted, spedup, chopped, or heavily processed audio can still be a sample of the recording if it is recognisable.  
 
  *   If the musical idea is clearly derived from an existing song, it counts as a use of the composition, even if you recreated it yourself. 
 
Writers often assume they’re “safe” if they rerecord a vocal or replay a melody but if the underlying composition is still recognisable, it is still a sample, and permission is required. 
There is also a prevalent myth that a snippet of less than a few seconds is “safe” to sample or copy, but in fact using the tiniest snatch (such as, say, a Michael Jackson “whoop”) would put you in breach of copyright.