176k views
2 votes
Design a 3-tap FIR lowpass filter with a cutoff frequency of 1,500 Hz and a sampling rate of 8,000 Hz using a (a) Rectangular window function and (b) Hamming window function , Plot the magnitude and phase frequency responses for 0 ≤ Ω ≤ π using MATLAB functions.

User Lidi Zheng
by
7.7k points

1 Answer

0 votes

Final answer:

To design a 3-tap FIR lowpass filter with a cutoff frequency of 1,500 Hz and a sampling rate of 8,000 Hz, you can use either a rectangular or Hamming window function in MATLAB.

Step-by-step explanation:

To design a 3-tap FIR lowpass filter with a cutoff frequency of 1,500 Hz and a sampling rate of 8,000 Hz using a rectangular window function, you can use the following steps:

  1. Calculate the normalized cutoff frequency by dividing the cutoff frequency by half the sampling rate.
  2. Determine the filter coefficients by using the formula: h[n] = (2 * fc / π) * sin(2πfc * n) / (2πfc * n), where fc is the normalized cutoff frequency and n is the tap index.
  3. Normalize the filter coefficients by dividing each coefficient by the sum of all coefficients.
  4. Use the 'freqz' function in MATLAB to obtain the magnitude and phase frequency responses of the filter.

Similarly, for a Hamming window function, use the same steps but instead of the rectangular window function, use the formula for Hamming window coefficients: w[n] = 0.54 - 0.46 * cos(2πn / (N - 1)), where N is the number of taps and n is the tap index.

User Rob Deary
by
7.5k points