DSPRelated.com
Forums

DSP chips vs. microcontrollers

Started by Jason Hsu September 3, 2003
Jason Hsu wrote:

> The DSP/microcontroller will be monitoring the audio output and thus > act like an electronic ear. This audio output will be either Morse > Code beeps or voice signals. I assumed that the signals will be > sufficiently narrowband to avoid contributing greatly to the noise > integral. But now that you brought some issues up, it sounds like it > would be a good idea to throw out the spikes in the noise integral > (such as the top 1%, 2%, or 5% of the data). Is this possible?
Yes, you want to do that. compute the mean noise level and replace all peaks with the mean, leaving anything below twice the mean alone.
> I might use a combination of DSP AND microcontrollers.
That would be overkill I think, but it's certainly possible.
> How quickly can microcontrollers respond? I have a DSP kit that can > sample up to 19,200 samples per second. So according to Nyquist, this > means it can be accurate up to around 8500 Hz. This should be plenty.
Depends on the micro. Any game processor would be more than fast enough, and probably something like a Mot 568xx running at 40 to 50 MHz would work just fine as well. A 100 MHz 68hc16 type processor would work fine too. Cost of tools and type of programming you do are factors too. If you work in assembler, you can push a slower cheaper device to do the job, if you program in java you'll need a lot more power.
> The main reason I would prefer to use microcontrollers is the space > efficiency. A microcontroller is a programmable IC chip - I stick it > into the computer interface, download the program into it, and then > insert it into the circuit. The DSP board is MUCH bulkier, and has to > be mounted precisely due to the DB9 port on it. The DB9 port is > already attached to the board, and it isn't round. In other words, > the microcontroller solution would be MUCH easier for me to implement.
Internal flash is nice, but it's slow. Another option is to use external flash to "boot" your processor that has fast internal static ram. It's still reprogrammable, but you get higher operating speed. There are a lot of development boards out there that do this, there should be one you can copy with just the stuff you need so the board size is small. Patience, persistence, truth, Dr. mike -- Mike Rosing www.beastrider.com BeastRider, LLC SHARC debug tools
I have never before worked with either DSP hardware or
microcontrollers.

What are the advantages of using DSP hardware over using a
microcontroller to perform DSP functions?

What I am trying to do is measure the audio noise level (one part of
an ambitious project).  One idea I have is to use DSP hardware to
digitize the audio input, do a DFT on it, integrate over the DFT, and
use the sum of this integration as the noise level measurement. 
Another idea is to perform the same function with a microcontroller.

What are the advantages of one approach over the other?

Jason Hsu, AG4DG
usenet@@@@jasonhsu.com
I have never before worked with either DSP hardware or
microcontrollers.

What are the advantages of using DSP hardware over using a
microcontroller to perform DSP functions?

What I am trying to do is measure the audio noise level (one part of
an ambitious project).  One idea I have is to use DSP hardware to
digitize the audio input, do a DFT on it, integrate over the DFT, and
use the sum of this integration as the noise level measurement. 
Another idea is to perform the same function with a microcontroller.

What are the advantages of one approach over the other?

Jason Hsu, AG4DG
usenet@@@@jasonhsu.com
On Wed, 03 Sep 2003 19:26:06 -0700, Jason Hsu wrote:

> I have never before worked with either DSP hardware or > microcontrollers. > > What are the advantages of using DSP hardware over using a > microcontroller to perform DSP functions?
The DSP can compute the numerical parts of your application faster than the microcontroller can. Because that's what it's designed to do. You might also find that DSPs have more of the "right sort" of integrated peripherals, compared to microcontrollers. Like I^2S ports, for talking to serial codecs, and DMA engines to reduce the interrupt overhead of doing IO with those codecs.
> What I am trying to do is measure the audio noise level (one part of an > ambitious project). One idea I have is to use DSP hardware to digitize > the audio input, do a DFT on it, integrate over the DFT, and use the sum > of this integration as the noise level measurement. Another idea is to > perform the same function with a microcontroller.
If you get a different answer from integrating over the DFT output, compared to integrating the time-domain signal, then you're doing something wrong :-) Or, more specifically, you've probably left the part where you apply various filters or thresholds in the frequency domain, to limit what you're integrating over, noise vs non-noise.
> What are the advantages of one approach over the other?
There aren't two approaches. It's one approach with a choice of numerically-oriented or numerically-challenged processors. Seems pretty easy... Since you're looking at audio noise levels, you could also just use a sound card in a PC: they're faster than most individual DSPs these days. You would only go with the embedded project if (a) you really wanted to, or (b) you needed more portability or lower power consumption than you can get from a PC. If you go embedded: most DSP manufacturers will sell you an evaluation board with a DSP chip, an audio codec and development tools of some sort for not many hundreds of dollars. That could save you from building your own, too. Cheers, -- Andrew
I see I didn't provide enough details about my project.

It's an automatic noise canceller, and it is intended to be a
stand-alone device that does NOT require a computer to operate.

The feedback will control servo motors.  The servo motors will control
the potentiometer and variable capacitor, the two things used to
adjust the noise canceller for minimum noise.

The parameter to be measured and controlled is the noise level.  My
ideas are:
1.  Use a DSP board to obtain a DFT and then integrate with respect to
frequency.  The sum of this integration is the approximate noise
level.  The premise of all this is that the noise is broadband while
the signals have such narrow bandwidth that they do not significantly
contribute to the sum of the integration.
2.  Use a microcontroller to do the same thing.

Jason Hsu, AG4DG
usenet@@@@jasonhsu.com
jason_hsu@my-deja.com (Jason Hsu) wrote in message news:<f7d9a152.0309041731.7b391202@posting.google.com>...

> The parameter to be measured and controlled is the noise level. My > ideas are: > 1. Use a DSP board to obtain a DFT and then integrate with respect to > frequency. The sum of this integration is the approximate noise > level. The premise of all this is that the noise is broadband while > the signals have such narrow bandwidth that they do not significantly > contribute to the sum of the integration.
I'm a bit confused here. Do you mean that you consider the signal itself as part of the noise integral? If so, how do you ensure that whatever you do to remove the noise, doesn't remove the signal as well? Or do you want to subtract the narrow-band signal from the integral? If so, did you consider _how_ to remove it? Do you know at what frequency the signal is? Do you know how stable the center frequency of the signal is? Do you know the bandwidth of the signal? Do you know if the Signal to Noise Ratio (SNR) is high or low? I am asking because if you don't have prior knowledge of these kinds of parameters, you may want to estimate them from the observed data. Of course, in the case of a stable, narrow-band line in a low-noise environment, you could integrate the spectrum and remove the one or two bins of highest magnitude. Now, if the narrow-band line is a bit broader than one or two bins, if the center frequency tends to vary with time, if the SNR is such that you have problems finding the correct signal peak in the spectrum... Depending on how complicated your problem turns out to be (and the scope of your project), we may be talking about a completely different numerical job than merely computing an FFT and an integral. All of this leans towards using a numerically adept DSP chip. However, you said...
> The feedback will control servo motors.
...which may lean towards the microcontroller chip which, with its more general instruction set, is better suited to control peripheral devices. It's not obvious what to choose. Rune
allnor@tele.ntnu.no (Rune Allnor) wrote in message news:<f56893ae.0309050308.7164e8c5@posting.google.com>...
> jason_hsu@my-deja.com (Jason Hsu) wrote in message news:<f7d9a152.0309041731.7b391202@posting.google.com>... > > > The parameter to be measured and controlled is the noise level. My > > ideas are: > > 1. Use a DSP board to obtain a DFT and then integrate with respect to > > frequency. The sum of this integration is the approximate noise > > level. The premise of all this is that the noise is broadband while > > the signals have such narrow bandwidth that they do not significantly > > contribute to the sum of the integration. > > I'm a bit confused here. Do you mean that you consider the signal itself > as part of the noise integral? If so, how do you ensure that whatever you > do to remove the noise, doesn't remove the signal as well? >
The DSP/microcontroller will be monitoring the audio output and thus act like an electronic ear. This audio output will be either Morse Code beeps or voice signals. I assumed that the signals will be sufficiently narrowband to avoid contributing greatly to the noise integral. But now that you brought some issues up, it sounds like it would be a good idea to throw out the spikes in the noise integral (such as the top 1%, 2%, or 5% of the data). Is this possible? I might use a combination of DSP AND microcontrollers. How quickly can microcontrollers respond? I have a DSP kit that can sample up to 19,200 samples per second. So according to Nyquist, this means it can be accurate up to around 8500 Hz. This should be plenty. The main reason I would prefer to use microcontrollers is the space efficiency. A microcontroller is a programmable IC chip - I stick it into the computer interface, download the program into it, and then insert it into the circuit. The DSP board is MUCH bulkier, and has to be mounted precisely due to the DB9 port on it. The DB9 port is already attached to the board, and it isn't round. In other words, the microcontroller solution would be MUCH easier for me to implement. Jason Hsu, AG4DG usenet@@@@jasonhsu.com
jason_hsu@my-deja.com (Jason Hsu) wrote in message news:<f7d9a152.0309050917.ce21f8b@posting.google.com>...
> allnor@tele.ntnu.no (Rune Allnor) wrote in message news:<f56893ae.0309050308.7164e8c5@posting.google.com>... > > jason_hsu@my-deja.com (Jason Hsu) wrote in message news:<f7d9a152.0309041731.7b391202@posting.google.com>... > > > > > The parameter to be measured and controlled is the noise level. My > > > ideas are: > > > 1. Use a DSP board to obtain a DFT and then integrate with respect to > > > frequency. The sum of this integration is the approximate noise > > > level. The premise of all this is that the noise is broadband while > > > the signals have such narrow bandwidth that they do not significantly > > > contribute to the sum of the integration. > > > > I'm a bit confused here. Do you mean that you consider the signal itself > > as part of the noise integral? If so, how do you ensure that whatever you > > do to remove the noise, doesn't remove the signal as well? > > > The DSP/microcontroller will be monitoring the audio output and thus > act like an electronic ear. This audio output will be either Morse > Code beeps or voice signals. I assumed that the signals will be > sufficiently narrowband to avoid contributing greatly to the noise > integral. But now that you brought some issues up, it sounds like it > would be a good idea to throw out the spikes in the noise integral > (such as the top 1%, 2%, or 5% of the data). Is this possible?
I think you would want to keep _something_ out of the noise estimate. Otherwise, you run the risk of making a very elaborate "off" switch. Remember, the easiest way to remove noise is to turn the reciever off. Of course, you don't want to do that because something is coming through that you want to keep. Rune
Mike Rosing <rosing@neurophys.wisc.edu> wrote in message news:<3F569D73.90804@neurophys.wisc.edu>...
> > Depends on the micro. Any game processor would be more than fast enough, > and probably something like a Mot 568xx running at 40 to 50 MHz would > work just fine as well. A 100 MHz 68hc16 type processor would work fine > too. Cost of tools and type of programming you do are factors too. If > you work in assembler, you can push a slower cheaper device to do the job, > if you program in java you'll need a lot more power. >
How do I tell how much RAM, ROM, etc. I need? I realize that the speed of the motors that my device will be controlling could limit the speed of the device, so there's no need for overkill.
> > Internal flash is nice, but it's slow. Another option is to use external > flash to "boot" your processor that has fast internal static ram. It's > still reprogrammable, but you get higher operating speed. There are a > lot of development boards out there that do this, there should be one > you can copy with just the stuff you need so the board size is small. >
What are internal flash and external flash? Jason Hsu, AG4DG usenset@@@jasonhsu.com
jason_hsu@my-deja.com (Jason Hsu) wrote in message news:<f7d9a152.0309050917.ce21f8b@posting.google.com>...

> The DSP/microcontroller will be monitoring the audio output and thus > act like an electronic ear. This audio output will be either Morse > Code beeps or voice signals.
> Jason Hsu, AG4DG
Something with this thread has been quite confusing, I think there is something cruical I have been missing. What is the application? For some reason I have been thinking in terms of the usual digital filters that remove the noise and leave the signal. However, I don't think your noise removal apparatus is supposed to work that way. Could you explain exactly what this thing is supposed to do, and what other equipment you will use with it? Somehow I get the impression of a radio amateur who wants a electronug gadget to control some tuning circuit so as to recieve as little noise as possible with the kit? In that case, forget everything I said about estimating signal parameters. What you need is probably a micro controller capable of running the peripherals, but that has some maths capability. You don't need to compute any DFTs to estimate the noise power, just to integrate the energy (samples squared) over some sliding window in time domain. Rune