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

Status
Not open for further replies.

noonie

Newbie level 3
Joined
Dec 20, 2012
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,298
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 a moderator:

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.
 
Reactions: noonie

    noonie

    Points: 2
    Helpful Answer Positive Rating
here is the code I need to make fir before downsampling :

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

z = fft;
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)
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…