Continue to Site

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

Status
Not open for further replies.

#### noonie

##### Newbie level 3
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 !!

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.

noonie

### noonie

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

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.