11-03-2020 12:31 AM
Hello to forum
I have a question concerning coefficient sets (coefficient reload) in FIR compiler in decimation mode of operation:
Could FIR compiler support different decimation factors simultaneously with different sets of filter coefficients:
Namely, I would like to use a same core that depending on mode of operation performs different decimations of the input data using different set of coefficients (the same bit width, different number of lags)
Thanks to advance
Michael
11-03-2020 01:30 AM
Answer is No. The decimation rate value is fixed once you set it in FIR Compiler IP GUI, coefs reload is just to reload coefs, the filter type, decimation rate valye are not changed.
11-03-2020 01:53 AM
Ok, it was predictable, Nathanx
Have you any idea or may be examples for SYSGEN how I can make decimation filter that support different decimation factors with corresponding different filter orders, having in mind that clock can be much higher than data rate.
Thanks
Michael
Addition question : I found in Forum example of using coefficient reload with LPF and HPF.
After generating coeff2=xlfda_numerator('HPF')
I try to change coefficient order and obtain an error below (my SYSGEN version is 2019.2 and Matlab 2019.b). What is a problem??
Num = (xlGetReOrderedCoeff(coeff2,'coeff', gcbh));
Expected coefficient length :
0
Ignoring extra coefficient values
Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix
matches the number of rows in the second matrix. To perform elementwise multiplication, use '.*'.
Error in xlGetReOrderedCoeff
Thanks again
Michael
11-03-2020 02:49 AM
If you only want simple decimation, that is decimate by an integer factor, why not just create a reloadable filter and follow it with a decimator written in your favorite RTL? A programmable decimator shouldn't be hard to write. You won't get the efficiencies of a polyphase filter, but the FIR compiler is pretty efficient with resources, so it may not matter.
If you are looking to decimate by a rational ratio such as 3/2 or 5/3, you will have a more difficult design. I wrote one that involved instantiating the DSP blocks and a state machine or two to control the flow through the DSP chain.
11-03-2020 03:05 AM
OK, thanks
11-03-2020 05:55 PM
Hi @misha2020 ,
If any of the reply answers your question, can you accept it as solution or give kudos? This can help the other users who has same questions.
11-12-2020 02:04 AM
Hi, Nathan
Sorry for delay
Unfortunately the proposal of using FIR compiler with reloadable coefficients and after that use variable decimation does not very elegant.
Furthermore, I struggle with MATlAB routine xlGetReOrderedCoeff(coeff2,'coeff', gcbh) that should reorders filter coefficients, but it fails in versions that I used.
So, could you please explain how I can automatically make filter coefficient reordering?
Thanks
Michael
11-15-2020 08:51 PM
Can you take a look at page 57 on PG149 June 10, 2020? The section "Coefficient Reload" has details.
To minimize the resources required to implement the coefficient reload feature, it is necessary for users to re-order the coefficients that are to be reloaded to correctly pass each coefficient to its correct storage location in the filter structure. The Vivado IDE offers the facility to generate re-ordered coefficient files for use with the RELOAD channel and during core generation delivers an informational text file to the project area named _reload_order.txt, which lists the indexes of the coefficients, Coefficient x, in the order they should be reloaded into the filter through the reload channel Reload index x.
11-16-2020 01:01 AM
Thanks Nathan
I have read this paragraph, but my question was concerning the routine that one can use in MATLAB for implementing the reordering in System Generator:
function reOrderedCoeff = xlGetReOrderedCoeff(new_coeff_set,returnType,handle)
The hep of this routing exists, but unfortunately it does not make its job, at least I was not succeeded.
Any idea?
Regards
Michael
11-25-2020 09:19 PM
The FIR Compiler block in System Generator is the same with FIR Compiler IP core in Vivado.
This function is needed in the sequence of events to reload new filter coefficients.
A = xlGetReOrderedCoeff(new_coeff_set, ReturnType, block_handle)
where
new_coeff_set = New coefficient set to be loaded
block_handle = FIR Compiler block handle in the design which can be specified as 'gcbh'
ReturnType = Coeff or Index
The parameter ‘gcb’ should be the FIR block name and include a complete path to the block.
If you still have problem using this, let me know. @vkanchan , can you help on this question?