XML DOM 獲取節點值
816
2025-03-31
賽靈思官方文檔中在講乘累加器(MAC)(也就是在這篇博文中的乘累加器:【 FPGA 】FIR 濾波器的架構)時,有一段話是對系數填充的簡單敘述,當時我沒有寫進那篇博文中去,我覺得放到那里會讓我的博文變得難以理解。
這篇博文我仍然不想放進去,因為我不是太明白,還是塞進這一塊,供大家參考吧:
實現濾波器所需的乘法器數量
是通過濾波計算過程所需的乘法次數(考慮對稱和半帶系數結構和采樣率變化),通過除以可用時鐘頻率來處理輸入采樣。 可用的時鐘周期值總是向下取整,乘數器的數量則要向上取整。 如果存在非零余數,則部分MAC引擎要針對較少的濾波器系數進行計算,并且用零填充系數以適應過量周期。
如果在系數矢量中補充一些零值,則影響輸出采樣,即在指定的沖激響應輸出之前會有一定數目的零輸出。FIR編譯器IP核根據系統時鐘速率,采樣率,抽頭和通道數以及速率變化自動生成滿足用戶定義的性能要求的實現。 FIR編譯器IP核插入一個或多個乘法器以滿足總體吞吐量要求。
進入今天的正題:
When implementing a filter with symmetric coefficients using the Multiply-Accumulate architecture, you must be aware that the core reorganizes the filter coefficients if required to exploit symmetry, and this might alter the filter response. This is only necessary if the core is configured such that all processing cycles are not utilized. For example, when the core has four cycles to process each sample for a 30-tap symmetric response filter, the core pads the coefficient storage out as shown in Figure 3-18.
當使用MAC架構去實現一個擁有對稱系數的濾波器時,你必須注意到,如果要求利用對稱性,則由IP核組織濾波器系數,而這可能會改變濾波器的響應。
例如,在實現一個30個抽頭的對稱濾波器時,如果IP核用4個時鐘周期來處理每個采樣,則會在濾波器系數矢量中填充部分零系數,如圖3-18示:
填充零的個數由濾波器抽頭數和要求實現的采樣速率決定。本例中用4個 MAC 單元并行處理,為實現每4個時鐘周期輸出一個采樣,每個單元處理的系數個數為4個,則共可以處理的系數值為4*4*2=32個,而濾波器抽頭數為30,因此需要填充2個零系數,考慮到濾波器系數是對稱的,因此將第一個和最后一個系數置零。
(上述計算中的2是由于對稱性所得,由于對稱性,4個時鐘周期可以處理的系數值為4*4*2,第一個4是每個MAC單元處理的系數個數,第2個4是4個MAC單元并行處理,第3個2的意思是對稱性導致的處理系數翻倍。)
The appended zeroes after the non-zero coefficients do not affect the filter response, but the prepended zero coefficients do alter the phase response of the filter implementation when compared to the ideal coefficients. There are two ways to avoid this issue: First, and simplest, you can force the Coefficient Structure to be Non-Symmetric. This avoids the issue of prepending zero coefficients to the coefficient vector, and only appended zeroes are used to pad out the filter response to the required number of cycles. Second, and more efficient, you can increase the number of taps implemented by the filter at little or no cost in resource usage. In the previous example, the filter could process 32 taps in the same time, with the same hardware resources, and with the same cycle latency as the 30-tap implementation, and the phase response of the 32-tap filter would be unaltered.
在非零系數之后的附加零不影響濾波器響應,但是與理想系數相比,前置零系數確實改變了濾波器實現的相位響應。 有兩種方法可以避免這個問題:
首先,最簡單的是,您可以強制系數結構為非對稱。 這避免了將零系數預先設置到系數向量的問題,并且僅使用附加的零來將濾波器響應填充到所需的循環數。
其次,效率更高,您可以在很少或沒有資源使用成本的情況下增加過濾器實現的抽頭數量。 在前面的示例中,濾波器可以在相同的時間內處理32個抽頭,具有相同的硬件資源,并且具有與30抽頭實現相同的循環延遲,并且32抽頭濾波器的相位響應將不會改變。
The Vivado IDE displays the actual number of coefficients calculated on the Implementation Details tab. You can use this information to determine if you can increase the number of coefficients used by your filter definition.
Vivado IDE顯示在“實施細節”選項卡上計算的實際系數數量。 您可以使用此信息來確定是否可以增加過濾器定義使用的系數數量。
下篇博文:半帶濾波器
FPGA Mac OS
版權聲明:本文內容由網絡用戶投稿,版權歸原作者所有,本站不擁有其著作權,亦不承擔相應法律責任。如果您發現本站中有涉嫌抄襲或描述失實的內容,請聯系我們jiasou666@gmail.com 處理,核實后本網站將在24小時內刪除侵權內容。
版權聲明:本文內容由網絡用戶投稿,版權歸原作者所有,本站不擁有其著作權,亦不承擔相應法律責任。如果您發現本站中有涉嫌抄襲或描述失實的內容,請聯系我們jiasou666@gmail.com 處理,核實后本網站將在24小時內刪除侵權內容。