audiovocoder

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Video/Audio/PDF
Introduced first in SolidGeometry 4.9, Creation date: 2020-03-27, Last change: 2025-09-14

changes the pitch of the signal without changing the length

Description

Uses stretchAudio (2019b)
Acc Values > 1 make the voices deeper and slower in same time period

See Also: soundTL , audiorecorderTL , audiotrim

Example Illustration

 missing image of audiovocoder(OSig,acc)

Syntax

[NSig,NSR]=audiovocoder(OSig,[acc])

Input Parameter

OSig: Original signal
acc: pitch; default is 1.03

Output Parameter

NSig: New Signal
NSR: New Sample rate; not used yet

Examples

Compare 3% voice vocoder
y=audiorecorderTL('PRO X',16000,5); % record 5 seconds
soundTL(audiovocoder(y,1),16000,'PRO X'); pause(5); soundTL(audiovocoder(y,1.03),16000,'PRO X')




Copyright 2020-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

This algorithm is designed to change the pitch of an audio signal without altering its length. It is implemented in a MATLAB function called audiovocoder.

Input Parameters

Output Results

Algorithm Steps

  1. The function getfuncparams is used to retrieve the pitch adjustment factor acc from the input parameters, with a default value of 1.03.
  2. The original sample rate OSR and the new sample rate NSR are both set to 44100 Hz.
  3. If the pitch adjustment factor acc is not equal to 1, the function stretchAudio is called to adjust the pitch of the original signal OSig. The method used is "wsola" with a phase lock and a delta of 512.
  4. The stretch factor stch is calculated as the ratio of NSR to OSR.
  5. The inverse of the pitch adjustment factor acc is calculated.
  6. An empty array NSig is initialized to store the new signal. Its size is determined by the adjusted length of the original signal.
  7. A loop iterates over each sample of the new signal NSig:
Algorithm explaination created using ChatGPT on 2025-08-19 06:50. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21