Lowpass FIR filter code.

조회 수: 4 (최근 30일)
olivia
olivia 2012년 2월 4일
편집: Kukuh Priambodo 2016년 12월 3일
Hello
I need to simulate some audio files using lowpass FIR filter (Digital). I have tried doing it using simulink but I need to do it using a code. Can anyone please tell me how to do it? I am facing a problem as I dot know how to incorporate the audio file(.wav). It would be great if anyone could give me some ideas of doing it.
Thank you:)
  댓글 수: 1
Kukuh Priambodo
Kukuh Priambodo 2016년 12월 3일
편집: Kukuh Priambodo 2016년 12월 3일
fs = 10000; [x,fs] = audioread (fname); % input your file :) Wn = .35; N = 57; LP = fir1(N,Wn); [H_x,w]=freqz(LP); len_f=length(H_x); f=1/len_f:1/len_f:1; plot(f,20*log10(abs(H_x))); grid
%thanks

댓글을 달려면 로그인하십시오.

답변 (1개)

Jan
Jan 2012년 2월 4일
Perhaps this helps:
[Signal, Fs] = wavread(filename);
[B, A] = butter(4, (2 / Fs) * 500, 'low');
Filtered = filter(B, A, Signal);
  댓글 수: 2
olivia
olivia 2012년 2월 4일
Thank you very much for the help but this is a butterworth filter which is not an FIR filter. I need to use a digital FIR filter. It would be very helpful if you have any idea about it.
Thanks
Jan
Jan 2012년 2월 5일
How are the parameters of the FIR filter defined?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Digital Filter Analysis에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by