DRO
Junior Member level 1
- Joined
- Feb 25, 2014
- Messages
- 17
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 167
HELLO,
I am currently designing a filter on an FPGA. I have two major problems.
there is the principal line which implements the filtering (almost like this).
Y(i) <= c*Y(i-1) + b*X(i)
Y(i) is an array of signed(40 downto 0),and X(i) is an array of signed(7 downto 0).X(i) comes from an ADC of 8 bits. Since the "real" value that corresponds to c is a very minute number (0.0000000xx), i need to write it on a 32 bits vector , at least.
The problem is that,if you look very well, i am putting a 32+40 bits vector(c* Y(i-1)) in a 40 bits vector (Y(i)).
I tried to use "resize" function but am not pretty sure that i can get out with it without any damage.
So here is the first problem:
How can i do this algorithm in order to keep the right value needed for Y(i) and at the same time
put a vector that matches Y(i) in it.
The second problem is that i need to transfert the data of Y(i) by UART. so i need to shorten them to 8 bit or somethig. I don't really know how to do that without damaging my datas. I've tried resize again, but it doesn't suit well.
Please, if anyone can help me on this. Thank you.
:-(
I am currently designing a filter on an FPGA. I have two major problems.
there is the principal line which implements the filtering (almost like this).
Y(i) <= c*Y(i-1) + b*X(i)
Y(i) is an array of signed(40 downto 0),and X(i) is an array of signed(7 downto 0).X(i) comes from an ADC of 8 bits. Since the "real" value that corresponds to c is a very minute number (0.0000000xx), i need to write it on a 32 bits vector , at least.
The problem is that,if you look very well, i am putting a 32+40 bits vector(c* Y(i-1)) in a 40 bits vector (Y(i)).
I tried to use "resize" function but am not pretty sure that i can get out with it without any damage.
So here is the first problem:
How can i do this algorithm in order to keep the right value needed for Y(i) and at the same time
put a vector that matches Y(i) in it.
The second problem is that i need to transfert the data of Y(i) by UART. so i need to shorten them to 8 bit or somethig. I don't really know how to do that without damaging my datas. I've tried resize again, but it doesn't suit well.
Please, if anyone can help me on this. Thank you.
:-(