voice record by matlab

Status
Not open for further replies.

FERMED

Newbie level 6
Joined
Apr 30, 2008
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,368
recording matlab

Hi,

Please help me to record voice by matlab in real time.

regards
 

voice recording in matlab

I'm not sure what you mean by real time, or where you want to record it, but maybe you can get some ideas from this little audio spectrum analyzer:

Code:
% Audio spectrum display. To exit, close the figure.
%
fs = 22050;                                 % sample rate, hertz
N = 1024;                                   % duration, samples
window = blackman(N);                       % weighting
window = window / mean(window);             % normalize it
gca;                                        % open the figure
while get(0,'CurrentFigure')                % while figure still open
  y = wavrecord(N, fs);                     % acquire some signal
  h = fft(y .* window);                     % transform
  plot(fs*(0:N/2)/N, 20*log10(max(2/N*abs(h(1:N/2+1)), 1e-10)));
  ylim([-160 20]); xlabel('Hertz'); ylabel('dB');
  drawnow;                                  % allow figure to update
end
 
matlab record

check help about waveread n waverecord in matlab
 
hi,I have a code, may be useful for you
here is the code:

fs=40000;
y=wavrecord(5*fs,fs);
plot;
size
z=y(2*fs:3*fs);
size(z)
figure
plot(z)
Z=fft(z);
z2=fftshift(Z);
a=abs(z2);
figure
plot(a);
wavplay(y,fs)
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…