Compare commits

...

5 Commits

Author SHA1 Message Date
Gabri6 02d3f0a993 last settings 2023-04-02 13:53:26 +02:00
Gabri6 5a5fdef3c9 record mic and use chanvocode on it with white sound 2023-03-30 17:52:51 +02:00
Gabri6 7592194eec temporal curve of each signal displayed 2023-03-30 17:42:29 +02:00
Gabri6 c0cd36be7e added implementation of chanvocoder 2023-03-30 17:35:27 +02:00
Gabri6 6a10ce4c5b vocoder creation 2023-03-30 17:27:39 +02:00
1 changed files with 58 additions and 0 deletions

58
vocoder.m Normal file
View File

@ -0,0 +1,58 @@
#################
#Created By: Gabriel LUCAS
#Created :28/03/2023 08:27:54
#
#Last modified: 29/03/2023 22:37:32
#
#
#
#
#################
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
y = chanvocoder(carrier, modul, 512, 16, .2);
audiowrite(outfile, y, sr1);
figure;
subplot(3,1,1);
t=[1:1:size(modul,1)];
plot(t,modul);
xlabel('Time (s)');
ylabel("Modulator's Amplitude (a.u.)");
subplot(3,1,2);
t=[1:1:size(carrier,1)];
plot(t,carrier);
xlabel('Time (s)');
ylabel("Carrier's Amplitude (a.u.)");
subplot(3,1,3);
[y fs]=audioread(outfile);
t=[1:1:size(y,1)];
plot(t,y);
xlabel('Time (s)');
ylabel("Outfile's Amplitude (a.u.)");
recorded_signal=record(size(carrier,1)/sr2, sr1);
audiowrite("recorded_signal.wav", recorded_signal, sr1);
modfile = "recorded_signal.wav";
carfile = 'white_periodic.wav';
outfile = 'recorded_coded_sound.wav';
[modul, sr1] = audioread(modfile);
[carrier, sr2] = audioread(carfile);
if sr1~=sr2, disp('your sampling rates dont match'); end
y = chanvocoder(carrier/4, modul, 512, 16, .2);
audiowrite(outfile, y, sr1);