# Need to design LPF in Matlab using Butter

1. ## matlab butter

I am trying to design a low pass filter using butter filter in matlab I am confussed how to od this. If my carrier Fc is 20000,( but can be changed if needed) and Fs is 44100 (MP3 file) what do I put in the matlab function below? Please help me I can not get htis please??
I need to filter: outfm = Ac * cos(wc.*t + 2 * pi * kf * cumsum(snd));
Fc=20000
Fs=44100

[N, Wn] = BUTTORD(Wp, Ws, Rp, Rs)

loses no more than Rp dB in
the passband and has at least Rs dB of attenuation in the stopband.
Wp and Ws are the passband and stopband edge frequencies, normalized
from 0 to 1 (where 1 corresponds to pi radians/sample).

•

2. ## butter matlab

Try to use fdatool, just type fdatool on Matlab and it will give you a GUI of a filter design...it really help coz it also displays the different responses of the filter you just designed

•

3. ## matlab lpf

try this
[N, Wn] = BUTTORD(Fc/Fs, Fstop/Fs, Rp, Rs)

•

4. ## lpf matlab

Originally Posted by locchamp
I am trying to design a low pass filter using butter filter in matlab I am confussed how to od this. If my carrier Fc is 20000,( but can be changed if needed) and Fs is 44100 (MP3 file) what do I put in the matlab function below? Please help me I can not get htis please??
I need to filter: outfm = Ac * cos(wc.*t + 2 * pi * kf * cumsum(snd));
Fc=20000
Fs=44100
Try this, if you didn't get result up to now:

Fc=20000;
Fs=44100;
Fstop=21500; % stopband frequency
Rp = 0.1; % 0.1 dB loss in passband
Rs = 40; % 40 dB attenuation in stopband
[N, Wn] = buttord(Fc/(Fs/2), Fstop/(Fs/2), Rp, Rs);
[B,A] = butter(N,Wn);

--[[ ]]--