fixed-point

fixed point singular value decomposition in c/c++ [closed]

我怕爱的太早我们不能终老 提交于 2020-01-07 09:43:50
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I am looking for some c/c++ libraries to do fixed point singular value decomposition or eigenvalue decomposition. Do you know any libraries or any pointers to existing codes? Thanks 回答1: There is a good answer to your question in this thread: Single Value Decomposition implementation C++ Also, @Bathsheba is

What is a fixed point integer?

断了今生、忘了曾经 提交于 2020-01-07 04:18:23
问题 In http://microformats.org/wiki/hreview-aggregate it says: rating . required. fixed point integer [1.0-5.0], with optional alternate worst (default:1.0) and/or best (default:5.0), also fixed point integers, and explicit average. What is a fixed point integer? Maybe that means integer? Why is 1.0 or 2.5 or 5.0 also called a "fixed point integer"? Because integer has no decimal part. 回答1: As cdhowie said, they likely mean fixed point number To answer you question with that adjustment to the

How to represent -0 in binary

半城伤御伤魂 提交于 2020-01-06 16:20:05
问题 This question concerns converting a floating point number that is less than abs(1) and negative to 32.32 format, for example: -0.1234. When this is converted to 32.32, the integer portion and fractional portion are separated into the upper and lower 32 bit words, respectively. In this example above, the upper 32-bits will hold -0, while the lower will hold .1234, both converted to binary. So the question is, in this case, how does one properly represent the -0 value in binary? 回答1: It depends

How to find offset in a sine lookup table (LUT) using fixed point arithmetic

独自空忆成欢 提交于 2020-01-05 10:20:07
问题 I am generating a LUT dividing 0-2PI into 512 fragments and then finding sine of these values and storing them as Q1.31 values. Example: LUT[0] = 0 LUT[1] = sin((1/512) * 2*PI) * (2^31) .. .. LUT[511] = sin((511/512) * 2*PI) * (2^31) My inputs are also values in the Q1.31 format. My question is how do I go about using the LUT i.e. what is the algorithm to find the offset values in the table when I get a random value as an input to figure out the sine value Example: int sample_input = 0.125 *

fixed point multiplication without 64 bit temporary

99封情书 提交于 2019-12-30 10:06:10
问题 Hi I'm implementing some fixed point math stuff for embedded systems and I'm trying to do the multiplication of two 16.16 fixed point numbers without creating a 64bit temporary. So far here is the code I came up with that generates the least instructions. int multiply(int x, int y){ int result; long long temp = x; temp *= y; temp >>= 16; result = temp; return result; } the problem with this code is that it uses a temporary 64 bit integer which seem to generate bad assembly code. I'm trying to

Fixed point approximation of 2^x, with input range of s5.26

流过昼夜 提交于 2019-12-24 08:03:54
问题 How can I implement 2^x fixed-point arithmetic s5.26 and input values is in range [-31.9, 31.9] using the minimax polynomial approximation for exp2() How to generate the polynomial using Sollya Tool mentioned in the following link Power of 2 approximation in fixed point 回答1: Since fixed-point arithmetic generally does not include an "infinity" encoding representing overflowed results, any implementation of exp2() for an s5.26 format will be limited to inputs in the interval (-32, 5),

Is there a fixed-point library for actionscript 3?

℡╲_俬逩灬. 提交于 2019-12-24 07:35:34
问题 I would like to code a calculator in Flex but can't find any fixed-point libraries on the web. For the calculator, I need more precision then IEEE 754 can guarantee. For example: trace(1.4 - .4); //should be 1 but it is 0.9999999999999999 Can someone suggest a good fixed-point library please ? Thank you in advance 回答1: It works but it is not perfect, all credits go to Josh from http://joshblog.net/2007/01/30/flash-floating-point-number-errors/ /** * Corrects errors caused by floating point

How to use python to convert a float number to fixed point with predefined number of bits

自作多情 提交于 2019-12-22 10:12:27
问题 I have float 32 numbers (let's say positive numbers) in numpy format. I want to convert them to fixed point numbers with predefined number of bits to reduce precision. For example, number 3.1415926 becomes 3.25 in matlab by using function num2fixpt. The command is num2fixpt(3.1415926,sfix(5),2^(1 + 2-5), 'Nearest','on') which says 3 bits for integer part, 2 bits for fractional part. Can I do the same thing using Python 回答1: You can do it if you understand how IEEE floating point notation

Why aren't fixed-point types included in C99?

佐手、 提交于 2019-12-21 07:56:20
问题 Thankfully, the complex type modifier was introduced into C99 standard. What I don't understand is why it was decided to omit support for fixed point arithmetic (specifically, support fractional types like 1.15 {signed} or 0.32 {unsigned}) where these types are so fundamental to DSP programming? Does GCC support these through an extension? 回答1: It's been discussed/proposed (e.g., in N938, N953) but those papers have only proposed it as extensions, not additions to the main standard. Those

When to use Fixed Point these days

允我心安 提交于 2019-12-21 06:55:48
问题 For intense number-crunching i'm considering using fixed point instead of floating point. Of course it'll matter how many bytes the fixed point type is in size, on what CPU it'll be running on, if i can use (for Intel) the MMX or SSE or whatever new things come up... I'm wondering if these days when floating point runs faster than ever, is it ever worth considering fixed point? Are there general rules of thumb where we can say it'll matter by more than a few percent? What is the overview from