Q: Sample and Hold doesn't seem to be mentioned much nowdays - is this because of the much faster conversion rate of modern A/D converters? Have you any advice on when to use S/H? Thanks Gerry
Yes, as you point out S/H is not mentioned much nowadays. This is because the A/D converters are much faster and also nowadays most A/D converters have built-in S/H circuits. You can however purchase S/H units if you think your signal is varying fast and your A/D converter is slow.
Q: Every 1 mS we will check the ouptput for ADC?
Yes. if your sampling frequency is 1kHz then you must setup an interrupt service routine (ISR) for 1ms interrupts, and inside the ISR read the A/D converter data. Then process the data and send the output sample to the D/A converter.
Q: Why still use PIC microcontrollers when we have ARM?
PIC microcontrollers is just an example. As you mention, you can use the ARM microcontrollers (or dsPIC) for faster sampling time and thus for higher frequency signal processing. But the theory is still he same.
Q: Important to say why you might choose digital vs analogue....the analogue components suffer drift
There are many reasons why you should choose digital filtering instead of analog. Some of the reasons are:
- You can set the cut-off frequency with precision with digital filters. But, analog components have tolerances and they drift by aging and also by temperature changes. Thus, the cut-off frequency drifts.
- In digital filters the stop-band attenuation can be set to be very high.
- Analog filters with very low cut-off frequencies require large capacitors and inductors. Digital filters do not have these problems.
- Its very easy to change the characteristics of a digital filter. All you have to do is re-program the chip. With analog devices you will have to use new different components.
- Because of the component tolerances it may be hard to achieve flat pass-band response in analog filters. Digital filters on the other hand can be designed to have complete flat pass-bands.
- Digital filters can be designed to have symmetrical step-responses. i.e. they can be designed (e.g. FIR filters) to have linear phase responses, and at the same time have large attenuation in the stop-band. It is however much harder to get linear phase responses from analog filters (unless Bessel filter is used, which has small attenuation in the stop-band).
- Most electronic devices already have digital processors built-in (e.g. mobile phone, tablet etc). It is very easy to add DSP capabilities to these devices as all we have to do is create programs for the required DSP operations.
Q: Main difference between DSP Processor and DSP Engine of MCU. What are the main limitations in microcontrolller?
The main limitation of the microcontrollers is the speed. MCUs with DSP engines are designed for fast signal processing operations. These MCUs have special architectures to speed-up the DSP operations. For example. the multiply and accumulate (MAC) is the most common operation in DSP. These processors have special instructions to fast multiply and accumulate in a single instructions. Additionally, fast registers and shift-registers are provided to manipulate the data. For low speed audio applications you can use standard processors such as PIC or 8051 series. For higher performance you can use dsPIC or ARM processors. If you require video processing or hi-fi audio processing then you should go for the dedicated DSP processord (e.g. Texas TMS series).
Q: Hi, What about using a PWM channel for D/A converter?
Yes, you can use PWM insetead of a D/Z, but the problem is that if the shape of the signal is important, such as in ECG applications, then you must use a proper D/A converter. In applications, such as low quality audio where the shape of the waveform may not be important, you can certainly use PWM channels.
Q: Why still use PIC microcontrollers in DSP when we have low-powered and faster ARM microcontrollers?
PIC is just an example. We are not saying that you should use PIC. You can, as you mention use ARM processors (or dsPOIC) for much higher performance. But the point is that the theory is the same.
Q: Dogan - could you say something on oversampling please. Thanks Gerry
If the sampling rate is higher than the Nyquist rate (i.e. twice the highest frequency in the signal) then this is called oversampling. If on the other hand the sampling rate is lower than he Nyquist then this is called undersampling (must be avoided). If the sampling rate is exactly equal to the Nyquits rate then this is called critical sampling. Oversampling is not a problem in DSP if you can actually sample it. Another place where oversampling is used is with fast A/D converters in order to avoid the design of anti-aliasing filters with sharp cut-off frequencies.. Here, the oversampling approach relaxes the requirement for sharp cut-off frequency requirements for the anti-aliasing filters, thus resulting in the design of simple anti-aliasing filters (imagine if we use twice the sampling frequency, then the anti-aliasing filter must have very sharp stop-band attenuation in order to stop high frequency signals reaching the A/D converter).
Q: How narrow a filter is practical with a PIC or similar micro? Could filters measured in single Hz be possible?
It all depends on what type of processor and arithmetic you are using. With PIC18F microcontrollers, using 40MHz clock, we have 16MIPS operation. If we use floating point arithmetic with C programming, then the sampling rate can be up to about 10kHz. If on the other hand we use fixed-point arithmetic with part of the code in assembly language we can get much higher sampling rates. You can design very narrow-band digital filters as long as you obey the Nyquist criteria.
Q: Would you prefer dsp audio processing over a valve response? Can the two work together?
DSP processing requires very complex processors, either microcontrollers, or complex dedicated microprocessors. Audio processors with very high quality sound (hi-fi) can certainly be designed using DSP algorithms and processors. I would prefer them to valve response.
Q: What abouth FPGA's to do filtering
Yes, FPGA can also be used in DSP work. There are many references and books in this field. A book reference is given below:
Digital Signal Processing with Field Programmable Gate Arrays by: U Meyer-Baese (check Amazon)