1
$\begingroup$

Consider a system implementing a rational sampling rate change by 5/7: for this, we cascade upsampler by 5, a lowpass filter with cutoff frequency π/7 and a downsampler by 7. The lowpass filter is a 4rd-order Butterworth filter with transfer function

$$H(z) = \frac{b0 + b1z^{-1} + b2z^{-2} + b3z^{-3} + + b4z^{-4}}{1 - a1z^{-1} - a2z^{-2} - a3z^{-3} - a4z^{-4}}$$ Assume that the input works at a rate of 1000 samples per second. What is the number of multiplications per second required by the system? Assume that multiplications by zero do not count.

Since there are 9 filter coefficients and 5000 samples left (after upsampling, filtering, downsampling), 9*5000 = 45000 is my MAC calculation, but that seems to be wrong approach, any other idea to solve this question???

$\endgroup$
1
  • $\begingroup$ hi! Tried to fix your LaTeX code. $\endgroup$ Sep 16, 2020 at 7:06

1 Answer 1

2
$\begingroup$

One potential option would be to split the lowpass filter into the FIR part and the pureley recursive IIR part.

$$H(z) = H_1(z) \cdot H_2(z) = \frac{1}{1 - a1z^{-1} - a2z^{-2} - a3z^{-3} - a4z^{-4}} \cdot \left [ b0 + b1z^{-1} + b2z^{-2} + b3z^{-3} + + b4z^{-4} \right ]$$

You still have to apply the recursive part to each sample in the upsampled domain, but you only need run the FIR when you need an actual output sample. So this could be

$$N = 5000*4 + (5000*5)/7$$

That's not a great idea in terms of stability and noise performance, but would work if you have enough precision and head room.

UPDATE:

There are further ways you could potentially reduce multiplactions. The FIR section of a butterworth can be split into two second order sections which are simply $[1 2 1]$ so you could potentiall write this as

$$H(z) = H_3(z) \cdot H_4(z) \cdot H_4(z) = \frac{b_0}{1 - a1z^{-1} - a2z^{-2} - a3z^{-3} - a4z^{-4}} \cdot \left [ 1 + z^{-1} + z^{-1} + z^{-2} \right ] \cdot \left [ 1 + z^{-1} + z^{-1} + z^{-2} \right ]$$

So in this case it's down to 25000 multiplies per second, although it's not a particularly useful implementation. At the end there are multiple different ways of implementing them and which one is better depends on the properties of the platform.

$\endgroup$
12
  • $\begingroup$ answers coming in decimals can work?? $\endgroup$
    – dsp
    Sep 16, 2020 at 8:28
  • 1
    $\begingroup$ If this is homework, you need to ask your professor. In practice this happens all the time. Most real time processing is done in frames and the frame overhead gets amortized over multiple samples. In today's processor executing the same code twice does NOT take twice as long because of pipelines and cache. Inmany cases managing this properly is more important that looking at the number of multiplications (or adds, or MACs, or butterflies). $\endgroup$
    – Hilmar
    Sep 16, 2020 at 9:05
  • $\begingroup$ Dear Hilmar, can u comment on more problem with same approach...i.e; dsp.stackexchange.com/questions/70300/… $\endgroup$
    – dsp
    Sep 16, 2020 at 9:21
  • $\begingroup$ the answer you are speaking gives N=23571(appx), but it does not seems correct $\endgroup$
    – dsp
    Sep 16, 2020 at 14:26
  • 1
    $\begingroup$ Why does it seem incorrect? Do you have the allegedly correct answer ? $\endgroup$
    – Hilmar
    Sep 16, 2020 at 20:08

Your Answer

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

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