0
$\begingroup$

How to design a ideal lowpass filter by cutoff frequency of π/4 in the form of FIR filter by 64 samples using matlab?

$\endgroup$
1
  • 1
    $\begingroup$ Do you have any thoughts on it? $\endgroup$ Commented May 8, 2020 at 8:15

3 Answers 3

2
$\begingroup$

You don't.

An ideal low pass FIR filter has infinite length so the requirements of "ideal low pass" and "64 taps" are mutually exclusive.

You can approximate an ideal filter, but the best way to do this depends on the specific requirement and trade-offs of your application. This being said, Richard's answer is a really good starting point :-)

$\endgroup$
3
  • $\begingroup$ I have a basic question...is 64 samples 64 taps? and if yes, what is the n in freqz(b,a,n) in matlab function? Will it be 64 here? $\endgroup$
    – DSP Novice
    Commented May 8, 2020 at 16:29
  • $\begingroup$ 64 was my interpretation of the length of the FIR filter. The $n$ in freqz is different: it's the number of frequencies you want to display or calculate. $\endgroup$
    – Hilmar
    Commented May 9, 2020 at 11:53
  • $\begingroup$ The main point is that you mentioned: Trade-off. Thanks. $\endgroup$ Commented Jun 5, 2020 at 12:41
1
$\begingroup$
b = fir1(63, 0.25)

figure(1)

freqz(b,1,256)
$\endgroup$
1
  • $\begingroup$ You're so helpful. Many thanks. $\endgroup$ Commented Jun 5, 2020 at 12:39
0
$\begingroup$

We cannot design an ideal filter! So we should trade off our requirements and approximate the best filter. In this case:

b=firls(63,[0,0.25,0.28,1],[1,1,0,0]);

figure()

freqz(b)

may be an acceptable solution. Also we can use fir1 function instead.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.