11-08-2019 07:52 AM
I'm new to FPGA programming. Currently I'm using the xilinx ISE 12.4 as it is the recommended version stated in the hardware manual.
My application requires me to use the Hilbert Transform. I have managed to get the code working with the coefficients and input data generated using MATLAB.
However, the results is different when I compared them. (MATLAB results vs FPGA results)
I have checked and verify that the result for the I data is the same. (Since I data is just a delay of the input data)
For Q data, I'm not sure whether I'm using the wrong sample points to plot the result. Hence, getting different results.
After reading the results generated by FPGA, I'm using the same sample points for I and Q. (I_DATA(1:numSample) & Q_DATA(1:numSample)
Is there suppose to be a fix number of sample delay for Q data? In MATLAB when using designfilt Hilbert Transform function, there is a need to take Q data sample with a delay of filterTaps/2.
I also notice that when the output pin RDY of the Filter goes to high (output data ready), a number of starting samples of the I data are '0'. Is the response suppose to be like that? In the datasheet, it state that once RDY goes high, the output of the Filter is valid.
Thanks for helping!
11-08-2019 09:53 AM
You are seeing the filter startup. All FIR filters do this. Assuming you have a reset, all of the delay taps in the filter are zero when you start. Your first non-zero sample is only multiplied by coefficient_0 to produce the first non-zero filter output. When the second sample comes in you get (Sample1*coefficient0) + (Sample0*coefficient1). Until all of the filter taps get loaded with non-zero data, you will see this startup response.
11-08-2019 11:49 PM
Thanks for the reply bruce_karaffa.
I'm using a 59 tab hilbert transform filter.
If I'm correct, the output of I data correspond to the input data at the 32nd sample onwards. (I do not have access to the testbench now.)
Which sample of the Q data should I start using in order to get the exact same output response as MATLAB?
Thanks for helping!
11-10-2019 06:30 PM
I made a mistake in my previous post. Instead of the 32nd sample, the I data correspond to the input data at 31st samples onwards. Which is similar to what is stated in the datasheet.
For the Q data, currently I'm using an output round mode: truncate LSBs to 16bits. And then I used the 62st sample onwards for the Q data.
After which I saved and plotted the IQ data in the frequency domain but the results does not match.
Anyone can help? Thanks!
11-11-2019 05:07 PM
I found what the issue is. It is due to the scaling of the Q data which cause the discrepancy of the data between the MATLAB and VHDL output. Thanks everyone. :)