0
$\begingroup$

I'm trying to solve a problem about filter design. We want to design a equalizer filter which have the following frequency response :enter image description here

How can i get the difference equation from the impulse responce which is defined by:

$$ \frac{2 f_1}{F_s} \left ( {\rm sinc}(2 \pi f_1 n T_s) (g_1-g_2) \right )+ \frac{2 f_2}{F_s} \left ( {\rm sinc}(2 \pi f_2 n T_s) (g_2-g_3) \right )+ \frac{2}{F_s} \left ( f_3 g_3 {\rm sinc}(2 \pi f_3 n T_s)-f_0\cdot g_1 {\rm sinc}(2 \pi f_0 n T_s)\right ) $$

$\endgroup$
2
  • 1
    $\begingroup$ Your sinc() impulse response is missing a window function to truncate its length. Otherwise it will be of infinite length; the difference equation will be impractical; ie. infinite order. For infinitely long impulse reponses (IIR), only recursive finite-order difference equations can be practically computed. $\endgroup$
    – Fat32
    Nov 12 '21 at 21:54
  • $\begingroup$ What should I do in order to get a finite length ? I will multiply this h(n) by w(n) ? After that how can I find the difference equation ? $\endgroup$ Nov 13 '21 at 10:14
1
$\begingroup$

How can i get the difference equation from the impulse response

That's easy enough to do

$$ y[k] = \sum_{n=-\infty}^\infty x[k-n] \cdot \left[ \frac{2 f_1}{F_s} \left ( {\rm sinc}(2 \pi f_1 n T_s) (g_1-g_2) \right )+ \frac{2 f_2}{F_s} \left ( {\rm sinc}(2 \pi f_2 n T_s) (g_2-g_3) \right )+ \frac{2}{F_s} \left ( f_3 g_3 {\rm sinc}(2 \pi f_3 n T_s)-f_0\cdot g_1 {\rm sinc}(2 \pi f_0 n T_s)\right) \right] $$

However, that doesn't help you much since it's an infinite sum that's also non-causal, so you can't implement it.

If you want something practical, you need to deploy any of the standard filter design algorithm for this type of problem (least square IIR or FIR, inverse DFT, windowing, etc.) to approximate the target response. The best method depends a lot on your specific requirements and what type of error you can tolerate.

$\endgroup$
2
  • $\begingroup$ How do you get this difference equation from h[n] ? Can you provide proof please ? $\endgroup$ Nov 13 '21 at 15:00
  • $\begingroup$ The differential equation is arrived at by writing out the convolution of the input signal with the filter's impulse response. The proof is found in any basic text on signal processing -- which, I suggest you get, or if you're taking a class, re-read that part of your textbook. $\endgroup$
    – TimWescott
    Nov 13 '21 at 22:10

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.