We changed our privacy policy. Read more.

Hot answers tagged

23

If the compiler writers put some effort into optimizing it for that target, it will at least make some use of the special DSP instructions / architecture. But for ultimate performance it will never be as good as hand-tuned assembly. It might be plenty good enough, though - depends on your application. Other alternatives include: Write the majority of ...


22

See also FPGA's vs Microcontrollers High-speed image or video processing is a good example. Or processing 'images' that aren't straightforward optical images, such as radar or laser-based systems. The key thing to consider is throughput and latency requirements. A microcontroller can service an interrupt (very roughly) once per microsecond. It can ...


21

Premature optimization is the root of all evil. - Donald Knuth When you find that you don't get enough performance from your code, profile your program first, find the bottlenecks, analyze your performance requirements, and only then start doing optimizations. Writing assembly code is last resort. My question is if I just program in C, wouldn't the ...


21

It's always better to have your algorithm implemented in a higher-level language (which C is compared to assembly), even if you plan to implement everything in assembly in the end. chances are, you won't even need assembly. If the code generated by your compiler meets your design goals, your job is done. if not, you won't be starting your assembly coding ...


18

Your DSP will be advertised with a maximum sustained MACs, assuming all the pipes are filled. That is obviously an upper limit to what can be achieved. You know how many MACs your filters and other processing will take, from your analysis. Aim to have the first at least twice the second, as you will not be able to keep the DSP core running at maximum. Just ...


18

Taking a derivative (or an integral) is a linear operation — it doesn't create any frequencies that weren't in the original signal (or remove any), it just changes their relative levels. So the Nyquist rate for the derivative is the same as that for the original signal.


17

Well, I do real-time processing of HD video in FPGAs. Some of what I do could be done in a GPU chip, but not on a microcontroller or DSP. The FPGA is more flexible. Many systems combine FPGAs and MCUs/DSPs to get the best of both worlds. One project I may be working on soon involves object recognition in a video stream. The preliminary steps (noise removal, ...


14

In short, FPGAs are good where you need to perform a little processing on a lot of data, and CPUs are good where you need to perform a lot of processing on a little data. An HDMI video stream is a lot of data. It can be done by a CPU, GPU, or ASIC in the general video case, but if you need to do a little bit of work on it (add an overlay, for instance) you ...


14

Many texts prove that a signal cannot be both time limited and bandlimited. It is quite a deep result and depends on complex analysis, but the shortest proof I know starts with a bandlimited signal \$f(t)\$. It is straightforward to show from the fourier transform that being bandlimited means that \$f(t)\$ is analytic over the entire complex plane, hence if ...


13

I'm guessing you've encountered this in terms of PIC programming. PICs originally had I/O ports handled in a very direct manner - you could read what values they had externally, or write what values you output, both on the same address. The downside of this was that the value you were trying to output might not match the state on the pin - something else ...


13

Generally, you use a microcontroller when it can do the job. A microcontroller performs the logic by executing sequential instructions. A FPGA performs the logic because its hardware gates are logically wired to do so. That means it can do things much faster, and a number of such things at the same time. It is generally more complicated and difficult to ...


13

If you just want to multiply two numbers and they suit the DSP block then the * operator should infer a DSP block. If not, send the synthesis tool back :) However, to take advantage of the more complex combinations of the DSP functionality often requires a direct instantiation of the block and configuring of its parameters. Examples of things which may ...


12

Some of the advantages of a dsPIC over earlier-architecture PICs, like the PIC 16 and 18 families: 16 bit wide data paths and ALU, as apposed to 8. Ability to directly address (later versions of both architectures extended this in various kludgy ways) more data memory. A basic PIC 16 can address 128 bytes directly, 512 with banking. The newer PIC 16F1xxx ...


11

uC = a stand-alone processing chip: CPU, RAM, ROM, some peripherals. DSP = processor chip (can be a separate CPU, nowadays mostly a uC) that is optimized for signal processing. Often has fast MAC (multiply-accumulate), saturating math, and multiple memory interfaces. To get the most out of it, you often need to be deeply aware of its peculiarities, like ...


11

Character generator ROMs with 5x7 ASCII codes were certainly sold. One example was the Signetics 2513, a rather nasty and sluggish P-MOS chip requiring three supply rails. OTP and UV-erasable EPROMs came along not so long after- so the cost advantages of mask ROMs were not as significant as compared to mask charges (mask ROMs are not really fully custom ...


9

Usually, the key distinguishing feature of a DSP when compared with a general-purpose CPU is that the DSP can execute certain signal-processing operations with few, if any, CPU cycles wasted on instructions that do not compute results. One of the most basic operations in many key DSP algorithms is the MAC (multiply-accumulate) operation, which is the ...


9

There is a lot of bad information and audio phoolery available on this topic, but if you're doing one channel of digital audio, 96kHz and 192kHz sample rates are silly. Human hearing extends to 20kHz. To satisfy Nyquist at 20kHz, we need a sampling rate greater than 40kHz. CDs are 44.1kHz, and 48kHz is another common sampling frequency. Now, let's recall ...


8

One application I have not seen mentioned yet is microelectronic engineering or the design of MCU/CPU/GPU/ASIC chips themselves. These chips are often prototyped by designing them in HDL and then implemented in an FPGA. This makes them easier, cheaper, and quicker to test and modify before finally using the HDL to create the layout needed for production of ...


8

You need to account for the ear by using the Fletcher Munsen curve (spelling may not be perfect but google will show the graph). Basically all sound levels for different frequencies have been empirically captured onto the graph.


8

No, transforms aren't "necessary", but they do make some types of calculations much simpler and more convenient. It is possible to do all computation and analisys of a signal in either the time domain or the frequency domain. However, some operations are much simpler and more intuitive in one than the other. This can be illustrated with something as ...


8

It depends on who you ask. Most humans cannot hear beyond 20 kHz and 16 bits, so 96 or 192 kHz should be plenty. As for hearing a difference between 16 and 24 bit converters it depends on your DSP. The key benefit of 24 bit converters is it gives you tons of additional headroom (dynamic range) so you can do a lot of mathematical operations and not add ...


8

First, note that FIR/IIR is not the same as non-recurrent/recurrent (where recurrent means that the output depends on previous inputs and previous outputs). You can have a non-recurrent filter with infinite impulse response (e.g. \$h[n] = sinc(n/3)\$, which cannot be expressed as a recursion). And you can have a recursive construction for a FIR filter. But,...


8

Theoretical Derivation The antenna electric field pattern of array antenna consists of isotropic radiator can be given by where N is the number of antenna elements d is the spacing between antenna elements In order to find the beamwidth (3 dB), the above equation should be equated to and solve for The solution will come to be as where D is the ...


8

A very simple but elegant approach to demodulate FSK is a delay and multiply. (Followed by a simple low pass filter). This is a non-coherent FM detector using the principal that the output of a multiplier is proportional to the phase of the two inputs. An XOR gate can be used as a such a multiplier. On its own it, a multiplier or XOR gate is a phase detector,...


8

I am not fond of encoding command data as an analog signal in a digital file. I think I would try something like encoding the lighting commands as text blocks in the lyrics block of the ID3 information inside the mp3 file. The lyrics block is before the sound data, so you should be able to decode it quickly before you start playback. Typical libraries for ...


8

It looks you already found the first bug: https://arm-software.github.io/CMSIS_5/DSP/html/arm__biquad__cascade__df1__f32_8c.html the function needs float arrays not int arrays By fixing this you just moved the problem to a different spot. You will get integers from your DMA so somewhere you need to do INT -> FLOAT -> INT conversions. Your block size is ...


8

A FSM is a structured method of constructing a sequential machine. The machine can only exist in a fixed number of discrete states - ie ‘finite state’. FSMs can be formally proven for correctness. Other benefits are that they are easy to construct in code and debug. Going from a state diagram to writing code is a straightforward process. Traffic lights are a ...


7

I'm afraid you're up against a fundamental limitation of real, causal physical systems. You're asking for a filter that can distinguish between signals that have periods of 12 to 16 seconds, but only allowing it to "look at" a 2-second segment (1/6 to 1/8 of the period) of the waveform in question. It simply isn't possible to get no phase shift and low delay ...


7

Even though I answered this question already, I will add another answer to illustrate a different viewpoint: Write in C, read in assembly! So, instead of writing in assembly, you will write the logic in C, carefully making sure that the assembler output of the C code is optimal. You can often do certain tricks on the C code to affect the assembler output. ...


6

A microcontroller can only process data sequentially, one instruction at a time, so if you have a very expensive operation, you may want to make your computation parallel somehow. Processing audio/video is a good example of this. To meet that need, digital signal processors have been developed which can do certain tasks in parallel, but they are not ...


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