Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

EMBEDDED SIGNAL PROCESSING

1. How to understand digital signal processing, by switching on the front camera in


the mobile?

 Smiling in front of front camera - Video Signal Processing


 Taking Selfie - Image Processing
 Listening Music - Audio Signal Processing
 Conversation through mobile - Speech Signal Processing

In the above all four applications one thing is common. What is it?

Output is following the input


WHEN OUTPUT FOLLOWS THE INPUT THEN IT IS SIGNAL PROCESSING

Understanding Digital Signal Processing, by


switching-on the front camera In the Mobile Phone

2. To make the output to follow the input, what should we do? Why should I sample
the signal?
o If it is analog signal processing, we need a voltage follower circuit.
o If it is digital signal processing, we need to sample the signal first before
processing.
3. Why we need to sample for digital signal processing?
o Calculator in Mobile, Lucky Number divide by zero !

o Digital Programmable devices like mobile can compute / process only finite
values.
o To convert infinite values in analog to finite values in digital we need ADC.
o ADC includes (Sampling, Quantizing and Encoding)

 Sampling
 X-axis discretization
o segmenting time
 Discrete samples in x-axis (time axis “ x-axis ” )
 Quantizing
 Y-axis Segmentation
o Rounding sample values into integers [ Eg. 2.2 to 2 ]
 Integer Samples in y-axis ( Voltage axis “ y-axis”)

 Encoding
 Converting integers into binary
o 8/10/12/16-bit binary (Digital)
TO MAKE THE OUTPUT TO FOLLOW THE INPUT, USING DIGITAL PROGRAMMABLE
DEVICES LIKE MOBILE, FIRST STEP IS TO DIGITIZE THE ANALOG SIGNAL FROM
MICROPHONE (ONE DIMENTIONAL(1D) SIGNAL PROCESSING) OR CAMERA (TWO
DIMENTIONAL (2D) SIGNAL PROCESSING)

THE WHOLE WORLD IS ANALOG!


THE WHOLE PROCESSING WORLD IS DIGITAL!
Understanding the need for sampling for Digital Signal
Processing, by using calculator In the Mobile Phone

4. If output should follow the input, how many samples to take? Answer it by looking
at the image below?

 From the image it is clear that more the samples, better the quality of
video/image/audio/voice.
 There is a standard called Nyquist sampling theorem (Fs>=2Fm)!
 Speech is 4kHz, According to Nyquist sampling theorem Fs=8kHz, to play one second
voice! (Standardized for all telephones !)
 Audio is 20kHz, Fs=40kHz. Sampling rate is standardized as 44.1kHz (i.e) 44,100
samples need to be processed in one second to reconstruct one second audio !
 If we do not follow Nyquist Sampling theorem, reconstruction results in aliasing!
TO RECONSTRUCT ONE SECOND SPEECH FROM MICROPHONE IN LOUD SPEAKER
8000 SAMPLES/SEC NEED TO BE TAKEN. SIMILARLY FOR AUDIO 44,100
SAMPLES/SEC.
5. From the above discussion we understood that, Digital Signal Processor should
take 44,100 samples from microphone, processes it and give back 44,100+
samples to loud speaker after converting back to analog. Isn’t it?
o Yes, the following diagram justifies this statement by taking the voice through
microphone which is analog x(t), converted to digital using ADC x[n], processed
using digital signal processor x[n] * h[n] and giving back the digital values y[n] to
DAC to get the analog output from DAC y(t), which is given to loud speaker.

Microphone X(t) ADC x[n] h[n] y[n] DAC y(t) Loudspeaker

6. If so, then what does the digital signal processor do?


o To understand this, let us play a song using Windows Media Player / VLC player,
Open the equalizer an adjust the knobs as shown in the following diagram and
find out what changes are happening in the loud speaker?

7. Fig.1: Audio Equalizer of VLC Player with Flat Preset


(a) (b)
Fig.2: Audio Equalizer of VLC Player with (a) Full Bass and (b) Full Treble Preset

From the above figures, it is understood that the audio equalizers are multiple band pass
filters of 10-band of frequencies (60,170,310,600,1k,3k,6k,12k,14k,16k)Hz within the
audible range (20Hz-20kHz). From this equalizer, it is clear that digital signal processor is
doing filtering.

Skin instruments produce low frequency music (BASS) which has to be reconstructed
using WOOFERS
String instruments produce high frequency music (TREBLE) which has to be
reconstructed using TWETERS
Human produce mid frequency voice which has to be reconstructed using SQUAKERS

Loud speakers are available as 2.1, 5.1 etc., 2/5 indicates 2/5 speakers, 1 indicates 1
woofer. Woofers are the devices which reconstruct low frequency; speakers are the
devices which reconstructs high frequency.

Understanding Digital Signal Processing is filtering by


playing a song in VLC player

6. What is analog low pass filter?


A filter which allows low frequency and attenuates high frequency is low pass filter, R in
parallel with C.

Note: This is first order analog low pass filter. Number of storage element decides the
order of the filter. Here there is one storage element which is capacitor; hence it is first
order filter. If the order „n‟ increases, performance of the filter increases!
7. What is digital low pass filter?
A digital low pass filter is set of numbers, which does some mathematical operation on
the input set of numbers to give another set of numbers in the output. Digital filter is a set
of numbers.

8. Digital filter is called as what? in signal processing terms


Digital filter is called as impulse response h[n] in signal processing terms.

9. Input signal is represented as what? in signal processing terms?


Input signal is represented as x[n] in signal processing terms.

10. Output signal is represented as what? in signal processing terms?


Output signal is represented as y[n] in signal processing terms.

11. How signal processing is represented?


y[n]= x[n] * h[n]
12. What does the symbol “*” denotes?
The symbol “*” denotes convolution.

13. Is convolution is filtering?


Yes

14. Justify how convolution does low pass filtering?


x[n] = [1 1 1 1] ; h[n] =[1 1] ; then y[n]= x[n]*h[n]; Therefore y[n]=[1 2 2 2 1] . The output is
similar to low pass filter output. (ie) Two step signal produces a triangle output, which is
addition/accumulation/integration/low pass filtering.

Note: h[n] values are filter coefficients. Number of coefficients decides the order of the
filter. Here there are two coefficients; hence it is first order digital low pass filter.

15. Justify how convolution does high pass filtering?


x[n] = [1 1 1 1] ; h[n] =[1 -1 ] ; then y[n]= x[n]*h[n]; Therefore y[n]=[1 0 0 0 -1] . The output
is similar to high pass filter output. (i.e)The output is spike at both edges, which is
difference/derivative/high pass filtering.

Note: The above two filters are first order digital low and high pass filters. Number of
storage element decides the order of the filter. In digital filter the storage element is filter
coefficient. There are two storage elements „h[n]‟. The order of the digital filter is number
of coefficients -1. Therefore 2-1=1. Both the low pass and high pass filters are first order
filters. Increasing the order means increasing the coefficients.

16. What is the significance of convolution / digital filtering? Justify.

Just by changing the sign of h[n], low pass filter has become high pass filter! Here
without resistors and capacitors it is possible to get the same result using just
h[n]. For h[n] we no need to pay anything! (no need to pay for filter coefficients
(nos.)) This is the secret of digital filters!

Justification1: VLC player is some form of h[n] with graphics user interface (GUI)front
end, which play audio and video. For VLC player we never pay!!!! because of numbers.

Justification2: All the songs are some form of numbers x[n]; while playing, this song
x[n] is convolved with, h[n] ( VLC Player ), produces y[n] which is again a set of numbers,
when given to a loud speaker through DAC (codec) it produces pleasant music. For this
song also; we never pay!!!!

Justification3: Whatsapp. speech, Whatsapp audio, Whatsapp images, Whatsapp


videos, Whatsapp doc., etc., are numbers(digital), hence all are free. This word file is
free, hence I am sending you for free of cost !!!, Because the transportation charge is
also free(1.5GB internet/day is free)

BECAUSE OF DIGITAL
“SONG IS FREE”
AS WELL AS
“VLC PLAYER ” IS ALSO FREE !

ARCHITECURE AND PROGRAMMING OF DIGITAL SIGNAL PROCESSOR

1. How to realize convolution / digital filter?

Convolution / filtering is Sum-of-Product (SOP); Multiplication, shifting and addition.

2. What is the frequency of the speech signal? For collar mike example, how the
input signal is processed using digital signal processor?

All human being maximum voice frequency is up to 3.3kHz which is approximated as


4kHz. According to Nyquist sampling theorem sampling frequency of voice signal is
Fs=8kHz. To reconstruct the same voice back in loud speaker, we need to take 8000
samples/sec, then it has to be converted to digital x[n], then all the 8000 samples needs
to be convolved with digital filter with filter coefficients h[n] to produce y[n], then y[n] must
produce y(t) using DAC then it should be given to loud speaker to reconstruct the
amplified/filtered voice. This is a good example for real time signal processing.
3. What is real time signal processing? Give examples.
Processing happens at the same moment of time then it is real time signal processing.
Eg.1: Viewing Live Cricket Match in TV (Real Time Multimedia signal processing)
Eg.2: The conversation in mobile phone is a good example for real time signal
processing. Voice signal from the calling subscriber are processed immediately and
transmitted. Received voice signal is given to the called subscriber‟s loud speaker (Real
time speech signal processing).
Eg.4 Listening to FM is real time real time audio signal processing!
Note: Real time signal processing needs no memory !

CHALLENGES AND SOLUTIONS IN SIGNAL PROCESSING


4. What are the challenges and solutions in performing signal processing in real
time.
CHALLENGE-1: The processing element in conventional processor is ALU. The basic
building block of ALU is Full Adder. Hence, ALU performs the multiplication by repeated
addition. If so, consider this signal processing example, where x[n] is 16-bit and h[n] is
16-bit. The maximum unsigned 16-bit value is h[n]=0XFFFF; x[n] =0xffff; For performing
convolution x[n] need to be multiplied with h[n] (ie) 65,535 X 65535 . To do this
multiplication in conventional processor, 65,535 is added with 65,535, 65,535 times. If
every addition takes 1micro second then one 16-bit multiplication takes 65,535
microsecond. For 8000 such multiplications; 8000 x 65.535 microsecond = 520 seconds
approximately!. (ie) to process one second speech signal it takes more than 8 minutes by
conventional microprocessors or controllers. Hence they are not suitable for real time
signal processing applications. This is challenge no.1.

SOLUTION_1: Hardware Multiplier and Accumulator (MAC) unit. The processing


element in the Digital Signal Processor should do convolution / sum of product in real
time. Hardware Multiplier can perform the 16x16 bit multiplication in one machine cycle.
For a 52nd order filter, 52 taps are needed, which is 52-mulitplications. These 52 products
need to be added to get every y[n]. For adding these products we need an adder. Hence
a Hardware Multiplier and Adder can do sum of product, which is convolution / signal
processing. In short this hardware multiplier and adder is called as Multiplication and
Accumulation Unit (MAC). MAC do the sum of product/convolution/signal processing in
real time. Presence of hardware MAC unit eliminates the computational complexity in
signal processing.

16x16 bit Hardware multiplier, multiplies two 16-bit numbers in hardware directly (not like
conventional repeated addition which takes much time) in one machine cycle to product
32-bit product. Eg. Two 16-bit numbers(0xffff x 0xffff) can be multiplied in one machine
cycle in hardware multiplier, but in conventional multiplication 65536 repeated addition
will happen for one multiplication which takes 65535 machine cycle. From this example it
is clear that, the presence of hardware multiplier saves 65535 machine cycles for every
multiplication. For more than 8000 multiplications/sec. just for speech signal processing;
hardware multiplier saves 8000 x 65535 = 52,42,800 microseconds per second, when
compared with conventional repeated addition. This is extraordinary performance
improvement in speed and is suitable for real time signal processing.
From this example, it is clear that, any processor / controller which has on-chip hardware
MAC unit, performs real time signal processing. Therefore the processing element inside
the digital signal processor is hardware MAC.

Understanding processing element in Digital Signal


Processor by listening Macourina song from Gushi Movie !
is filtering by playing a song in VLC player
Challenge-2: For real time speech signal processing 8000 16-bit multiplication should
take place in one second. For this 8000 operations, 8000 instructions should be fetched
in one second. 8000 16-bit x[n] from ADC should reach Hardware MAC through Data
Memory in one second; 8000 16-bit h[n] (filter coefficients from Program Memory) has to
come from corresponding memory location to processing element(Hardware MAC);
8000, 32-bit product, should go DAC through Data Memory. Totally 32,000 transfers
must take place for one second speech signal processing!. For audio signal
processing, 44100x4=1,76,400 transfers should take place!!!!. How to do such
mass transportation between memory and processor? This is challenge no. 2.

Solution-2: Modified Harvard Architecture. In modified Harvard architecture there are


four pairs of busses, for four simultaneous signal processing transfer requirements. The
Figure below shows the Harvard Architecture of TMS320C54xx, with 4 pairs of busses.
The functions of these busses are described below:

 To address the opcode in the program memory, dedicated address bus is used,
which is called as PAB (Program Memory Address Bus), To fetch the opcode
from the Program memory, dedicated bus is used, which is called as PB (
Program Data Bus).
 To address the coefficient h[n] in program/data memory, dedicated address bus is
used, which is called as CAB ( Coefficient Address Bus), To read the coefficient
from the Program/Data memory, dedicated data bus is used, which is called as
CB ( Coefficient Data Bus).
 To address the input data x[n] from data memory, dedicated address bus is used,
which is called as DAB ( Data Address Bus). To read the in data from the Data
memory, dedicated data bus is used, which is called as DB ( Data Bus).
 To address the data memory, for storing the convolved output y[n], dedicated
address bus is used, which is called as EAB ( Executed Address Bus), To store
the convolved output fetch the opcode to the Data memory, dedicated data bus is
used, which is called as EB ( Executed Data Bus).
Challenge-3: What is the challenge in storing the content of the MAC output?
Multiplication of two 16-bit numbers result in 32-bit number. For successive multiplication
and addition, the Accumulator (result register) size must be larger to prevent overflow.

Solution-3: There are two 40-bit accumulators, with lower order 16-bit, higher order
16-bit and 8-Guard bits, which can manage 255, 32-bit overflows!!!!

Challenge-4: How to normalize the input? Solution-4: By using Barrel shifter!


The barrel shifter is used for scaling operations such as:
 Pre-scaling and input data-memory operand or the accumulator value
before an ALU operation
 Performing a logical or arithmetic shift of the accumulator value
 Normalizing the accumulator
 Post-scaling the accumulator before storing the accumulator value into
data memory.
Challenge-5: Storing the floating point numbers in fixed point processors? Solution-5:
Using Q15 Representation

5. How to perform addition, multiplication and linear convolution and filtering


using TMS320C54xx Digital Signal Processor.

Please refer all the video materials which was shared !

You might also like