+ Post New Thread
Results 1 to 3 of 3
  1. #1
    Newbie level 3
    Points: 24, Level: 1

    Join Date
    Dec 2012
    Posts
    3
    Helped
    0 / 0
    Points
    24
    Level
    1

    Urgent ... Sample rate conversion of wav file in MATLAB

    I need help in my project. it's about sample rate conversion in matlab for a wav file I've done a few steps and I need someone to help me with the rest.


    >> [y,Fs]=wavread(' .wav')
    >>sound[y,Fs]
    then I need to write the instruction z=2y then sound(z,Fs) but it gives me error !!
    Last edited by keith1200rs; 22nd December 2012 at 08:27. Reason: Remove SHOUTING

    •   AltAdvertisment

        
       

  2. #2
    Full Member level 5
    Points: 1,771, Level: 9

    Join Date
    Jul 2012
    Posts
    281
    Helped
    48 / 48
    Points
    1,771
    Level
    9

    Re: Urgent ... Sample rate conversion of wav file in MATLAB

    What does it mean - z = 2y ?
    To multiply use * symbol.
    For upsample or downsample use 'upsample' or 'downsample' commands.
    Or design an interpolation or decimation FIR or CIC filter.


    1 members found this post helpful.

    •   AltAdvertisment

        
       

  3. #3
    Newbie level 3
    Points: 24, Level: 1

    Join Date
    Dec 2012
    Posts
    3
    Helped
    0 / 0
    Points
    24
    Level
    1

    Re: Urgent ... Sample rate conversion of wav file in MATLAB

    here is the code I need to make fir before downsampling :

    [y,fs]=wavread('D:\Downloads\Music.wav');
    t = (0:length(y)-1)/ fs;
    subplot(3,2,1);
    plot(t,y)

    z = fft(y);
    k = abs(z);
    f = [ 0 : length(k)-1 ] * fs;
    subplot(3,2,2);
    plot(f,k)


    a=upsample(y,2);
    t=(0: length(a)-1)/fs;
    subplot(3,2,3);
    plot(a,t)
    d=fft(a);
    m=abs(d);
    f=(0:length(m)-1)*fs;
    subplot(3,2,4)
    plot(f,m)



--[[ ]]--