how to use audiowrite
clear; clc; close all;
data= load(‘am_data.mat’);
d=data.d’;
%
ds = d(16000+1:16000+2560);
%
Ds = fftshift(fft(ds));
%
f = ((-2560/2) : (2560/2 – 1)) * 0.100;
plot(f,abs(Ds));
%
T=1/256000;
t=(1:length(d))*T;
fc=-17000;
%
dm=d.*(exp(-1i*2*pi*t*fc))’;
%
Dm=fftshift(fft(dm(16000+1:16000+2560)));
%
figure();
plot(f,abs(Dm));
%
th = (-100:100)*T;
h = sin(10000*pi*th + 1e-6)./(10000*pi*th+1e-6);
%
figure()
plot(th,h);
%
dmf = conv(dm,h);
%
Dmf = fftshift(fft(dmf(16000+1:16000+2560)));
figure()
plot(f,abs(Dmf));
%
dmfs = dmf(1:32:end)/max(abs(dmf));
sound(real(dmfs));
pause;
%
sound(abs(dmfs));
%
audiowrite(‘test.wav’,dmfs,256000);clear; clc; close all;
data= load(‘am_data.mat’);
d=data.d’;
%
ds = d(16000+1:16000+2560);
%
Ds = fftshift(fft(ds));
%
f = ((-2560/2) : (2560/2 – 1)) * 0.100;
plot(f,abs(Ds));
%
T=1/256000;
t=(1:length(d))*T;
fc=-17000;
%
dm=d.*(exp(-1i*2*pi*t*fc))’;
%
Dm=fftshift(fft(dm(16000+1:16000+2560)));
%
figure();
plot(f,abs(Dm));
%
th = (-100:100)*T;
h = sin(10000*pi*th + 1e-6)./(10000*pi*th+1e-6);
%
figure()
plot(th,h);
%
dmf = conv(dm,h);
%
Dmf = fftshift(fft(dmf(16000+1:16000+2560)));
figure()
plot(f,abs(Dmf));
%
dmfs = dmf(1:32:end)/max(abs(dmf));
sound(real(dmfs));
pause;
%
sound(abs(dmfs));
%
audiowrite(‘test.wav’,dmfs,256000); clear; clc; close all;
data= load(‘am_data.mat’);
d=data.d’;
%
ds = d(16000+1:16000+2560);
%
Ds = fftshift(fft(ds));
%
f = ((-2560/2) : (2560/2 – 1)) * 0.100;
plot(f,abs(Ds));
%
T=1/256000;
t=(1:length(d))*T;
fc=-17000;
%
dm=d.*(exp(-1i*2*pi*t*fc))’;
%
Dm=fftshift(fft(dm(16000+1:16000+2560)));
%
figure();
plot(f,abs(Dm));
%
th = (-100:100)*T;
h = sin(10000*pi*th + 1e-6)./(10000*pi*th+1e-6);
%
figure()
plot(th,h);
%
dmf = conv(dm,h);
%
Dmf = fftshift(fft(dmf(16000+1:16000+2560)));
figure()
plot(f,abs(Dmf));
%
dmfs = dmf(1:32:end)/max(abs(dmf));
sound(real(dmfs));
pause;
%
sound(abs(dmfs));
%
audiowrite(‘test.wav’,dmfs,256000); audiowrite, wavfile MATLAB Answers — New Questions