A low pass filter - matlab

Status
Not open for further replies.

microelectronics

Member level 1
Joined
Aug 6, 2009
Messages
39
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
johor
Activity points
1,657
Hey guys , help me to check this code.. i cant figure out how to make it run .. T.T
Its just to filter out some high frequency in the song file i cut ..

function filter_a()
[song,fs] = wavread('cut2');
N = length(song); %length of song is 99093
k=[0:N-1];
f1=k*fs/N;
cf = 2000 ;
n = [0:997];
t = n/cf;
N = length(t);
f = n*cf/N;
hf = [ones(1,499) zeros(1,497)];
cutfft = fft(song);
cutfft2 = abs(cutfft);
filtered = cutfft2; %.* hf;
invert = real(ifft( filtered ));
plot(f,invert)
wavplay(song,fs);


am i doing it wrongly? pls correct me
 

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