For CIC filter is Feedback or Feedforward integrator preferred?

2 Ansichten (letzte 30 Tage)
Vasant
Vasant am 10 Okt. 2024
Beantwortet: Umar am 11 Okt. 2024
I have been designing a CIC filter in python. For reference I had taken the matlab cic function dsp.CICDecimator to check if the filter I am designing is functioning properly.
My doubt is according to the Matlab documentation, the delay was kept in the feedforward, while in all other resources and websites, the delay was kept in the feedback path. Which is preferred, any insight? Which one to follow while designing a cic filter.
Initially we designed the filter with the delay in the feedback path, which was not matching with the Matlab output for certain stages and inputs. Now, when we changed the equation according to the Matlab documentation figure, we got the same output of the Python code for all stages, the same as that of the Matlab function output.
The figure in most resources is like this. With the integrator unit delay in the feedback path.
According to this the integrator equation will be:
I[n] = I[n-1] + x[n]
The figure of the matlab CICDecimator function. Here the unit delay is in the feedforward path.
Hence, the equation is modified as:
I[n] = I[n-1] + x[n-1]

Akzeptierte Antwort

Umar
Umar am 11 Okt. 2024

Hi @Vasant,

After going through your comments, it is quite frustrating to say that design of a CIC filter is a nuanced topic, particularly when it comes to the placement of delays in the filter structure. So, it is my understanding that the confusion arises from different representations of the filter in various resources, which can lead to significant differences in output if not handled correctly. I did review your blog post and mathworks function shared by you in your comments, and if I would to describe fundamental operation of a CIC filter, it will be:

Integrators: These accumulate the input signal over time.

Combs: These subtract delayed versions of the signal to achieve the desired frequency response.

Let me address your query regarding the placement of the unit delay which can significantly affect the output of the filter. In the context of CIC filters, the two configurations can be summarized as mentioned by you:

Feedback Delay: The integrator equation is represented as: [ I[n] = I[n-1] + x[n] ]. Here, the current input (x[n]) is added to the previous output (I[n-1]). This configuration is common in many resources and can lead to a straightforward implementation.

Feedforward Delay: The integrator equation is modified to: [ I[n] = I[n-1] + x[n-1] ]. In this case, the previous input (x[n-1]) is used, which aligns with the MATLAB implementation. This approach can be more aligned with the theoretical underpinnings of the CIC filter design.

So, why the discrepancy?

The discrepancy you observed between your Python implementation and MATLAB's output can be attributed to the difference in delay placement. When you initially implemented the feedback delay, the output did not match MATLAB's because the two configurations fundamentally alter the filter's response.

You mentioned, which one to follow?

The choice between using a feedback or feedforward delay ultimately depends on the specific requirements of your application and the conventions you choose to follow. However, here are some of my logical considerations:

Consistency with Established Standards: If you are working in an environment where MATLAB's dsp.CICDecimator is the standard, it is advisable to follow the feedforward delay approach. This ensures compatibility and consistency with existing MATLAB-based designs.

Performance and Stability: The feedforward configuration may offer better numerical stability in certain scenarios, especially when dealing with high-order filters or large input signals.

Implementation Complexity: Depending on your programming environment, one configuration may be easier to implement than the other. If you find that the feedforward approach aligns better with your existing codebase, it may be prudent to adopt it.

So, in nutshell, while both configurations can be valid, the feedforward delay placement as per MATLAB's documentation is recommended for consistency and reliability. It is essential to ensure that your implementation aligns with the theoretical framework of the CIC filter to achieve the desired performance. By adopting the feedforward delay, you can ensure that your Python implementation matches MATLAB's output, thereby validating your design choices.

Hope this helps.

Weitere Antworten (0)

Kategorien

Mehr zu Fixed-Point Overview finden Sie in Help Center und File Exchange

Produkte


Version

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by