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
    $\begingroup$ Do you have any thoughts on it? $\endgroup$ – Rodrigo de Azevedo May 8 at 8:15
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 :-)

| improve this answer | |
$\endgroup$
  • $\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 May 8 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 May 9 at 11:53
  • $\begingroup$ The main point is that you mentioned: Trade-off. Thanks. $\endgroup$ – Mohammadsadeq Borjiyan Jun 5 at 12:41
1
$\begingroup$
b = fir1(63, 0.25)

figure(1)

freqz(b,1,256)
| improve this answer | |
$\endgroup$
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.

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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