diff --git a/carrier22.wav b/carrier22.wav new file mode 100644 index 0000000..8b2526c Binary files /dev/null and b/carrier22.wav differ diff --git a/vocodedsound.wav b/vocodedsound.wav new file mode 100644 index 0000000..fd619ff Binary files /dev/null and b/vocodedsound.wav differ diff --git a/vocoder.m b/vocoder.m index b499136..fd95670 100644 --- a/vocoder.m +++ b/vocoder.m @@ -1 +1,27 @@ -pkg load signal \ No newline at end of file +pkg load signal + +modfile = 'modulator22.wav'; +carfile = 'carrier22.wav'; +outfile = "vocodedsound.wav"; +[modul, sr1] = audioread(modfile); +[carrier, sr2] = audioread(carfile); +[outfile, sr3] = audioread(outfile); +if sr1~=sr2, disp('your sampling rates dont match'); end +y = chanvocoder(carrier, modul, 512, 16, .2); +audiowrite(outfile,y,sr1) +tmod=0:1/sr1:length(modul)/sr1-1/sr1; +tcarrier=0:1/sr2:length(carrier)/sr2-1/sr2; +tout=0:1/sr3:length(outfile)/sr3-1/sr3; + + +plot(tmod,modul); +xlabel("time(s)"); +ylabel('amplitude modul (norm. unit)'); +subplot(3,1,2); +plot(tcarrier,carrier); +xlabel("time(s)"); +ylabel('amplitude carrier (norm. unit)'); +subplot(3,2,3); +plot (tout,outfile); +xlabel("time(s)"); +ylabel('amplitude outfile (norm. unit)'); \ No newline at end of file diff --git a/white.wav b/white.wav new file mode 100644 index 0000000..98c77ea Binary files /dev/null and b/white.wav differ diff --git a/white_periodic.wav b/white_periodic.wav new file mode 100644 index 0000000..f24def4 Binary files /dev/null and b/white_periodic.wav differ