Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
10 views8 pages

Lab Manual 07

This document outlines Experiment No. 7 for the Digital Signal Processing Lab at Air University, focusing on interfacing the TLV320AIC23 codec and performing linear convolution. It includes objectives, required equipment, background knowledge, and detailed steps for conducting the experiment, including coding instructions and expected outputs. The lab tasks involve reading an analog signal, converting it to digital, and performing linear convolution on specified signals.

Uploaded by

Bismah Asif
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views8 pages

Lab Manual 07

This document outlines Experiment No. 7 for the Digital Signal Processing Lab at Air University, focusing on interfacing the TLV320AIC23 codec and performing linear convolution. It includes objectives, required equipment, background knowledge, and detailed steps for conducting the experiment, including coding instructions and expected outputs. The lab tasks involve reading an analog signal, converting it to digital, and performing linear convolution on specified signals.

Uploaded by

Bismah Asif
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

AIR UNIVERSITY

Department Of Electrical And Computer Engineering


Experiment No : 7

Lab Tittle : XXXXXX

Name: XXXXXXXXX Reg No:

Objectives: XXXXXXXX

LAB ASSESSMENT:

Excellent Good Average Satisfactory Unsatisfactory


Attributes
(5) (4) (3) (2) (1)
Ability to Conduct
Experiment
Ability to assimilate the
results
Effective use of lab
equipment and follows the
lab safety rules

Total Marks : Obtained Marks :

LAB REPORT ASSESSMENT:


Excellent (5) Good Average Satisfactory Unsatisfactory
Attributes
(4) (3) (2) (1)

Data presentation

Experimental results

Conclusion

Total Marks: Obtained Marks:

Date: March 3, 2025, Signature: Maryam

1|Page
Department of Electrical and Computer Engineering

Digital Signal Processing Lab

LAB REPORT : 7

Tittle : xxxxxx

Name : Write Your Own Name

Roll No: Write Your Own Roll. No

Submitted To : CE . Engr Maryam

Date : 3rd March 2025

2|Page
LABORATORY
EXPERIMENT NO. 7

INTERFACING TLV320AIC23 CODEC and Linear Convolution

Objectives:

• Introducing students to AIC23 Codec in DSK


• Generation of sinusoidal waveform through a lookup table and displaying output on
oscilloscope
• Using AIC23 codec to take real time input signal from Function Generator and display the
waveform on oscilloscope

Equipment required:

• C6713 DSK
• Power Cable
• USB Cable
• Code Composer Studio v5.1.0
• Function Generator
• Oscilloscope

Background Knowledge:
Sine Wave Generation using Interrupt:
The code given below reads real time input signal from the function generator, passes it through
ADC and DAC and then displays the output on oscilloscope.
#include "DSK6713_AIC23.h" //codec support
Uint32 fs=DSK6713_AIC23_FREQ_8KHZ; //set sampling rate
#define DSK6713_AIC23_INPUT_MIC 0x0015
#define DSK6713_AIC23_INPUT_LINE 0x0011
Uint16 inputsource=DSK6713_AIC23_INPUT_LINE; //select input
interrupt void c_int11() //interrupt service routine
{
short sample_data;
sample_data = input_left_sample(); //input data
output_left_sample(sample_data); //output data
return; } void main()
{
comm_intr(); //init DSK, codec, McBSP
while(1); //infinite loop }

3|Page
In function main() , comm_intr() function is initialized which initializes the DSK, codec, and
McBSP, and sets up interrupts such that the AIC23 codec will sample the analog input signal
and interrupt the C6713 processor, at the sampling frequency defined by the line Uint32
fs=DSK6713_AIC23_FREQ_8KHZ; //set sampling rate. It also initiates communication with the
codec via the McBSP. For example, when sampling rate is 8 kHz an interrupts will occur every
0.125 ms. (Sampling rates of 16, 24, 32, 44.1, 48, and 96 kHz are also possible.) Following
initialization, function main() enters an endless while loop, doing nothing but waiting for
interrupts. The functions that will act as interrupt service routines for the various different
interrupts are specified in the interrupt service table contained in file vectors_intr.asm. This
assembly language file differs from the file vectors_poll.asm in that function c_int11() is
specified as the interrupt service routine for interrupt INT11. On interrupt, the interrupt service
routine (ISR) c_int11() is called and it is within that routine that the most important program
statements are executed.
Other AIC23 configuration settings are determined by the parameters specified in file
c6713dskinit.h. The two settings, sampling rate and input source, are changed sufficiently
frequently, from one program example to another, that their values are initialized as fs and
inputsource. In function dsk6713_init() in file c6713dskinit.c, these values are used by functions
DSK6713_AIC23_setFreq() and DSK6713_AIC23_rset(), respectively. A variable is declared in
dsk6713init.h file which may be handled either as one 32-bit unsigned integer (AIC_data.uint)
containing left and right channel sample values, or as two 16-bit signed integers
(AIC_data.channel[0] and AIC_data.channel[1]). Most of the program examples use only one
channel for input and output and for clarity most use the functions input_left_sample() and
output_left_sample(). These functions are defined in the file c6713dskinit.c, where the
unpacking and packing of the signed 16-bit integer left channel sample values out of and into the
32-bit words received and transmitted to and from the codec are carried out.
Input and Output Functions Defined in Support File c6713dskinit.c:
The functions input_left_sample() , output_left_sample() , comm_poll(), and comm_intr() are
defined in the support file c6713dskinit.c. This way the C source file loop_intr.c is kept as small
as possible and potentially distracting low level detail is hidden. Further calls are made by
input_left_sample() and output_left_sample() to lower level functions contained in the board
support library DSK6713bsl.lib. Within the function input_sample, support functions from the
BSL are included to read a 32-bit data. The function input_sample captures 32-bit data, 16 bits
from the left input channel and 16 bits from the right input channel. The union statement is used
to process each channel independently. The union of AIC23_data contains these 32-bit input
data. The line of code for output is from the left channel (by default) to output 16-bit data from
the left input channel.
Visualizing Output on Oscilloscope:
Compile and load the program onto the DSK and run it. Connect the signal generator to one end
of the stereo audio cable and plug the other end into the line-in jack on the DSK (J303). Plug the
second cable into the line-out jack on the DSK (J304) and the other end to oscilloscope channel
1. (Make sure that the oscilloscope is calibrated beforehand). Set the signal generator to a 1KHz
sinusoid with amplitude 1Vpp (peak-to-peak voltage) and observe a 1KHz sinusoid on
oscilloscope.
Change the peak-to-peak voltage and the frequency on the signal generator and observe the
effects on the oscilloscope. If the voltage input to the codec exceeds 3.3V, then the codec will be

4|Page
overdriven. When the codec is overdriven, the output on the codec will reveal either amplitude
clipping of the input sine wave. If the voltage input is too small (around 100mV or less), then
coupling effects from the internal hardware will be observed. For frequency, keep in mind that
there is a lowpass filter that cuts off frequencies above 4KHz. Vary the frequency of the sinusoid
on the signal generator and observe that sinusoids above 4KHz are suppressed. (Note that
sinusoids around 4KHz are decreased in amplitude, but not fully suppressed. This is due to the
fact that the anti-aliasing filter is not ideal and therefore has a non-zero roll-off around 4KHz.)

Linear Convolution?
Linear convolution is a fundamental operation in Digital Signal Processing (DSP) that combines
two discrete-time signals to produce a third signal. It describes how an input signal x[n] interacts
with an impulse response h[n] to generate an output y[n]].
Mathematically, linear convolution is defined as:

Conceptual Understanding
1. Flip h[n]: The impulse response is flipped in time.
2. Shift h[n]: It is moved along the n-axis and multiplied with x[n].
3. Sum the Products: The sum of element-wise multiplication for overlapping regions
gives the result at each n.

Steps in code composer studio :


1. Initialize Input Signals:
o x[] = {1, 2, 3} → Input signal.
o h[] = {4, 5, 6} → Impulse response.
2. Compute Convolution:
o Iterate over all possible output indices nnn.
o Multiply and sum overlapping values from x[n] and h[n].
3. Store & Print the Result:
o The output is printed on the CCS console.

Steps of Implementation :
User Input Handling :
• The user enters x[n] and h[n] values dynamically.
Nested Loop for Convolution :
• The outer loop iterates over the output index y[n].
• The inner loop performs the sum-product calculation:

Output Display :
• The result is printed as one-dimensional discrete values, corresponding to the convolved
sequence.

5|Page
BCE-F-22-A DSP LAB

Lab Tasks:

1. Write a code in CCS to read analog input from the function generator, converts it to digital signal
and then converts it back to analog signal. Display the results on oscilloscope.
The input signal from function generator should be a 1Vpp sine wave with frequency of 1 kHz.
Note: Use sampling rate = 16 kHz.

6|Page
BCE-F-22-A DSP LAB

2. Consider the given signals:


x[n] = [4 0 2 3 5] for 0 ≤ n ≤ 4
h[n] = [−1 2 1] for 0 ≤ n ≤ 2
Write a code in CCS which takes length of samples and amplitude of samples as input from user
and then linearly convolves x[n] and h[n] to obtain y[n].
Display the output on console and plot x[n], h[n] and y[n]

7|Page
BCE-F-22-A DSP LAB

Conclusion :

8|Page

You might also like