applies pitch shifting to audio by the ratio r, shifting every frequency to .
Details and Options
- AudioPitchShift shifts the pitch of the input audio signal without affecting the duration.
- The frequency ratio r can be given as a pitch interval, including:
Quantity[oct,"octaves"] correspond to Quantity[sem,"semitones"] correspond to
- AudioPitchShift takes a PartitionGranularity option that controls the partitioning of audio, used for the computation of the short-time Fourier transform.
- By default, a phase vocoder algorithm is used. Select Method->"Speech" to use an algorithm tailored for speech signals. In this case, while the fundamental frequency is changed, the formants of the signal are not modified.
Examplesopen allclose all
A shift by n octaves corresponds to a frequency ratio of 2n:
A shift by s semitones corresponds to a frequency ratio of 2s/12:
AudioPitchShift can be used to change the pitch of a harmonically complex sound without altering its timbre and timing:
The frequency ratio between the components of the audio signal is not changed:
Use Method->"Speech" for speech signals to shift the pitch while maintaining other voice characteristics:
Compare with the normal pitch shifting, which dramatically affects the timbre of the voice:
Using a bigger partition size will improve the frequency response but will smear the transient components:
Using a small offset value will in general increase the quality of the result at the cost of more computation time:
If only the partition size is specified, the offset is calculated as 25% of the partition size.
Use a different window shape to change the quality of the result:
By default, HannWindow is used.
Shift the pitch of an audio object to match a target frequency:
Extract the mean frequency with AudioLocalMeasurements:
Properties & Relations (2)
AudioPitchShift and AudioFrequencyShift modify the spectrum of the signal in different ways:
AudioPitchShift shifts each frequency f in the signal by an amount proportional to the frequency itself (f'=f×shift), thus preserving the timbre in the shifted signal:
AudioFrequencyShift shifts every frequency f by the same amount (f'=f+shift), changing dramatically the timbre in the shifted signal:
Change the pitch of a recording by using a different sample rate:
AudioPitchShift changes the pitch without altering the timing:
Possible Issues (2)
The quality of the result degrades with large shift parameters:
Using Method->"Speech" for non-speech signals may not sound as expected:
Wolfram Research (2016), AudioPitchShift, Wolfram Language function, https://reference.wolfram.com/language/ref/AudioPitchShift.html (updated 2020).
Wolfram Language. 2016. "AudioPitchShift." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/AudioPitchShift.html.
Wolfram Language. (2016). AudioPitchShift. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/AudioPitchShift.html