Matlab help on audio processing

Discussion in 'Programmer's Corner' started by jeffcech, Sep 2, 2009.

  1. jeffcech

    Thread Starter New Member

    Sep 2, 2009
    1
    0
    Hello everyone,

    I need to calculate the number of spectral coefficients in an audio frame in matlab.

    I only know that FrameSize = 144 * BitRate / (SampleRate + Padding).

    But how do i look into individual frames and start counting?
     
  2. kaankarabulut

    New Member

    Oct 3, 2009
    3
    0
    are you looking like that?
    fft and filtering



    clc
    clear all

    [x,Fs] = wavread( 'data1.wav' );

    [b,a] = butter(13,2*[200 2000]/Fs,'bandpass');
    figure, freqz(b,a,128,Fs)
    y=filter(b,a,x) ;

    Y1 = fft(x);
    Pyy1 = abs(Y1)/length(Y1) ;
    f1 = Fs * (0:length(Y1)/2) / length(Y1) ;
    lf1 = length(f1);

    Y2 = fft(y);
    Pyy2 = abs(Y2)/length(Y2) ;
    f2 = Fs * (0:length(Y2)/2) / length(Y2) ;
    lf2 = length(f2);

    figure,subplot(221)
    plot(x)
    title('Original voice signal')
    xlabel('time domain')
    subplot(223)
    plot(f1,Pyy1(1:lf1))
    axis([0 5000 0 0.002])
    title('Original voice signal')
    xlabel('frequency Hz.')
    subplot(222)
    plot(y)
    title('after window voice signal')
    xlabel('time domain')
    subplot(224)
    plot(f2,Pyy2(1:lf2))
    axis([0 3000 0 0.002])
    title('after window voice signal')
    xlabel('frequency Hz.')
    wavwrite(y,'datakaanafter.wav')
     
Loading...