SignalLab2/vocoder.m

17 lines
488 B
Matlab

pkg load signal
modfile = 'modulator22.wav';
carfile = 'white_periodic.wav';
outfile = 'vocodedsound.wav'
[modul, sr1] = audioread(modfile);
[carrier, sr2] = audioread(carfile);
if sr1~=sr2, disp('your sampling rates dont match'); end
% the chanvovoder function isn't availiable on Octave and i am not able to find an equivalent function
y = chanvocoder(carrier, modul, 512, 16, .2);
audiowrite(y,sr1,16,outfile)
subplot()
%% on the same figure temporal variation, carrier and output