PitchShift<T>

Models & Types · AiDotNet.Augmentation.Audio

Shifts the pitch of audio without changing tempo using WSOLA (Waveform Similarity Overlap-Add).

Inheritance: AugmentationBase<T, Tensor<T>> → AudioAugmenterBase<T> → PitchShift<T>

For Beginners

Pitch shifting makes audio sound higher or lower, like the difference between a high and low voice, while keeping the same duration.

How It Works

Algorithm: Uses WSOLA (Waveform Similarity Overlap-Add) for time-stretching followed by resampling. This preserves audio quality better than simple resampling.

When to use:

  • Speech recognition to handle different voice pitches
  • Music analysis to handle different keys
  • Voice cloning and synthesis training

Semitone reference: 12 semitones = 1 octave (doubling/halving frequency)

Constructors

Constructor Summary
PitchShift(double minSemitones, double maxSemitones, double probability, int sampleRate) Creates a new pitch shift augmentation.

Properties

Property Summary
double MaxSemitones { get; } Gets the maximum pitch shift in semitones.
double MinSemitones { get; } Gets the minimum pitch shift in semitones.

Methods

Method Summary
IDictionary<string, object> GetParameters()