02-10-2016 12:11 PM
Can anyone tell me what is wrong with this .coe file I generated for a Hilbert filter? FIR Compiler 6.3 tells me the coefficients do not match the expected Hilbert structure. It reads the coefficients fine, but just doesn't like the structure. I generated these coefficients using Matlab's FDA tool.
radix=10; coefdata= 0, -0.003073, 0, -0.003360, 0, -0.005130, 0, -0.007456, 0, -0.010464, 0, -0.014310, 0, -0.019198, 0, -0.025443, 0, -0.033516, 0, -0.044247, 0, -0.059193, 0, -0.081715, 0, -0.120592, 0, -0.208110, 0, -0.635245, 0, 0.635245, 0, 0.208110, 0, 0.120592, 0, 0.081715, 0, 0.059193, 0, 0.044247, 0, 0.033516, 0, 0.025443, 0, 0.019198, 0, 0.014310, 0, 0.010464, 0, 0.007456, 0, 0.005130, 0, 0.003360, 0, 0.003073, 0
02-10-2016 07:35 PM
02-11-2016 05:20 AM
In the FIR compiler, under Filter Specification, I chose Hilbert from the drop down menu, and then the Inferred Coefficient Structure sets itself to Negative Symmetric or Non Symmetric, and I cannot change this value. In Coefficient Structure, the Inferred option is selected and I cannot change this. I do not see anywhere that I can explicitly set the coefficient structure.
Something else I just noticed, on the Summary page, it says the filter type is Interpolated, even though I have Hilbert selected, and the Coefficient Structure is Non Symmetric. Any idea why the Summary page is not lining up with what I am actually selecting on the previous pages?
02-11-2016 05:25 AM
The Hilbert Transform has zeros for every other coefficient, but the FDATool does not actually write out '0', except for the middle coefficient. The others are close to zero, but not precisely zero. For the attached example, if one tries to pass the coefficients from the FDATool to the FIR Compiler block using the traditional argument above, the error message below is displayed.
One workaround is to export the coefficients to a variable (Num), then run this script:
Num(2:2:end) = 0;
This will make the coefficients '0' versus "close to zero". Then, if you use 'Num' in the Fir Compiler coefficient field, things will work.
Note that if you change the filter order from 10 (11 taps) to 12 (13 taps), then the outer coefficients would be zero. In that case, you would have to use this:
Num(1:2:end) = 0;
A CR has been filed against the FIR Compiler block to be able to support this.
In place of Matab Fdatool . you can use scilab
Software freely available for download from following link
Use this software for generating Hilbert coefficient
It will generate the coefficient
- 0.0424413, 0., - 0.0489708, 0.,- 0.0578745,0.,- 0.0707355,
0., - 0.0909457, 0., - 0.1273240,0.,- 0.2122066,0., -
You can use these coefficients as shown in snap shot. These coefficients infer Hilbert transform.
02-11-2016 07:44 AM
If you look at the coefficients I posted they are exactly zero. I have done the process you described already in Matlab.
02-12-2016 01:14 PM
Well I figured it out.
Apparently the FIR compiler 6.3 doesn't like the leading and trailing zero valued coefficients. This is weird because it calculates the frequency response correctly. So, the lesson is, get rid of the leading and trailing zero that Matlab generates and these coefficients will be recognized correctly.