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

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.

>>sound[y,Fs]
then I need to write the instruction z=2y then sound(z,Fs) but it gives me error !!

•

2. ## 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.

•

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

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

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)

--[[ ]]--