1. 程式人生 > >【 FPGA 】FIR濾波器之 多個係數集問題以及 使用非整數實數的係數規範問題

【 FPGA 】FIR濾波器之 多個係數集問題以及 使用非整數實數的係數規範問題

多個係數集

對於多係數過濾器,單個.coe檔案用於指定係數集。 每個係數集應附加到前一組係數。

例如,如果設計了一個2係數集,10抽頭對稱濾波器,

係數集#0為:coefdata = -1,-2,-3,4,5,5,4,-3,-2 ,-1;

和係數集#1是:

coefdata = -9,-10,-11,12,13,13,12,-11,-10,-9;

那麼整個過濾器的.coe檔案就是

radix = 10; coefdata = -1,-2,-3,4,5,5,4,-3,-2,-1,-9,-10,-11,12,13,13,12,-11,-10 ,-9;

多組實現中的所有係數集必須表現出相同的對稱性。 例如,如果甚至一組多組具有非對稱係數結構,則使用該結構實現所有組。 所有係數集也必須具有相同的向量長度。 如果一個係數集具有較少的係數,則它必須為零填充 - 在非對稱或前置時附加零,並在對稱時附加相等數量的零。 有關詳細資訊,請參閱“係數填充”部分。

使用非整數實數的係數規範

如前所述,您可以將係數值指定為非整數實數,並將基數設定為10.例如:

基數= 10; coefdata = 0.08659436542927,0.00579513928555,-0.06734424313287,-0.04031582111240;

然後,IP核對係數進行量化,以根據指定的係數位寬生成濾波器中使用的二進位制係數值。 這允許您提供從所選濾波器設計工具派生的浮點值,並通過改變係數位寬並觀察量化頻率響應與理想響應相比的變化來探索效能和資源使用之間的成本和收益。 通過將量化欄位設定為Quantize_Only來選擇基本量化函式。 有關詳細資訊,請參閱係數量化。

可以通過檢查在專案目錄中生成的主核心MIF檔案(<component_name> .mif)來確定過濾器實現中使用的整數值。 MIF檔案始終採用二進位制格式。

下面給出上述內容的英文原版

Multiple Coefficient Sets

For multiple coefficient filters, a single .coe file is used to specify the coefficient sets. Each coefficient set should be appended to the previous set of coefficients.

For example, if a 2-coefficient set, 10-tap symmetric filter was being designed and coefficient set #0 was:  coef data = -1, -2, -3, 4, 5, 5, 4, -3, -2, -1;

and coefficient set #1 was:

coefdata = -9, -10, -11, 12, 13, 13, 12, -11, -10, -9;

then the .coe file for the entire filter would be

radix = 10; coefdata = -1, -2, -3, 4, 5, 5, 4, -3, -2, -1, -9, -10, -11, 12, 13, 13, 12, -11, -10, -9;

All coefficients sets in a multiple set implementation must exhibit the same symmetry. For example, if even one set of a multi-set has non-symmetric coefficient structure, then all sets are implemented using that structure. All coefficient sets must also be of the same vector length. If one coefficient set has fewer coefficients, it must be zero padded – either appended with zeros when non-symmetric or prepended and appended with an equal number of zeros when symmetric. See the Coefficient Padding section for further information.

Coefficient Specification Using Non-integer Real Numbers

As indicated previously, you can specify the coefficient values as non-integer real numbers, with the radix set to 10. For example:

radix = 10; coefdata = 0.08659436542927, 0.00579513928555, -0.06734424313287, -0.04031582111240;

The coefficients are then quantized by the core to produce the binary coefficient values used in the filter, based on your specified coefficient bit width. This allows you to supply floating-point values derived from a chosen filter design tool and explore the costs and benefits between performance and resource usage by altering the coefficient bit width and observing the alteration in the quantified frequency response in comparison to the ideal response. The basic quantization function is selected by setting the Quantization field to Quantize_Only. See Coefficient Quantization for further details.

The integer values used in the filter implementation can be determined by examining the main core MIF file (<component_name>.mif) which is generated in the project directory. The MIF file is always in binary format.