last settings

This commit is contained in:
Gabri6 2023-04-02 13:53:26 +02:00
parent 5a5fdef3c9
commit 02d3f0a993
1 changed files with 19 additions and 18 deletions

View File

@ -20,38 +20,39 @@ if sr1~=sr2, disp('your sampling rates dont match'); end
y = chanvocoder(carrier, modul, 512, 16, .2); y = chanvocoder(carrier, modul, 512, 16, .2);
audiowrite(outfile, y, sr1); audiowrite(outfile, y, sr1);
%figure; figure;
%subplot(3,1,1); subplot(3,1,1);
%t=[1:1:size(modul,1)]; t=[1:1:size(modul,1)];
%plot(t,modul); plot(t,modul);
%xlabel('Time (s)'); xlabel('Time (s)');
%ylabel("Modulator's Amplitude (a.u.)"); ylabel("Modulator's Amplitude (a.u.)");
%subplot(3,1,2); subplot(3,1,2);
%t=[1:1:size(carrier,1)]; t=[1:1:size(carrier,1)];
%plot(t,carrier); plot(t,carrier);
%xlabel('Time (s)'); xlabel('Time (s)');
%ylabel("Carrier's Amplitude (a.u.)"); ylabel("Carrier's Amplitude (a.u.)");
%subplot(3,1,3); subplot(3,1,3);
%[y fs]=audioread(outfile); [y fs]=audioread(outfile);
%t=[1:1:size(y,1)]; t=[1:1:size(y,1)];
%plot(t,y); plot(t,y);
%xlabel('Time (s)'); xlabel('Time (s)');
%ylabel("Outfile's Amplitude (a.u.)"); ylabel("Outfile's Amplitude (a.u.)");
recorded_signal=record(size(carrier,1)/sr2, sr1); recorded_signal=record(size(carrier,1)/sr2, sr1);
audiowrite("recorded_signal.wav", recorded_signal, sr1); audiowrite("recorded_signal.wav", recorded_signal, sr1);
modfile = "recorded_signal.wav"; modfile = "recorded_signal.wav";
carfile = 'white_periodic.wav'; carfile = 'white_periodic.wav';
outfile = 'recorded_coded_sound.wav'; outfile = 'recorded_coded_sound.wav';
[modul, sr1] = audioread(modfile); [modul, sr1] = audioread(modfile);
[carrier, sr2] = audioread(carfile); [carrier, sr2] = audioread(carfile);
if sr1~=sr2, disp('your sampling rates dont match'); end if sr1~=sr2, disp('your sampling rates dont match'); end
y = chanvocoder(carrier, modul, 512, 16, .2); y = chanvocoder(carrier/4, modul, 512, 16, .2);
audiowrite(outfile, y, sr1); audiowrite(outfile, y, sr1);