Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs
13 votes

Why is there no FPU on (most) DSP chips?

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 ...
hotpaw2's user avatar
  • 35.4k
9 votes
Accepted

Fixed point scaling; float -> Q31 -> float

Fixed point processing is very difficult (unless it's a very simple algorithm and well behaved data). Here is roughly how this can be done. For simplicity I will assume that the fixed point data type ...
Hilmar's user avatar
  • 45.3k
8 votes

Single pole IIR filter, fixed point design

One thing to consider when implementing an IIR filter, whatever the order, is quantization and limit cycles. Let me show you with a quick example with your original filter $y[n] = a*x[n]+(1-a)*y[n-1]...
Ben's user avatar
  • 3,777
7 votes
Accepted

How do I calculate the range of a fixed-point number with $a$ integer bits and $b $ fractional bits?

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\...
Olli Niemitalo's user avatar
7 votes

Why is there no FPU on (most) DSP chips?

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 ...
TimWescott's user avatar
  • 12.8k
7 votes

Fixed point scaling; float -> Q31 -> float

OK -- I see your problem. You're multiplying $a$ and $b$, by first bringing them into Q31 then bringing them out. $a$ and $b$ happen to be 6 and 10, but let's not worry about that at the moment. ...
TimWescott's user avatar
  • 12.8k
7 votes
Accepted

Efficient Log2 and dB from Floating Point and Fixed Point Representation

BOTTOM LINE - DOUBLE PRECISION FLOATING POINT We can make use of the floating point encoding directly to efficiently determine $\log_2$ for the represented number (and as I show at the end provide the ...
Dan Boschen's user avatar
  • 51.9k
6 votes
Accepted

Why does the Direct form I become our first choice for fixed-point implementation?

I heard that the Direct form II transposed is better for floating-point and the Direct form I is better for fixed-point. Is it true? "Better" is a relative term, but generally yes. Direct ...
Ryan's user avatar
  • 329
5 votes

Why is there no FPU on (most) DSP chips?

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 ...
Fat32's user avatar
  • 28.3k
5 votes

Hyperbolic sine "sinh" in fixed-point?

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 ...
robert bristow-johnson's user avatar
5 votes
Accepted

Problems with implementation of a band-stop filter on an MCU (dsPIC) using fixed-point arithmetic

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 ...
Juancho's user avatar
  • 5,026
5 votes

How do I calculate the range of a fixed-point number with $a$ integer bits and $b $ fractional bits?

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 ...
Gilles's user avatar
  • 3,406
4 votes

Derivation of fixed-point $\tt atan2$ with self-normalization

I had the exact question, nearly a decade later - and think I figured out the cool fixed-points tricks thanks to and edaboard thread and helpful write up in the IEEE Signal Processing Magazine. First, ...
Scott Howard's user avatar
4 votes

Minimum bit-width for fixed point FFT outputs

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_{...
robert bristow-johnson's user avatar
4 votes
Accepted

Fixed Point Design Resources

Make your block diagram At each point where significant quantization can happen, add noise Analyze your system's behavior with that added noise If you know that the quantization effects will be ...
TimWescott's user avatar
  • 12.8k
4 votes

Friendliest python library for fixed point algorithm simulation

The libraries I tried out are: https://github.com/rwpenney/spfpm https://github.com/smlgit/fpbinary https://github.com/Schweitzer-Engineering-Laboratories/fixedpoint https://github.com/francof2a/...
Simon Hobbs's user avatar
3 votes

Hyperbolic sine "sinh" in fixed-point?

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 ...
Ben's user avatar
  • 3,777
3 votes
Accepted

Conversion from Floating point representation to Fixed point representation

I think you need to use the floor() or round() functions in MATLAB, to emulate fixed-point variables and operations. So you ...
robert bristow-johnson's user avatar
3 votes

Multiplication of fixed-point numbers

There are errors in the presented answer. Here's the same but corrected and rewritten a bit: ...
Olli Niemitalo's user avatar
3 votes

Minimum bit-width for fixed point FFT outputs

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 ...
Fat32's user avatar
  • 28.3k
3 votes

Books/resources for implementing various mathematical functions in fixed point arithmetic for DSP purposes

Chebyshev approximation can help compute polynomial coefficients that are close to optimum for approximating a function over a finite range. You run the approximation routine on a PC to achieve a ...
Jason S's user avatar
  • 1,059
3 votes

Single pole IIR filter, fixed point design

this is my original posting about implementing a fixed-point DC blocking first-order HPF using fraction saving. Lyons and Yates later did an IEEE Sig Proc article about DC blocking filters where this ...
robert bristow-johnson's user avatar
3 votes

Clear examples of Fixed Point Algorithm Specification Block Diagram for FPGA Implementer

I designed a lot of DSP algorithms and I would usually be the one implementing them in an FPGA. I rarely had to explain the internals of an algorithm to other people. That beind said, it is a good ...
Ben's user avatar
  • 3,777
3 votes
Accepted

High-pass filter with quantized (fixed-point) coefficients

One problem with your design is that the quantized numerator coefficients don't add up to zero anymore, so you lose the desired notch at DC. That can be done differently, because even with quantized ...
Matt L.'s user avatar
  • 90.3k
3 votes

Integer v Fractional ADC outputs with FIR Filter Inputs

Fixed point processing is not for the faint of heart, but fortunately a single FIR filter is about as easy it gets. In this case it would be easiest to do anything in fractional, i.e. assuming both ...
Hilmar's user avatar
  • 45.3k
3 votes
Accepted

How to apply hann window to unsigned integer ADC

Did I correctly apply? No. At least not according to your plan: ADC[j] = (ADC[j] - DC) * hann[j]; here you're multiplying an integer ...
Marcus Müller's user avatar
3 votes

Fixed point scaling; float -> Q31 -> float

Here is a higher level summary of Q notation that will help demystify the other good answers: The post mentions "Q31" as a signed binary number, in this case with 32 total bits, and scaled ...
Dan Boschen's user avatar
  • 51.9k
3 votes
Accepted

Fixed point implementation of IIR filter

Fixed point processing is complicated. For a more detailed description of the process required see: Fixed point scaling; float -> Q31 -> float In your specific case the choice of filter ...
Hilmar's user avatar
  • 45.3k
2 votes
Accepted

Testing filter code w/ Octave

I think the solution is to use $\log_{10}(y)$ instead of $\log(y)$. log(y) in octave is the natural $\log$, but you want a log base $10$, which is ...
Dan Boschen's user avatar
  • 51.9k

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