382 karma · joined July 17, 2013
The fact that a char is stored on silicon in the lowest 8 bits of the smallest addressable memory space really makes no difference. char arrays act just like they do on any other platform.
There aren't a lot of libraries floating around that you'd be using on a DSP, aside from vendor-supplied ones. Generally you're using a DSP because you have specific signal processing needs and power and cost requirements, which are pretty orthogonal to the requirements of most desktop development. As such, there probably isn't a huge amount of overlap between the libraries you'd be using.
Another reason for that being that quite a bit of the time you're not running an OS. There is no transparent abstraction layer that magically maps an ADC IC connected via SPI to an arbitrary group of remappable peripheral pins to /dev/adc0. I think that's kind of the big disconnect between desktop and embedded, so much of the code is specific to the processor/DSP and the arbitrary external hardware connected to it. You can't take code written for a DsPIC that uses the internal ADC and run it on an MSP430 with an internal ADC for the same reason. There isn't necessarily a POSIX layer, so it's a very different beast than writing code that works on UNIX, Linux, and OSX. Look at the Linux source and see how many architecture-specific files there are in each architecture's folder. That's what you need to get a consistant interface across different processors. Without all that non-portable abstraction code running below yours, posix- and standard-compliant code still wouldn't be portable.
As far as using the same standard, I think it's a good thing that there is agreement on what the effect of a given construct is. I think the issue comes when you expect that code written for one platform to just work(TM) on another.
As for why this is the case, Generally DSPs are designed to do a few tasks very well (multiply-accumulate being the most obvious example, simultaneous reads from X and y memory, etc.) and are generally optimized for a specific word size. If you really need to access an octet on E.g. A 16-bit TI DSP you can, you just need to shift and mask. That's obviously not very efficient, because that's not really what it's optimized for. If that's what you really need, you picked the wrong part. You're gonna be filter-/FFT-/DCT-/whatever-ing way more 12 or 16-bit ADC samples per second, per dollar, and per milliWatt on that 16-bit DSP than you would be on your octet-addressable MSP430.
Regarding "Normal" c libraries, If they're valid C they should work just fine for the most part, With some obvious exceptions: you're not going to have a fun time with your "floats" on a processor without FP HW. That's why there's a standard, if you're not relying on undefined or implementation-defined behavior, you'll be fine(ish)
It's unfortunate that police are the only ones allowed to use the "ignorantia juris" defense.
I guess the phrase "LEDs are extremely fast" struck me the same way a pedestrian telling you "walking is the fastest way to get around" when you're stopped at a red light in a Lamborghini would
Laser diodes, on the other hand, are fast
Something that started with a Verilog/VHDL paradigm but provided higher level abstrations would be nice, a good analogy would be something like how Python is to C.
Counterintuitively, there is no frequency component generated at the beat frequency when you sum a 1kHz and 1.001kHz signal, its easy to test that out with matlab, octave, scipy/numpy/matplotlib, etc. Generate the two signals, add them together, and look at the Fourier transform, you'll see two components, one at 1kHz and one at 1.001kHz (assuming you take a long enough window to have that type of resolution) and no component at the beat frequency. A third sinewave doesn't just jump out of nowhere when you add two separate sinewaves together.
If you take the sum of those two signals and run them through an ideal brickwall highpass filter at 999Hz so there are no frequency components below 999Hz, you'll still "hear" the beat frequency because it isn't a separate spectral component, its just the two signals slowly going out of phase, cancelling eachother out, and then going back in phase and boosting the amplitude.
Edit: System Generator is pretty awesome though!
You can look at your "A440 at a constant volume" example as a 0Hz(DC) signal getting louder and softer 440 times a second, but this is the only case in which your example holds. Amplitude modulation creates sum and difference frequencies, so the A that you hear is 440Hz + 0Hz. if you change that 0Hz to 1kHz, you get a signal thats the sum of a sinewave at 560Hz and a sinewave at 1.44kHz, neither of which are an A.
The distinction is that the 1Hz signal is modulating the audible signal, not adding to it, if you look at the spectrum of the sum of those frequencies there is no 1Hz component, whereas if you added a 1Hz signal you'd get something completely different. And in this case the amplitude of the signal is always changing faster than 1Hz.
Edit: another way of looking at it: You wouldn't say you can "hear DC" because you can hear an A440 played at a perfectly constant volume.