Author Topic: Lowcost DSP for beginner  (Read 37260 times)

0 Members and 1 Guest are viewing this topic.

Offline glatochaTopic starter

  • Regular Contributor
  • *
  • Posts: 114
Lowcost DSP for beginner
« on: May 13, 2013, 06:02:05 am »
Hi,

I am thinking of the multichannel measurement system and would like to have possibility in the future to do some basic signal analysis/statistic etc.
As I am familiar with PIC uC then dsPIC caught my attention. Advantages are the free of charge MPLABX and XC16 compiler and I have the PICKIT3 for programming.
I am wondering what other manufacturers offer this kind of DSP that are so close to standard microcontrollers.
 

Online jahonen

  • Super Contributor
  • ***
  • Posts: 1052
  • Country: fi
Re: Lowcost DSP for beginner
« Reply #1 on: May 13, 2013, 06:25:59 am »
TI C2000- and Freescale 56F8xx-series comes into mind.

Regards,
Janne
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26751
  • Country: nl
    • NCT Developments
Re: Lowcost DSP for beginner
« Reply #2 on: May 13, 2013, 07:36:35 am »
Just use an ARM controller. I used DSPs in the past but nowadays I always use an ARM (from NXP to be more specific) controller for signal processing applications. Most ARM controllers have interfaces which can talk to a codec directly through an SSI interface.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline TheDirty

  • Frequent Contributor
  • **
  • Posts: 440
  • Country: ca
Re: Lowcost DSP for beginner
« Reply #3 on: May 13, 2013, 04:25:59 pm »
I don't have much experience with DSP's, but the Cortex-M4 ARM's have DSP extensions.  If you want cheap, you can just go with TI's Tiva (used to be Stellaris) launchpad board or the STM32F4 Discovery board.  Both have CM4F cores.
Mark Higgins
 

Offline codeboy2k

  • Super Contributor
  • ***
  • Posts: 1836
  • Country: ca
Re: Lowcost DSP for beginner
« Reply #4 on: May 13, 2013, 06:11:39 pm »
The line is blurring between today's very capable MCUs and what is a true DSP.

Basically, someone says they want a DSP because they are doing lots of "signal processing stuff" but truth is that they often don't need a full-on DSP for basic signal processing.  Only when it gets more advanced then this will they need a real dedicated DSP, and here's why:

a DSP has an accumulator that is designed around multiply-accumulate, because filters are mostly a continuous application of high-order polynomials. The accumulator has guard bits, so that it doesn't lose precision, and the final result can be truncated without much loss of precision.  A DSP operating in real-time is more efficient with a Harvard architecture (but it's not needed for non-realtime signal processing, so MCUs do ok here).  DSP's have fractional number representation internally, and you can operate on fractional numbers directly, and the registers and instruction set understand fractional numbers, -1.0 < Rx < 1.0.  This is because a filter's coefficients are already fractional numbers and the results will also be fractional numbers as it accumulates. DSPs can do parallel fetch while calculating a result.. and DSPs can often do all of this in just a few specialized instructions.

Now, the ARM Cortex-M4 has some DSP extensions, such as a single cycle MAC. This may make it operate faster doing some "DSPish" things, but it may fall short if you want to do DSP in real time on the incoming datastream from your multichannel measurement system.

Finally, a DSP makes programming a filter so easy :)

the basic FIR filter is



Which is just a series of multiply and accumate, and can often be done in just a few instructions on a DSP, which might take several instructions on a non-DSP.  The DSP can parallel fetch the next x value and the b coefficient while calculating and accumulating y[n]

So.. just some food for thought, to help you decide if you need a real DSP or if a modern MCU with DSP extensions will be good enough for your needs.


 

Offline gocemk

  • Regular Contributor
  • *
  • Posts: 84
  • Country: mk
Re: Lowcost DSP for beginner
« Reply #5 on: May 13, 2013, 06:52:01 pm »
The line is blurring between today's very capable MCUs and what is a true DSP.

Basically, someone says they want a DSP because they are doing lots of "signal processing stuff" but truth is that they often don't need a full-on DSP for basic signal processing.  Only when it gets more advanced then this will they need a real dedicated DSP, and here's why:

a DSP has an accumulator that is designed around multiply-accumulate, because filters are mostly a continuous application of high-order polynomials. The accumulator has guard bits, so that it doesn't lose precision, and the final result can be truncated without much loss of precision.  A DSP operating in real-time is more efficient with a Harvard architecture (but it's not needed for non-realtime signal processing, so MCUs do ok here).  DSP's have fractional number representation internally, and you can operate on fractional numbers directly, and the registers and instruction set understand fractional numbers, -1.0 < Rx < 1.0.  This is because a filter's coefficients are already fractional numbers and the results will also be fractional numbers as it accumulates. DSPs can do parallel fetch while calculating a result.. and DSPs can often do all of this in just a few specialized instructions.

Now, the ARM Cortex-M4 has some DSP extensions, such as a single cycle MAC. This may make it operate faster doing some "DSPish" things, but it may fall short if you want to do DSP in real time on the incoming datastream from your multichannel measurement system.

Finally, a DSP makes programming a filter so easy :)

the basic FIR filter is



Which is just a series of multiply and accumate, and can often be done in just a few instructions on a DSP, which might take several instructions on a non-DSP.  The DSP can parallel fetch the next x value and the b coefficient while calculating and accumulating y[n]

So.. just some food for thought, to help you decide if you need a real DSP or if a modern MCU with DSP extensions will be good enough for your needs.

Hi,

In your opinion (and experience) how does the 16bit core dsPIC30/33F compare against the PIC32 or ARM Cortex for DSP applications? There are a few interesting findings on the net for this one, some are in favor on dsPICs, others are in favor of the 32bit MCU's.

Thanks.
 

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 8973
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: Lowcost DSP for beginner
« Reply #6 on: May 14, 2013, 01:03:54 am »
Out of the choices you gave, ARM is the way to go for sheer power. The Raspberry Pi is very hard to beat at its price.
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Offline TheDirty

  • Frequent Contributor
  • **
  • Posts: 440
  • Country: ca
Re: Lowcost DSP for beginner
« Reply #7 on: May 14, 2013, 01:52:17 am »
The line is blurring between today's very capable MCUs and what is a true DSP.

Thanks for that great post.  Too bad there's no Thank button on this forum.
Mark Higgins
 

Offline glatochaTopic starter

  • Regular Contributor
  • *
  • Posts: 114
Re: Lowcost DSP for beginner
« Reply #8 on: May 14, 2013, 02:03:23 am »
For some reasons, not sure actually why. I would like to stay as far as possible from ARM if not needed.
Probably will go with dsPIC. As I wrote, the XC is free, the MPLAB X I know already. And I am generally familiar with Microchip way.
 

Offline Rasz

  • Super Contributor
  • ***
  • Posts: 2616
  • Country: 00
    • My random blog.
Re: Lowcost DSP for beginner
« Reply #9 on: May 14, 2013, 02:32:47 am »
Out of the choices you gave, ARM is the way to go for sheer power. The Raspberry Pi is very hard to beat at its price.
lol no, we are talking DSP here, this is Linear algebra. You need vector coprocessor at the very least
Who logs in to gdm? Not I, said the duck.
My fireplace is on fire, but in all the wrong places.
 

Offline Harvs

  • Super Contributor
  • ***
  • Posts: 1202
  • Country: au
Re: Lowcost DSP for beginner
« Reply #10 on: May 14, 2013, 03:29:42 am »
Then you don't know what you're missing.  The low cost stm32f4 disco board, and I'm sure nxp has something similar, are awesome.

Yes there's a bit of learning to be done, but it won't be a waste of time, and with a gnu tool chain you won't get much cheaper.
 

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 8973
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: Lowcost DSP for beginner
« Reply #11 on: May 14, 2013, 04:59:33 am »
Out of the choices you gave, ARM is the way to go for sheer power. The Raspberry Pi is very hard to beat at its price.
lol no, we are talking DSP here, this is Linear algebra. You need vector coprocessor at the very least
The Raspberry Pi actually does have a video centric DSP. But even without it, 700MHz of ARM will outpace any dsPIC very easily. If you want a proper general purpose DSP, some OMAPs (and probably numerous other SoCs) have it, but they are obviously more expensive than the Pi.

The dsPIC is a great choice where a Pi is overkill. So is the C2000, but in my experience, TI's CCS just isn't as good quality as MPLABX.
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Offline glatochaTopic starter

  • Regular Contributor
  • *
  • Posts: 114
Re: Lowcost DSP for beginner
« Reply #12 on: May 14, 2013, 05:01:21 am »
One day 32bit come to me also. But almost surely will be again microchip with PIC32 and the PICKIT dev board.
ARM has so many core types, so many manufacturers. I know it is an advantage, but just can't find the motivation to dig into it.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26751
  • Country: nl
    • NCT Developments
Re: Lowcost DSP for beginner
« Reply #13 on: May 14, 2013, 08:47:20 am »
For some reasons, not sure actually why. I would like to stay as far as possible from ARM if not needed.
Probably will go with dsPIC. As I wrote, the XC is free, the MPLAB X I know already. And I am generally familiar with Microchip way.
All the ARM tools you need are completely free and there are tons of tutorials out there. Staying away from ARM is like saying you prefer a horse & carriage over a modern car. Just get a board with an ARM from NXP or ST. I don't know about ST but NXP's peripherals are 99.9% identical across their entire range of ARM7 and ARM Cortex devices. So a single investment in time gets you low cost / low power or high performance in a single solution. No need to learn completely different architectures.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline Rasz

  • Super Contributor
  • ***
  • Posts: 2616
  • Country: 00
    • My random blog.
Re: Lowcost DSP for beginner
« Reply #14 on: May 14, 2013, 02:28:16 pm »
Out of the choices you gave, ARM is the way to go for sheer power. The Raspberry Pi is very hard to beat at its price.
lol no, we are talking DSP here, this is Linear algebra. You need vector coprocessor at the very least
The Raspberry Pi actually does have a video centric DSP.

No it doesnt. It has closed source GFX core (with general computing capabilities inside) you WONT be able to use, EVER. Binary blob, no documentation, NDAs up the ass(if you are as big as Nokia) and Broadcom at the helm.
Afaik Nokia is the only company writing own code for VideoCore line of processors (PureView).

But even without it, 700MHz of ARM will outpace any dsPIC very easily.

dsPIC  is not exactly a DSP processor. Its not hard to outpace 70mips cpu with no hardware FP. My $20 router does that too, but I wouldnt recommend it to anyone interested in DSP.
Who logs in to gdm? Not I, said the duck.
My fireplace is on fire, but in all the wrong places.
 

Offline rsjsouza

  • Super Contributor
  • ***
  • Posts: 5980
  • Country: us
  • Eternally curious
    • Vbe - vídeo blog eletrônico
Re: Lowcost DSP for beginner
« Reply #15 on: May 14, 2013, 04:04:55 pm »
would like to have possibility in the future to do some basic signal analysis/statistic etc.
Others already mentioned true DSPs, and I would recommend that for the bolded statement above. If your signal analysis will involve operations in the frequency domain, ARM processors won't be as quick as DSPs when FFTs are involved.

Cost of development is pretty low these days irrespective of the platform of choice. I am familiar with the C2000 and you could start really cheap with a Launchpad and a free copy of Code Composer Studio IDE. If you prefer command-line development they have unlimited compilers available for download.
Vbe - vídeo blog eletrônico http://videos.vbeletronico.com

Oh, the "whys" of the datasheets... The information is there not to be an axiomatic truth, but instead each speck of data must be slowly inhaled while carefully performing a deep search inside oneself to find the true metaphysical sense...
 

Offline SolarSunrise

  • Regular Contributor
  • *
  • Posts: 93
  • Country: ua
  • Hi there!
Re: Lowcost DSP for beginner
« Reply #16 on: May 14, 2013, 07:12:49 pm »
Low cost STM32F4 (The development board costs 15$ - bargain) can execute multiply & accumulate instruction in a single cycle. Since it has a speed of 164Mhz, It can execute multiply & accumulate instruction 164 million times/second, which is very fast.
However, any microcontroller with DSP will work, STM32F4 is just my personal choice.
 

Offline Harvs

  • Super Contributor
  • ***
  • Posts: 1202
  • Country: au
Re: Lowcost DSP for beginner
« Reply #17 on: May 15, 2013, 01:24:42 am »
Low cost STM32F4 (The development board costs 15$ - bargain) can execute multiply & accumulate instruction in a single cycle. Since it has a speed of 164Mhz, It can execute multiply & accumulate instruction 164 million times/second, which is very fast.
However, any microcontroller with DSP will work, STM32F4 is just my personal choice.

While I also highly regard this uC.  That's not quite true in practice.

The STM32F3/4 training slides have loads of info on this (lots of bench marking.)  Because of a true DSPs pre-fetch capabilities, in terms of clock cycles it can approach 1 cycle per mul-acc on a FIR filter.  Where as the M4F still needs to spend cycles getting the data out of RAM into the working register set, so their hand optimized assembly was in the order of 6 cycles per mul-acc.

Still far from bad, but it does show how the true DSPs and optimised for this task.

Now the M4F does have truckloads of awesome other features that could make it a better choice where pure DSP capabilities aren't everything.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4196
  • Country: us
Re: Lowcost DSP for beginner
« Reply #18 on: May 15, 2013, 06:32:34 am »
Quote
ARM processors won't be as quick as DSPs when FFTs are involved.
Why not?  What are they missing?  And since the things labeled "DSP" range from that 16bit dsPIC with no floating point to chips that cost $100+ each, perhaps you should qualify "DSP" further as well.

Quote
Where as the M4F still needs to spend cycles getting the data out of RAM into the working register set
THAT for instance, is a useful statement!

TI has some low cost DSP eval boards, like this one: http://www.ti.com/tool/tmdx5505ezdsp
But that's a 200MIPS fixed point DSP, so I don't know how it would compare against an RPI or BeagleBone.
 

Offline rsjsouza

  • Super Contributor
  • ***
  • Posts: 5980
  • Country: us
  • Eternally curious
    • Vbe - vídeo blog eletrônico
Re: Lowcost DSP for beginner
« Reply #19 on: May 15, 2013, 12:18:09 pm »
Why not?  What are they missing?  And since the things labeled "DSP" range from that 16bit dsPIC with no floating point to chips that cost $100+ each, perhaps you should qualify "DSP" further as well.
Multiply-and-accumulate (MAC) is not the only thing needed for signal processing. True DSPs also have special addressing modes (circular, bit-reversed) that allow algorithms to fetch data in peculiar ways without requiring conditional control code - thus reducing the number of cycles required at each iteration of a typical loop. These addressing modes speed up filters, FFTs and DFTs. Quick google search returns good articles on this subject. Check here and here.

But that's a 200MIPS fixed point DSP, so I don't know how it would compare against an RPI or BeagleBone.
Due to the reasons mentioned above, these processors target different applications. Don't expect a DSP to shine when performing intensive control code (lots of if-then-else or branches); likewise, don't expect a general purpose processor to shine when performing signal processing applications. Both can do anything, but they will be much less efficient on the tasks they are not designed for.

Beware when you are promised processors that will do everything perfectly or, to say a typical marketing jargon, "optimized" - in other words, ARM processors are good for several applications but are not perfectly tailored for everything.
« Last Edit: May 15, 2013, 01:42:47 pm by rsjsouza »
Vbe - vídeo blog eletrônico http://videos.vbeletronico.com

Oh, the "whys" of the datasheets... The information is there not to be an axiomatic truth, but instead each speck of data must be slowly inhaled while carefully performing a deep search inside oneself to find the true metaphysical sense...
 

Offline snoopy

  • Frequent Contributor
  • **
  • Posts: 767
  • Country: au
    • Analog Precision
Re: Lowcost DSP for beginner
« Reply #20 on: May 17, 2013, 05:43:23 am »
Here's a good start for you. TMS320F28335 150MHz 32 bit floating point DSP ready to go development board with breakout connectors etc all for $89 ;)

http://www.ebay.com/itm/TMS320F28335PGFA-package-176-LQFP-Development-board-TI-DSP-/151032371516?pt=LH_DefaultDomain_0&hash=item232a3b193c

Search for TMS320 on ebay and there are other boards and jtag emulators to suit ;)

Forget about dsPic. It is a toy and you will soon run out of clock cycles if you are doing serious audio processing ;)

regards
david

 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26751
  • Country: nl
    • NCT Developments
Re: Lowcost DSP for beginner
« Reply #21 on: May 17, 2013, 12:03:18 pm »
IMHO that TMS320F28335 is extremely expensive compared to an LPC4076FBD144 from NXP (according to the prices from Digikey). The LPC4076FBD144 is a 120MHz Cortex M4 controller with FPU and DSP/SIMD extensions (http://www.arm.com/products/processors/technologies/dsp-simd.php). If the 120MHz Cortex isn't enough then NXP also offers a 200MHz dual core (M4 and M0) for less money than the TMS320F28335. I stand by what I already typed before: unless you need really brutal processing power going for an ARM based controller is the best option. The C2000 may be nice but the community support is nowhere near as extensive as it is for ARM. If you need a highly optimised algorithm you stand a better chance finding one for ARM than C2000 unless you want to pay $$$.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline Harvs

  • Super Contributor
  • ***
  • Posts: 1202
  • Country: au
Re: Lowcost DSP for beginner
« Reply #22 on: May 17, 2013, 02:07:35 pm »
NXP also offers a 200MHz dual core (M4 and M0)

I know this is totally off topic, but has anyone used these?  Any good?
 

Offline snoopy

  • Frequent Contributor
  • **
  • Posts: 767
  • Country: au
    • Analog Precision
Re: Lowcost DSP for beginner
« Reply #23 on: May 18, 2013, 10:00:13 am »
IMHO that TMS320F28335 is extremely expensive compared to an LPC4076FBD144 from NXP (according to the prices from Digikey). The LPC4076FBD144 is a 120MHz Cortex M4 controller with FPU and DSP/SIMD extensions (http://www.arm.com/products/processors/technologies/dsp-simd.php). If the 120MHz Cortex isn't enough then NXP also offers a 200MHz dual core (M4 and M0) for less money than the TMS320F28335. I stand by what I already typed before: unless you need really brutal processing power going for an ARM based controller is the best option. The C2000 may be nice but the community support is nowhere near as extensive as it is for ARM. If you need a highly optimised algorithm you stand a better chance finding one for ARM than C2000 unless you want to pay $$$.

The trouble is the NXP M4's have configurable IO and are a nightmare to configure just to handle I2S. There was a discussion about this on diyaudio a while ago and it appeared to be very difficult to use :(

It's one thing having hardware that can do everything but it's another having a decent tool set to back it up ;)

regards
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26751
  • Country: nl
    • NCT Developments
Re: Lowcost DSP for beginner
« Reply #24 on: May 18, 2013, 10:42:29 am »
That is hardly an argument. Nowadays every microcontroller has multifuction I/O pins which need to be setup. You have to invest time to learn how it works but if you read the manual it is pretty simple. In NXP's user manuals each chapter describing a peripheral starts with describing how to setup the clock, power management and I/O pins and provides links to the appropriate registers settings. I've seen far worse.
« Last Edit: May 18, 2013, 10:46:00 am by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf