(Finite Impulse Response)FIR filter math by hand example

In summary, to design an FIR filter you need to know the impulse response and the transfer function. You can determine the impulse response by taking the inverse of the transfer function or by sketching the frequency response in the frequency domain and doing the inverse FFT.
  • #1
btb4198
572
10
can someone do a design of a FIR filter using the Window design method by hand as an example and post it? Please do not use mat lab. I would like to learn how to do it myself by hand. I have been have use Google but no luck .

all the pages I have seen use mat lab in their example.

So I have been reading up on FIR filters and I have learned they can be in the Time domain or the frequency domain. in the Time domain you take the input signal of discrete samples x[n] and its impulse response b and you use convolving to get the output y[n]. this will Zero out any unwanted frequencies. so you can do a band pass or a low pass or a high pass filter.
N
y[n] = Ʃ bi x[N-i]
i = 0
Now I do not really know how to solve the impulse response h[n].
now Wiki says, " h[n] can be calculated if we set x[n] = δ[n] in the above relation, where δ[n] is the Kronecker delta impulse. The impulse response for an FIR filter then becomes the set of coefficients bn, as follows :

N
h[n] = Ʃ bi δ[n-i] = bn
i = 0
for n =0 to N
"
so I am not sure where h[n] come in at in that 1 formula ... I think h[n] is an array of bns.. i guess

or a set of bn .
like h[n] = { b1, b2, b3, b4,bi, ..}
that might be wrong...

"To design a filter means to select the coefficients such that the system has specific characteristics." wiki

"In signal processing, a window function (also known as an apodization function or tapering function[1]) is a mathematical function that is zero-valued outside of some chosen interval." wiki

but from this I still do not know how to get the right coefficients bn.

I know that
ω = 2π F/fs
Δω = 2π TW/Fs
Tw = transition width with "is a range of frequencies, that allows a transition between a passband and a stopband of a signal processing filter. The transition band is defined by a passband and a stopband cutoff frequency or corner frequency." wiki

stopband ripple = -20log10 δ

after this I get really lost...

I do get how convolve works,
http://www.eas.uccs.edu/wickert/ece2610/lecture_notes/ece2610_chap5.pdf
page 12 has a good example...
you would use convolving on h[n] and x[n] right?
but I am not sure how to get h[n]

so can someone workout an example by hand to help feel in the blanks
thanks

also if I have said something wrong in his post please tell me
thanks
 
Engineering news on Phys.org
  • #2
anyone ?
 
  • #3
First:
An FIR filter is a generally implemented as a set of coefficients to be convolved with the signal (in the time domain)

In the frequency domain it is the multiplication of the frequency response and the signal spectrum.

No impulses involved at this point.

The coefficients used in the time domain are the inverse transform of the frequency response of the filter. That happens to be the impulse response of the filter.

The impulse response of the filter is the set of coeefficients that represents your filter in the time domain, and its FFT of the impulse response is the frequency response of the filter (I've said it twice now).

Multiplication in the frequency domain is convolution in the time domain, and vice versa.

So the next question becomes how to determine the impulse response of a filter. First you need its transfer function. That is its impulse response. Now it get tricky and you need s domain or z domain knowledge.

Or, you could simply sketch the frequency response in the frequency domain and do the inverse FFT.
 

1. What is a Finite Impulse Response (FIR) filter?

A Finite Impulse Response (FIR) filter is a type of digital filter commonly used in signal processing. It is a mathematical algorithm that is used to process digital signals by convolving an input signal with a finite number of coefficients. FIR filters are often used for tasks such as noise reduction, smoothing, and frequency separation.

2. How does a FIR filter work?

A FIR filter works by convolving an input signal with a finite number of coefficients, also known as the filter's impulse response. This process creates an output signal that is a weighted sum of the input signal's past and present values. The coefficients are determined based on the desired filtering characteristics, such as the cutoff frequency or filter order.

3. Can you provide an example of how to calculate a FIR filter by hand?

Yes, let's say we have an input signal x(n) = [1, 3, 5, 7, 9] and a filter with coefficients h(n) = [1, 2, 3]. The output signal y(n) can be calculated by y(n) = x(n)*h(n), where * represents convolution. So, y(0) = 1*1 = 1, y(1) = 1*2 + 3*1 = 5, y(2) = 1*3 + 3*2 + 5*1 = 14, y(3) = 1*3 + 3*3 + 5*2 + 7*1 = 32, y(4) = 1*3 + 3*5 + 5*3 + 7*2 + 9*1 = 54. Therefore, the output signal y(n) = [1, 5, 14, 32, 54].

4. What are the advantages of using a FIR filter?

There are several advantages of using a FIR filter, including:

  • Stable and linear phase response: FIR filters have a constant phase response across all frequencies, making them suitable for applications that require a linear phase.
  • Easy to design: Unlike other types of filters, FIR filters can be designed to have any desired frequency response by simply adjusting the filter coefficients.
  • No feedback loop: Since FIR filters do not use feedback, they are inherently stable and do not suffer from stability issues.
  • Good stopband attenuation: FIR filters have good stopband attenuation, meaning they can effectively suppress frequencies outside of the desired passband.

5. Is it necessary to calculate a FIR filter by hand, or are there other methods available?

While it is possible to calculate a FIR filter by hand, it can be a time-consuming and tedious process. Luckily, there are many software tools available that can generate FIR filter coefficients based on desired specifications. These tools use various mathematical algorithms and optimization methods to design filters that meet the desired frequency response. These tools also allow for easier implementation and testing of the filter compared to calculating it by hand.

Similar threads

  • Electrical Engineering
Replies
9
Views
2K
  • Electrical Engineering
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
1
Views
959
Replies
7
Views
3K
  • Electrical Engineering
Replies
2
Views
3K
  • Electrical Engineering
Replies
1
Views
2K
Replies
9
Views
3K
  • Electrical Engineering
Replies
1
Views
2K
  • Electrical Engineering
Replies
1
Views
930
Back
Top