+ Post New Thread
Results 1 to 4 of 4
  1. #1
    Newbie level 6
    Points: 907, Level: 6

    Join Date
    Apr 2008
    Posts
    14
    Helped
    0 / 0
    Points
    907
    Level
    6

    recording matlab

    Hi,

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

    regards

    •   Alt28th May 2008, 15:13

      advertising

        
       

  2. #2
    Advanced Member level 5
    Points: 40,208, Level: 49

    Join Date
    Apr 2002
    Location
    USA
    Posts
    3,944
    Helped
    649 / 649
    Points
    40,208
    Level
    49

    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


    2 members found this post helpful.

    •   Alt28th May 2008, 15:27

      advertising

        
       

  3. #3
    Advanced Member level 1
    Points: 4,634, Level: 16
    xulfee's Avatar
    Join Date
    May 2008
    Location
    Pakistan
    Posts
    403
    Helped
    51 / 51
    Points
    4,634
    Level
    16

    matlab record

    check help about waveread n waverecord in matlab


    1 members found this post helpful.

    •   Alt19th June 2008, 12:52

      advertising

        
       

  4. #4
    Newbie level 3
    Points: 389, Level: 4

    Join Date
    Jan 2012
    Posts
    4
    Helped
    1 / 1
    Points
    389
    Level
    4

    Re: voice record by matlab

    hi,I have a code, may be useful for you
    here is the code:

    fs=40000;
    y=wavrecord(5*fs,fs);
    plot(y);
    size(y)
    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)


    1 members found this post helpful.

+ Post New Thread
Please login