Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

function Grab_datos(p)

% Record your voice for 5 seconds.


recObj = audiorecorder(44100, 8, 1);
%recorder = audiorecorder(Fs,nBits,nChannels)
get(recObj)

disp('EMPEZANDO LA GRABACION')
recordblocking(recObj, 5);
%recordblocking(recorderObj, length)
disp('FIN DE LA GRABACION.');

% Play back the recording.


play(recObj);

% Store data in double-precision array.


myRecording = getaudiodata(recObj);

% Plot the waveform.


plot(myRecording);

wavwrite(myRecording,44100,'pz.wav')
length(myRecording)
plot(myRecording)

wavplay(myRecording,44100)

w=wavread('pz.wav');
l=length(w);

Fs = 44100; % Sampling frequency


T = 1/Fs; % Sample time
L = l; % Length of signal
t = (0:L-1)*T; % Time vector
y = 0.7*sin(2*pi*15000*t);
y=y';
data=w+y;
figure(2),plot(t,data)
wavplay(data,44100)

You might also like