14

You don't have anything to do, because $\rm Qm.n$ is just an "interpretation" of an integer. The only thing that really matters is that you need to correctly apply a shift operation when multiplying numbers; or when adding/subtracting numbers with different values of $\rm (m, n)$ - You can think of the $\rm Qm.n$ representation as a "tag" you attach to ...


12

An 8086 used less than 30k transistors. The 8087, which is the FPU for the 8086, is reported to use 45k transistors. Faster FPUs can be even larger in terms of gate count. So the cost in silicon die area of an FPU can be significant (over 2X?). Power and thus heat is proportional on the order of the number of transistors toggling outputs at similar rates. ...


10

When multiplying two's complement numbers, you have to perform sign extensions to the operands to meet the number of digits your multiplication will yield, i.e., in your case $4 + 4 = 8$ digits. $$ 11111110_2 \times 00000111_2 = 11110010_2 $$ As there are $2 * 3$ fractional bits, the result is $1.110010_2 = \frac{-14}{2^6} = -0.21875$. Normalizing this ...


10

what is fraction saving? can you write a code.so that i can understand more clearly? Let's call the quantizer operator $\operatorname{Quant}\{\cdot\}$ . So the output of the quantizer, with $v[n]$ going in, is $$y[n] = \operatorname{Quant}\{ v[n] \}$$ which we shall model as an additive error source: $$y[n] = v[n] + q[n]$$ No matter how the ...


9

the general polynomial form is: $$\begin{align} f(u) &= \sum\limits_{n=0}^{N} \ a_n \ u^n \\ \\ &= a_{\small{0}} + \Bigg(a_{\small{1}} + \bigg(a_{\small{2}} + \Big(a_{\small{3}} + \,... \big(a_{\small{N-2}} + (a_{\small{N-1}} + a_{\small{N}} \,u \,)u \, \big)u \ ...\Big)u \, \bigg)u \, \Bigg)u\\ \end{align}$$ the latter form is using Horner's ...


9

IEEE float singles only provide about 24 bits of mantissa. But many DSP/filtering algorithms (IIR biquads with poles/zeros near the unit circle, etc.) require far more than 24 bits of mantissa for intermediate computational products (accumulators, etc.), just to get final results accurate to near 16 or 24 bits. For these types of algorithms, 32, 40 and 48-...


9

the CPU/DSP has hardware floating point support for both single and double precision. It really depends on what kind of support you are talking about. On x86, when using the x87 style floating point instructions, you get the full 80-bit internal precision and the same processing time - whether you are working with single or double precision. But when using ...


7

The numerical accuracy of integers will only be better than the numerical accuracy of floats if the integer resolution is better. Doubles have 52 fractional bits, so double-precision floats have a resolution worse than integers at around $2^{52}$, which is much larger than 32768 ($2^{15}$). So, no, the numerical accuracy will not be better if you go to ...


6

Let's assume that we are dealing with unsigned number types. If you would use all $a+b$ bits for the integer part then the set of possible numbers would be: $$\left\{0, 1, 2, 3, \dots, 2^{a+b}-1\right\}.$$ These numbers can be divided by $2^b$ (or multiplied by $2^{-b}$) to take use of $b$ bits for the fractional part, resulting in this set of possible ...


6

The merits of fixed-point are mostly in terms of power (such as when you have a choice of processor hardware, or the processor is good at shutting down unused functional units). That is because fixed-point units are commonly smaller (less transistors, shorter wires, less capacitance to overcome per MAC) for a given technology and operation issue rate, than ...


6

You need to know the numerical requirements of your algorithm and choose the precision accordingly. So let's do the math here: A 32-bit floating point has a 24 bit mantissa and an 8 bit exponent. This gives you about 150 dB signal to noise ratio over a dynamic range of about 1540 dB. That's plenty for most things audio. Double precision gives you roughly ...


6

I prefer to use a more explicit notation that consists of the number of integer and fractional bits, like in your last question. I'll take them one at a time: By Q8, I assume you mean unsigned Q0.8 (no integer bits, 8 fractional bits). In this format, there is no representation for the numbers $1.0$ or $1.5$. The largest value that an 8-bit unsigned integer ...


6

Why not use floating point: Floating point is big Floating point is power-hungry Floating point that is fast and fully IEEE compliant is really big and really power hungry, so most fast floating point units sacrifice IEEE compliance Floating point is good when you have a problem where you don't know the range of the input data beforehand. In many many DSP ...


5

the first thing that one must understand when doing fixed-point arithmetic is that, at the basic level, it is integer arithmetic with some scaling factors applied. perhaps just one scaling factor applied. this scaling factor is directly related to the position of the binary point. unless the chip is a fixed-point DSP or similar, the binary point is ...


5

Prefer single precision floats to doubles - this will halve your memory bandwidth, cache footprint and storage requirements, and make some mathematical operations faster. It also opens up the possibility of 4 way SIMD if further optimization is needed. Fixed point is only really worthwhile when you don't have an FPU - most modern x86 CPUs have two FPUs so ...


5

For an unsigned fixed-point, the representation for a $N$-bit binary number $x$ is $$x=\frac{1}{2^b}\sum_{n=0}^{N-1}2^n x_n, \quad \text{where $x_n$ is the $n^{\rm th}$ bit value of $x$}$$ For this $N$-bit binary number you can get values from $0$ to $2^N -1$ since the smallest number is the $N$-bit all-zeros ($x_n =0\ \forall n$), and the largest is the $...


5

The denominator (recursive coefficients Ai) look OK: the poles of your system are at 45 degree angles ($\pi/4$), with magnitude 0.68 (which is not very aggressive for a notch filter; in my opinion they should be more like 0.9). But your numerator has its roots very near $z=1$, which corresponds to frequency 0 instead of the desired $\pi/4$ for implementing ...


5

Be careful with that version of the Cookbook. I did not actually write it, although I gave permission to Doug to write it. He has a few typographic errors. The original has been moved. I think this is maybe where it lives now but there appears to be a CR/LF problem with the file. Anyway, to do trancendentals with a fixed-point processor is difficult but ...


5

There are certainly FPUs on DSP chips such as the TMS320X family from TI or STM32F4xx series powerful microcontrollers from ST [see comment below]. These chips are powerful both in terms of FLOPS and also in terms of electrical power consumption (especially the former). However, there are so many applications that are restricted by energy or power, such as ...


4

As mentioned in the comments, your question is pretty confusing and confused, so I might not be able to answer all your smaller questions, but I'll try to shed some light on the topic. This should help you understand what's going on, and hopefully this understanding will help you answer all further questions by yourself. In the following I assume two's ...


4

i want in fixed point,the q formats are 8,16,24,the computation time should be very less,and the coeffficents are constant they are not time varying. i guess i would recommend, Direct Form I. use an accumulator that with word width equal to the sum of word widths of signal and coefficient. so there's no accumulation of quantization error until the last ...


4

it really depends on how the DFT is defined. usually we define the DFT and inverse DFT as: $$ X[k] = \sum\limits_{n=0}^{N-1} x[n] \ e^{-j 2 \pi \tfrac{nk}{N}} $$ $$ x[n] = \frac{1}{N} \sum\limits_{k=0}^{N-1} X[k] \ e^{+j 2 \pi \tfrac{nk}{N}} $$ but they could just as well be defined as $$ X[k] = \frac{1}{N} \sum\limits_{n=0}^{N-1} x[n] \ e^{-j 2 \pi \...


3

well, i see little value in factoring an FIR into quadratics and implementing them in cascade. it won't be computationally cheaper and it's not better from a quantization noise POV if your FIR has access to an accumulator that is double width. perhaps it will help with limiting coefficient range so that it's less likely that you have non-zero ...


3

In addition to the very good answers provided here, a few things worth adding: There are situations in which even if you have very basic requirements on the dynamic range of the data you process, you will still need a very good precision for some of the operations performed on it - for example you will want to apply an IIR filter which requires relatively ...


3

I don't think either will increase your precision as such, although there are benefits to each approach. Using the lower 11 bits of 1.15 would provide you with 24dB of extra headroom (obviously being careful to sign extend properly). Alternatively, using the upper 11 bits could potentially lower the power in your quantisation error after 1.15 * 1.15 ...


3

If your floating point number is X, then X_Q15 = 32768 * X if (X_Q15 > 32767) X_Q15 = 32767; if (X_Q15 < -32768) X_Q15 = -32768;


3

Eventhough I have not implemented a fixed-point FFT before, here is answer for integer based representation for which I could still say that, as you have shortly defined, the minimum bit-width to create a proper dynamic range (to avoid clipping or overflow) of the output of an $N$-point FFT is determined by the expected maximum amplitude at the FFT output. ...


3

There are errors in the presented answer. Here's the same but corrected and rewritten a bit: 1.01 * 1.11 -------------- carry: 1 1 1.1111 (shift right 1.11 with sign extension) 0.000 + 0.01 (2's complement of 1.11) -------------- = 0.0011 Here, 2's complement means negation, which is done by flipping each bit and adding ...


3

I think you need to use the floor() or round() functions in MATLAB, to emulate fixed-point variables and operations. So you have to know the range of the fixed-point value and the precision of it. The ratio of the range to the precision is the dynamic range and you get 6.02 dB and one bit of word width every doubling of that ratio. If you convert: ...


3

If you have lots of memory, I would recommend that you use a look-up table. You could use Matlab/Octave/Python to generate the look-up table in C/C++. You can combine a look-up table with interpolation in order to reduce the memory requirements. You can exploit the symmetry of the sinh function in order to reduce the memory requirements by half. Second ...


Only top voted, non community-wiki answers of a minimum length are eligible