KEMBAR78
DSP LAB Manual | PDF | Discrete Fourier Transform | Fast Fourier Transform
0% found this document useful (0 votes)
17 views81 pages

DSP LAB Manual

St. Martin's Engineering College aims to create high-quality engineering and management professionals through a vision of excellence and a mission focused on ethical and technological education. The Department of Electronics and Communication Engineering emphasizes producing socially responsible professionals equipped with essential engineering knowledge and skills. The document outlines program educational objectives and outcomes, course objectives, and MATLAB-based lab experiments designed to enhance students' understanding of digital signal processing.

Uploaded by

21k41a0470
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)
17 views81 pages

DSP LAB Manual

St. Martin's Engineering College aims to create high-quality engineering and management professionals through a vision of excellence and a mission focused on ethical and technological education. The Department of Electronics and Communication Engineering emphasizes producing socially responsible professionals equipped with essential engineering knowledge and skills. The document outlines program educational objectives and outcomes, course objectives, and MATLAB-based lab experiments designed to enhance students' understanding of digital signal processing.

Uploaded by

21k41a0470
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/ 81

St.

MARTIN'S ENGINEERING COLLEGE

Institute Vision
To become an institute of excellence by creating high quality and innovating engineering and
management professionals who would take the world into their stride through sustainable
growth in technology and management.

Institute Mission
To instill moral values and promote technological, intellectual and ethical environment to the
students with an in-depth and exceptional education that makes them employment ready as
per the emerging trends in industry and to invoke the desire of innovation as a process of life-
long learning for a successful career in engineering and management.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Department Vision
To develop a centre of excellence for imparting high quality education in Electronics and
Communication Engineering to produce technically competent, innovative and socially
responsible professionals to meet global challenges.

Department Mission
M1: To impart knowledge in a way that caters to the needs of the present and emerging
technological world.

M2: To turnout competent professionals trained in design and development of hardware and
software based products.

M3: To infuse sense of ethics and social responsibility among the students.

I .Program Educational Objectives (PEOs)

PEO NO: Program Educational Objectives

To prepare the students to fit into any industry associated with designing,
PEO1 developing and manufacture of hardware and software products based on
state of art technologies, make them capable of pursuing higher studies in
the field of electronics and communication engineering.

PEO2 To enrich the students with sound mathematical, scientific and engineering
fundamentals required to solve engineering problems and also to pursue
higher studies.

PEO3 To develop analytical capabilities in the students for design validation.

To continuously strive to create an environment in the department that


PEO4 enriches the students with qualities like professionalism, communication
and team work skills, ethical values, and sense of responsibility towards
society.

II. Program Outcomes (Pos)

PO NO Program Outcomes

PO1 Engineering knowledge: Apply the knowledge of mathematics, science,


engineering fundamentals, and an engineering specialization to the solution of
complex engineering problems.
PO2 Problem analysis: Identify, formulate, review research literature, and analyze
complex engineering problems reaching substantiated conclusions using first
principles of mathematics, natural sciences, and engineering sciences.
PO3 Design/development of solutions: Design solutions for complex engineering
problems and design system components or processes that meet the specified
needs with appropriate consideration for the public health and safety, and the
cultural, societal, and environmental considerations.
PO4 Conduct investigations of complex problems: Use research-based
knowledge and research methods including design of experiments, analysis and
interpretation of data, and synthesis of the information to provide valid
conclusions.
PO5 Modern tool usage: Create, select, and apply appropriate techniques,
resources, and modern engineering and IT tools including prediction and
modeling to complex engineering activities with an understanding of the
limitations.
PO6 The engineer and society: Apply reasoning informed by the contextual
knowledge to assess societal, health, safety, legal and cultural issues and the
consequent responsibilities relevant to the professional engineering practice.
PO7 Environment and sustainability: Understand the impact of the professional
engineering solutions in societal and environmental contexts, and demonstrate
the knowledge of, and need for sustainable development.
PO8 Ethics: Apply ethical principles and commit to professional ethics and
responsibilities and norms of the engineering practice.
PO9 Individual and team work: Function effectively as an individual, and as a
member or leader in diverse teams, and in multidisciplinary settings
PO10 Communication: Communicate effectively on complex engineering activities
with the engineering community and with society at large, such as, being able
to comprehend and write effective reports and design documentation, make
effective presentations, and give and receive clear instructions.
PO11 Project management and finance: Demonstrate knowledge and understanding of the
engineering and management principles and apply these to one‟s own work, as a
member and leader in a team, to manage projects and in multidisciplinary
environments

PO12 Life-long learning: Recognize the need for, and have the preparation and ability to
engage in independent and life-long learning in the broadest context of technological
change.

DIGITAL SIGNAL PROCESSING LAB

III B. TECH- II SEMESTER (R20)

Course Code Programme Hours / Week Credits Maximum


Marks

EC604PC B. Tech L T P C CIE SEE Total

0 0 3 1.5 30 70 100

COURSE OBJECTIVES

1. To provide background and fundamentals of MATLAB tool for the analysis and processing
of signals and to generate various continuous and discrete time signals.
2. To study the designs and structures of digital (IIR and FIR) filters from analysis to synthesis
for a given specifications.
3. To familiarize the relationships between continuous-time and discrete-time signals and
systems.
4. To verify the Circular Convolution, Noise removal and DTMF filtering.
5. To analyze the FFT algorithm, multi-rate signal processing techniques.

COURSE OUTCOMES

Upon successful completion of the course, the student is able


1. Understand Basics of MATLAB syntax, functions andprogrammingandfindthe generation
Various Signals and Sequences in MATLAB, including the operations on Signals
andSequences.
2. Explain the Convolution and Correlation between Signals andsequences, Verificationof
noise removal in a signal
3. Analyze the Fourier Transform of a given signal and plotting its magnitude and phase
spectrum
4. Remember for impulse response of finite and infinite
5. Construct the multi rate signal processing and Identify Spectrograms and DTMF Filtering.

LIST OF EXPERIMENTS

The Programs shall be implemented in Software (Using MATLAB / Lab View / C


Programming/ Equivalent) and Hardware (Using TI / Analog Devices / Motorola / Equivalent
DSP processors).
Note: - Minimum of 12 experiments has to be conducted.

List of Experiments:
1. Generation of Sinusoidal Waveform / Signal based on Recursive Difference Equations
2. Histogram of White Gaussian Noise and Uniformly Distributed Noise.
3. Impulse Response of First order and Second Order Systems.
4. To find Frequency Response of a given System given in Transfer Function/ Differential
equation form.
5. To find DFT / IDFT of given DT Signal
6. To find circular convolution of given two sequences.
7. Obtain Fourier series coefficients by formula and using FFT and compare for half sine
wave.
8. Implementation of FFT of given Sequence
9. Determination of Power Spectrum of a given Signal(s).
10. Implementation of LP & HP FIR Filter for a given Sequence/Signal.
11. Implementation of LP & HP IIR Filter for a given Sequence/Signal
12. Generation of Narrow Band Signal through Filtering
13. Generation of DTMF Signals
14. Implementation of Decimation Process
15. Implementation of Interpolation Process
16. Implementation of I/D Sampling Rate Converters
INRODUCTION
MATLAB: MATLAB is a software package for high performance numerical computation and
visualization provides an interactive environment with hundreds of built in functions for
technical computation, graphics and animation. The MATLAB name stands for MATrix
Laboratory. At its core ,MATLAB is essentially a set (a “toolbox”) of routines (called “m files”
or “mex files”) that sit on your computer and a window that allows you to create new variables
with names (e.g. voltage and time) and process those variables with any of those routines (e.g.
plot voltage against time, find the largest voltage, etc). It also allows you to put a list of your
processing requests together in a file and save that combined list with a name so that you can
run all of those commands in the same order at some later time. Furthermore, it allows you to
run such lists of commands such that you pass in data and/or get data back out (i.e. the list
of commands is like a function in most programming languages). Once you save a
function, it becomes part of your toolbox (i.e. it now looks to you as if it were part of the basic
toolbox that you started with). For those with computer programming backgrounds:

Note that MATLAB runs as an interpretive language (like the old BASIC). That is, it does
not need to be compiled. It simply reads through each line of the function, executes it, and
then goes on to the next line. (In practice, a form of compilation occurs when you first run a
function, so that it can run faster the next time you run it.)

MATLAB Windows :
MATLAB works with through three basic windows Command Window : This is the main
window .it is characterized by MATLAB command prompt >> when you launch the
application program MATLAB puts you in this window all commands including those for
user-written programs ,are typed in this window at the MATLAB prompt .
Graphics window: the output of all graphics commands typed in the command window are
flushed to the graphics or figure window, a separate gray window with white background color
the user can create as many windows as the system memory will allow

Edit window: This is where you write edit, create and save your own programs in
files called M files.

Input-output: MATLAB supports interactive computation taking the input from the screen
and flushing, the output to the screen. In addition it can read input files and write output files

Data Type: the fundamental data -type in MATLAB is the array. It encompasses several distinct
data objects- integers, real numbers, matrices, charcter strings, structures and cells.There is no
need to declare variables as real or complex, ATLAB automatically sets the variable to be real.

Dimensioning: Dimensioning is automatic in MATLAB. No dimension statements are required


for vectors or arrays .we can find the dimensions of an existing matrix or a vector with the size
and length commands.

Where to work in MATLAB?


All programs and commands can be entered either in the
a)Command window
b) As an M file using Matlab editor
Note: Save all M files in the folder 'work' in the current directory. Otherwise you have to
locate the file during compiling.
Typing quit in the command prompt>> quit, will close MATLAB
Matlab Development Environment.
For any clarification regarding plot etc, which are built in functions type
help topic i.e. help plot .
Basic Instructions in Matlab
1. T = 0: 1:10
This instruction indicates a vector T which as initial value 0 and final value
10 with an increment of 1
Therefore T = [0 1 2 3 4 5 6 7 8 9 10]
2. F= 20: 1: 100
Therefore F = [20 21 22 23 24 ……… 100]
3. T= 0:1/pi: 1
Therefore T= [0, 0.3183, 0.6366, 0.9549]
4. zeros (1, 3)
The above instruction creates a vector of one row and three columns whose
values are zero
Output= [0 0 0]
5. zeros( 2,4)
Output = 0000
0000
6. ones (5,2)
The above instruction creates a vector of five rows and two columns
Output = 11
11
11
11
11
7. a = [ 1 2 3] b = [4 5 6]

a.*b = [4 10 18]

8 if C= [2 2 2]
b.*C results in [8 10 12]

9. plot (t, x)

If x = [6 7 8 9] t = [1 2 3 4]
10. stem (t,x) :-This instruction will display a figure window.
11. Subplot: This function divides the figure window into rows and columns.
Subplot (2 2 1) divides the figure window into 2 rows and 2 columns 1 represent
number of the figure .
12. Conv
Syntax: w = conv(u,v)
Description: w = conv(u,v) convolves vectors u and v.
Algebraically, convolution is the same operation as multiplying
the polynomials whose coefficients are the elements of u and v.
13.Disp
Syntax: disp(X)
Description: disp(X) displays an array, without printing the
array name. If X contains a text string, the string is
displayed.Another way to display an array on the screen is to type
its name, but this prints a leading "X=," which is not always
desirable.Note that disp does not display empty arrays.
14.xlabel
Syntax: xlabel('string')
Description: xlabel('string') labels the x-axis of the current axes.
15. ylabel
Syntax : ylabel('string')
Description: ylabel('string') labels the y-axis of the current axes.
16.Title
Syntax : title('string')
Description: title('string') outputs the string at the top and in the center of the
current axes.
17.grid on
Syntax : grid on
Description: grid on adds major grid lines to the current axes.
18.FFT Discrete Fourier transform.
FFT(X) is the discrete Fourier transform (DFT) of vector X. For
matrices, the FFT operation is applied to each column. For N-D
arrays, the FFT operation operates on the first non-singleton
dimension.
FFT(X,N) is the N-point FFT, padded with zeros if X has
less than N points and truncated if it has more.
19. ABS Absolute value.
ABS(X) is the absolute value of the elements of X. When X is
complex, ABS(X) is the complex modulus (magnitude) of the
elements of X.
20. ANGLE Phase angle.
ANGLE(H) returns the phase angles, in radians, of a matrix with complex
elements.

21.INTERP Resample data at a higher rate using lowpass interpolation.


Y = INTERP(X,L) resamples the sequence in vector X at L
times the original sample rate. The resulting resampled vector Y
is L times longer, LENGTH(Y) = L*LENGTH(X).
22. DECIMATE Resample data at a lower rate after lowpass filtering.
Y = DECIMATE(X,M) resamples the sequence in vector X at 1/M times the
original
sample rate. The resulting resampled vector Y is M times shorter, i.e.,
LENGTH(Y)
CEIL(LENGTH(X)/M). By default, DECIMATE filters the data
with an 8th order Chebyshev Type I lowpass filter with cutoff
frequency .8*(Fs/2)/R, before resampling.
EXPERIMENT NO-1
Generation of Sinusoidal Waveform / Signal based on Recursive
Difference Equations

AIM: To generate a sinusoidal signal through Signal based on Recursive Difference Equations.

APPARATUS REQUIRED: System with MATLAB.

THEORY: One application of an LTI discrete-time system is to pass certain frequency


components in an input sequence without any distortion and block other frequency components.
Such systems are called digital filters. The key to the filtering process is the inverse Discrete
Fourier transform, which expresses an arbitrary input sequence as a linear weighed sum of an
infinite number of exponential sequences, or equivalently, as a linear weighted sum of sinusoidal
sequences. As a result, by appropriately choosing the values of magnitude function of the LTI
digital filter at frequencies corresponding to the frequencies of the sinusoidal components of the
input, some of these sinusoidal sequences can be selectively heavily attenuated or filtered with
respect to the others.

Flow Chart:

PROGRAM:
clc;
close all;
clear all;
b=[1];
a=[1,-1,0.9];
n=[-20:120];
t=0:0.1:2*pi;
x=sin(t);
s=filter(b,a,x);
stem(t,s);
title('sinusoidal response');
xlabel('n');
ylabel('s(n)');

Output Waveform:

RESULT: Hence a sinusoidal signal through Signal based on Recursive Difference Equations is
performed.

VIVA QUESTIONS:
1. Define signal?
2. Differentiate periodic and non-periodic signals?
3. Define period of the signal?
4. Define LTI system.
5. What is filtering?
6. Define sequence?
EXPERIMENT NO-2
Histogram of White Gaussian Noise and Uniformly Distributed
Noise.
AIM: Histogram of white Gaussian Noise and uniformly distributed noise using MATLAB.

APPARATUS REQUIRED: system with MATLAB.

THEORY: Since the random variables in the white noise process are statistically uncorrelated, the
covariance function contains values only along the diagonal. The matrix above indicates that only the
autocorrelation function exists for each random variable. The cross-correlation values are zero
(samples/variables are statistically uncorrelated with respect to each other). The diagonal elements are
equal to the variance and all other elements in the matrix are zero. Plot the histogram of the generated
white noise and verify the histogram by plotting against the theoretical pdf of the Gaussian random
variable.

Algorithm: Algorithm:

Step I : Define the value of length, mu value and sigma value

Step II : Find the histogram function of white gaussian noise

Step III : Find the histogram function of white gaussian noise

Step IV : Plot the input and output

Procedure:

1. Open MATLAB
2. Open new M-file
3. Type the program
4. Save in current directory
5. Compile and run the program
6. For the o/p see command window.

Program:

clc;

clear all;

close all;

L=100;

mu=0;

sigma=2;

F1=sigma*randn(L,1)+mu;

figure(1)

plot(F1);

title('white guassian noise');


figure(2)

hist(F1)

title('histogram of white gaussian noise');

F2=sigma*rand(L,1)+mu;

figure(3);

plot(F1);

title('uniform distributed noise');

figure(4)

hist(F2);

title('uniform distributed noise');

Output:
RESULT: Hence the Histogram of white Gaussian Noise and uniformly distributed noise
using MATLAB performed.

VIVA QUESTIONS:
1. Define Strictly and weakly defined white noise.
2. What‟s with Covariance Function/Matrix ?
3. Explain Frequency Domain Characteristics
4. Define Wide Sense Stationary Process (WSS).
5. What is a random process?
6. Define Noise?
7. Give applications‟ of Random Processes.
8. Define random variable?
9. What is the other name for Random Processes.
10. Define auto correlation.
EXPERIMENT NO-3
IMPULSE RESPONSE OF FIRST ORDER AND SECOND ORDER

SYSTEMS
AIM: - To Generation of Impulse Response of First Order and Second Order Systems.

APPARATUS REQUIRED:-

1. MATLAB Software.
2. Computer Systems.

THEORY:
The response of an LTI system when an unit impulse sequence is applied at the input of
the system. It is denoted by h(n).
PROGRAM:
clc;
close all;
clear all;
n=0:10;
%impulse response of first order system
b=[2 0 0];
a=[1 -0.9 0];
y=dimpulse(b,a,length(n));
subplot(2,1,1);
stem(n,y);
xlabel('n--->');
ylabel('amplitude');
title('impulse response of first order system');
%impulse response of second order system
b=[1 0 0];
a=[1 0.6 0.8];
y1=dimpulse(b,a,length(n));
subplot(2,1,2);
stem(n,y1);
xlabel('n - >');
ylabel('amplitude');
title('impulse response of second order system');
OUTPUT:-

RESULT:- Generated of Impulse Response Of First Order And Second OrderSystems

VIVA QUESTIONS:
1. Define impulse response?
2. Give example for first order difference equation?
3. Give example for second order difference equation?
4. Define LTI system?
5. Define convolution?
6. What are Fourier series and Fourier transform?
7. What is meant by linearity of a system and how it is related to scaling and superposition?
8. How to perform linear convolution using circular convolution?
9. What is the necessity of sectioned convolution in signal processing?
10.What is meant by causality?
EXPERIMENT NO-4
To find Frequency Response of a given System given in Transfer
Function/ Differential equation form.

AIM: To find frequency response of a given system in differential equation form.

APPARATUS REQUIRED: System with MATLAB

THEORY: Systems respond differently to inputs of different frequencies. Some systems may
amplify components of certain frequencies, and attenuate components of other frequencies. The
way that the system output is related to the system input for different frequencies is called the
frequency response of the system. Since the frequency response is a complex function, we can
convert it to polar notation in the complex plane. This will give us a magnitude and an angle. We
call the angle the phase.
Amplitude Response: For each frequency, the magnitude represents the system's tendency to
amplify or attenuate the input signal.

Phase Response: The phase represents the system's tendency to modify the phase of the input
sinusoids.

The phase response, or its derivative the group delay, tells us how the system delays the input
signal as a function of frequency.

Given Difference equation is

y(n) – 5 y(n–1) = x(n) + 4 x(n–1)

Procedure:-
1) Open MATLAB
2) Open new M-file
3) Type the program
4) Save in current directory
5) Compile and Run the program
6) For the output see command window\ Figure window
Algorithm:
Step I : Give numerator coefficients of the given transfer function or difference equation..
Step II : Give denominator coefficients of the given transfer function or difference equation
Step III : Pass these coefficients to matlab command freqz to find frequency response.
Step IV : Find magnitude and phase response using matlab commands abs and angle.
Step V : Plot magnitude and phase response.

Flow Chart:
PROGRAM:
%MATLAB program to plot the frequency response (magnitude and phase response)of agiven
difference equation.
clc;
clear all;
b=input('Enter the numerator coefficients:');
a=input('Enter the denominator coefficients:');
[h,w]=freqz(b,a);
subplot(2,1,1);
plot(w/pi,abs(h));
grid;
xlabel('Normalised Frequency');
ylabel('Magnitude in dB');
title('Magnitude Response');
subplot(2,1,2);
plot(w/pi,angle(h));
grid;
xlabel('Normalised Frequency');
ylabel('phase in radians');
title('Phase Response');

Output:
Enter the numerator coefficients: [1]
Enter the denominator coefficients: [1 -1/6 -1/6]

Output Waveforms:
RESULT: Hence frequency response of a given system determined using differential equation
form.

VIVA QUESTIONS:
1. Define Frequency response?
2. Define magnitude response?
3. Define Phase response?
4. Define transfer function.
5. State the significance of difference equations.
6. What are the classifications of system based on unit sample response?
7. What is zero input response?
8. Define impulse response?
9. Define System.
10. Write mathematical formula to find response of any given system.
EXPERIMENT NO-5
To find DFT / IDFT of given DT Signal

AIM: To find Discrete Fourier Transform and Inverse Discrete Fourier Transform of given
digital signal.
APPARATUS REQUIRED: System with MATLAB

THEORY:

Basic equation to find the DFT of a sequence is given below.

Basic equation to find the IDFT of a sequence is given below.

Procedure:-
1) Open MATLAB
2) Open new M-file
3) Type the program
4) Save in current directory
5) Compile and Run the program
6) For the output see command window\ Figure window

Algorithm:
Step I: Get the input sequence.
Step II: Find the DFT of the input sequence using direct equation of DFT.
Step III: Find the IDFT using the direct equation.
Step IV: Plot DFT and IDFT of the given sequence using matlab command stem.
Step V: Display the above outputs.

Flow chart:
PROGRAM:
clc;
close all;
clear all;
xn=input('Enter the sequence x(n)');
%Get the sequence from user ln=length(xn);
%find the length of the sequence
xk=zeros(1,ln);
%initialize an array of same size as that of input sequence
ixk=zeros(1,ln);
%initialize an array of same size as that of input sequence
%DFT of the sequence
%-----------------------------------------------------
for k=0:ln-1
for n=0:ln-1
xk(k+1)=xk(k+1)+(xn(n+1)*exp((i)*2*pi*k*n/ln));
end
end
%------------------------------------------------------
%Plotting input sequence %-----------------------------------------------------
t=0:ln-1;
subplot(221);
stem(t,xn);
ylabel ('Amplitude');
xlabel ('Time Index');
title('Input Sequence');
%---------------------------------------------------------------

magnitude=abs(xk);
% Find the magnitudes of individual DFT points
% plot the magnitude response
%------------------------------------------------------------
t=0:ln-1;
subplot(222);
stem(t,magnitude);
ylabel ('Amplitude');
xlabel ('K');
title('Magnitude Response');
%------------------------------------------------------------
phase=angle(xk);
% Find the phases of individual DFT points
% plot the magnitude sequence
%------------------------------------------------------------
t=0:ln-1;
subplot(223);
stem(t,phase);
ylabel ('Phase');
xlabel ('K');
title ('Phase Response');
%------------------------------------------------------------
%IDFT of the sequence %------------------------------------------------------------
for n=0:ln-1
for k=0:ln-1
ixk(n+1)=ixk(n+1)+(xk(k+1)*exp(i*2*pi*k*n/ln));
end
end
ixk=ixk./ln;
%------------------------------------------------------------
%code block to plot the input sequence
%------------------------------------------------------------
t=0:ln-1;
subplot(224);
stem(t,ixk);
ylabel ('Amplitude');
xlabel ('Time Index');
title ('IDFT sequence');
%------------------------------------------------------

Output:

Xn=[1 2 3 4 5]
Xk = 15,-2.50+3.44i,-2.50+0.81i,-2.49-0.81i,-2.49-3.44i

Output Waveforms:
RESULT: Thus Discrete Fourier Transform is performed using Matlab.
VIVA QUESTIONS:
1. Define signal, Give Examples for 1-D, 2-D, 3-D signals.
2. Define transform. What is the need for transform?
3. Differentiate Fourier transform and discrete Fourier transform.
4. Differentiate DFT and DTFT
5. Explain mathematical formula for calculation of DFT.
6. Explain mathematical formula for calculation of IDFT.
7. How to calculate FT for 1-D signal?
8. What is meant by magnitude plot, phase plot, power spectrum?
9. Explain the applications of DFT.
10. What are separable transforms?
EXPERIMENT NO-6
To find circular convolution of given two sequences

AIM: To find circular convolution of given two sequences.

APPARATUS REQUIRED: System with MATLAB

THEORY: Circular convolution also known as cyclic convolution to two functions which
are aperiodic in nature occurs when one of them is convolved in the normal way with a
periodic summation of other function.

A similar situation can be observed can be expressed in terms of a periodic summation of


both functions, if the infinite integration interval is reduced to just one period. This situation
arises in Discrete-Time Fourier Transform(DTFT) and is called periodic convolution.

Let us consider x to be a function with a defined periodic summation, xT, where:

Algorithm:
Step 1: Start.

Step 2: Read the first sequence.

Step 3: Read the second sequence.

Step 4: Find the length of the first sequence.

Step 5: Find the length of the second sequence.


Step 6: Perform circular convolution MatLab for both the sequences using inbuilt
function.

Step 7: Plot the axis graph for sequence.

Procedure:-
1) Open MATLAB
2) Open new M-file
3) Type the program
4) Save in current directory
5) Compile and Run the program
6) For the output see command window\ Figure window

Program:

clc;
close all;
clear all;
x1=input('Enter the first sequence :
');
x2=input('Enter the second sequence
: ');
N1=length(x1);
N2=length(x2);
N=max(N1,N2);

if(N2>N1)
x4=[x1,zeros(1,N-N1)];
x5=x2;
elseif(N2==N1)
x4=x1;
x5=x2;
else
x4=x1;
x5=[x2,zeros(1,N-N2)];
end

x3=zeros(1,N);
for m=0:N-1
x3(m+1)=0;
for n=0:N-1
j=mod(m-n,N);
x3(m+1)=x3(m+1)+x4(n+1).*x5(j+1);
end
end

subplot(4,1,1)
stem(x1);
title('First Input Sequence');
xlabel('Samples');
ylabel('Amplitude');
subplot(4,1,2)
stem(x2);
title('Second Input Sequence');
xlabel('Samples');
ylabel('Amplitude');
subplot(4,1,3)
stem(x3);
title('Circular Convolution Using
Modulo Operator');
xlabel('Samples');
ylabel('Amplitude');

%In built function


y=cconv(x1,x2,N);
subplot(4,1,4)
stem(y);
title('Circular Convolution using
Inbuilt Function');
xlabel('Samples');
ylabel('Amplitude');

OUTPUT:
RESULT: Hence the circular convolution of given two sequences is verified using MATLAB.

VIVA QUESTIONS:
1. What is the use of circular convolution?
2. Why do we use circular convolution in DFT?
3. What is the length of circular convolution?
4. What is the difference between convolution and circular convolution?
5. What are the types of circular convolution?
6. What is the symbol for circular convolution?
7. Write the properties of discrete convolution.
8. What is circular convolution DFT method?
9. What is circular convolution Matrices method?
10. What is circular convolution Matrices method?
EXPERIMENT NO-7
Obtain Fourier series coefficients by formula and using FFT and
compare for half sine wave.

AIM: To Obtain Fourier series coefficients by formula and using FFT and compare for half sine
wave.

APPARATUS REQUIRED: System with MATLAB

THEORY: The Fourier series representation of a periodic discrete-time sequence is called discrete Fourier
series (DFS). Consider a discrete-time signal x(n), that is periodic with period N defined by x(n) = x(n +
kN) for any integer value of k. The periodic function x(n) can be synthesized as the sum of sine and cosine
sequences (Trigonometric form of Fourier series) or equivalently as a linear combination of complex
exponentials (Exponential form of Fourier series) whose frequencies are multiples of the fundamental
frequency ὡ0 = 2π/N. This is done by constructing a periodic sequence for which each period is identical
to the finite length sequence.
Procedure:-
1) Open MATLAB
2) Open new M-file
3) Type the program
4) Save in current directory
5) Compile and Run the program
6) For the output see command window\ Figure window

Algorithm :
Step I : define time vector for signal
Step II : find m value
Step III : find the periodicity of the signal
Sterp IV : find the fourier coefficients of the given signal
Step V : plot the Graph input and fourier coeffdicients.

Program:
RESULT: Hence the Fourier series coefficients by formula and using FFT and compare for half
sine wave verified using MATLAB.

VIVA QUESTIONS:
1. What is Fourier series used for?
2. What are the types of Fourier series?
3. What are the properties of Fourier series?
4. Which Fourier series is the most widely used?
5. What is Fourier series formula?
6. Who is the father of Fourier series?
7. Explain periodic function with examples.
8. State Dirichlet‟s conditions for a function to be expanded as a Fourier series.
9. To what value does the sum of Fourier series of f (x) converge at the point of continuity
10. State the Parseval‟s Identity (or) theorem
EXPERIMENT NO-8
Implementation of FFT of given Sequence

AIM: To find the FFT of a given sequence.

APPARATUS REQUIRED: System with MATLAB

THEORY:

DFT of a sequence

Where N= Length of sequence.


K= Frequency Coefficient.
n = Samples in time domain.

FFT: -Fast Fourier transform.


There are two methods.
1. Decimation in time (DIT ) FFT.
2. Decimation in Frequency (DIF) FFT.

Why we need FFT?

The no of multiplications in DFT = N2.


The no of Additions in DFT = N (N-1).

For FFT. The no of multiplication = N/2 log 2N.


The no of additions = N log2 N.

Procedure:-
1) Open MATLAB
2) Open new M-file
3) Type the program
4) Save in current directory
5) Compile and Run the program
6) For the output see command window\ Figure window
Algorithm:

Step I : Give input sequence x[n].


Step II : Find the length of the input sequence using length command.
Step III : Find FFT and IFFT using matlab commands fft and ifft.
Step IV : Plot magnitude and phase response
Step V : Display the results

Flow Chart:

PROGRAM:
clc;
clear all;
close all;
x=input('Enter the sequence : ')
N=length(x)
xK=fft(x,N)
xn=ifft(xK)
n=0:N-1;
subplot (2,2,1);
stem(n,x);
xlabel('n---->');
ylabel('amplitude');
title('input sequence');
subplot (2,2,2);
stem(n,abs(xK));
xlabel('n---->');
ylabel('magnitude');
title('magnitude response');
subplot (2,2,3);
stem(n,angle(xK));
xlabel('n---->');
ylabel('phase');
title('Phase responce');
subplot (2,2,4);
stem(n,xn);
xlabel('n---->');
ylabel('amplitude');
title('IFFT');

Output:

Enter the sequence: [1 2 3 4 5]


x=12345
N=5
xK = 15.0000, -2.5000 + 3.4410i,

Output Waveform:

RESULT:
VIVA QUESTIONS:
1. Define transform. What is the need for transform?
2. Differentiate Fourier transform and discrete Fourier transform.
3. Differentiate DFT and DTFT.
4. What are the advantages of FFT over DFT?
5. Differentiate DITFFT and DIFFFT algorithms.
6. What is meant by radix?
7. What is meant by twiddle factor and give its properties?
8. How FFT is useful to represent a signal?
9. Compare FFT and DFT with respect to number of calculation required?
10. How the original signal is reconstructed from the FFT of a signal?
EXPERIMENT NO-9
Determination of Power Spectrum of a given Signal(s).

AIM: Determination of Power Spectrum of a given signal.

APPARATUS REQUIRED: System with MATLAB

THEORY: The power spectrum describes the distribution of signal power over a frequency
spectrum. The most common way of generating a power spectrum is by using a discrete Fourier
transform, but other techniques such as the maximum entropy method can also be used. The
power spectrum can also be defined as the Fourier transform of auto correlation function.

Procedure:-
1) Open MATLAB
2) Open new M-file
3) Type the program
4) Save in current directory
5) Compile and Run the program
6) For the output see command window\ Figure window

Algorithm:

Step I : Give input sequence x


Step II : Give sampling frequency, input frequency and length of the spectrum.
Step III : Find power spectrum of input sequence using matlab command spectrum.
Step IV : Plot power spectrum using specplot.

Flow Chart:
PROGRAM:
Clc;
clear all;
close all;
N=1024;
fs=8000;
f=input('enter the frequency[1 to 5000]:');
n=0:N-1;
x=sin(2*pi*(f/fs)*n)
pxx=spectrum(x,N);
specplot(pxx,fs);
grid on
xlabel('freq(hz)');
ylabel('magnitude(db)');
title('power spectrum of x(n)');

INPUT: Enter the frequency [1 to 5000]: 3000.

Output Waveform:
RESULT:
VIVA QUESTIONS:

1. Define power signal.


2. Define energy signal.
3. Define power spectral density of a signal.
4. How the energy of a signal can be calculated?
5. Explain difference between energy spectral density and power spectral density.
6. Explain the PSD plot.
7. What is the importance of PSD?
8. What are the applications of PSD?
9. Explain MATLAB function randn(size(n)).
10. What is the need to represent the signal in frequency domain?
EXPERIMENT NO-10
Implementation of LP & HP FIR Filter for a given
Sequence/Signal

AIM: To implement LP and HP FIR filter for a given sequence.

APPARATUS REQUIRED: System with MATLAB

THEORY:

FIR filters are digital filters with finite impulse response. They are also known as non-recursive
digital filters as they do not have the feedback. An FIR filter has two important advantages over
an IIR design:  Firstly, there is no feedback loop in the structure of an FIR filter. Due to not
having a feedback loop, an FIR filter is inherently stable. Meanwhile, for an IIR filter, we need to
check the stability.  Secondly, an FIR filter can provide a linear-phase response. As a matter of
fact, a linear-phase response is the main advantage of an FIR filter over an IIR design otherwise,
for the same filtering specifications; an IIR filter will lead to a lower order.

FIR FILTER DESIGN

An FIR filter is designed by finding the coefficients and filter order that meet certain
specifications, which can be in the time-domain (e.g. a matched filter) and/or the frequency
domain (most common). Matched filters perform a cross-correlation between the input signal and
a known pulse-shape. The FIR convolution is a cross-correlation between the input signal and a
time-reversed copy of the impulse-response. Therefore, the matched-filter's impulse response is
"designed" by sampling the known pulse-shape and using those samples in reverse order as the
coefficients of the filter. When a particular frequency response is desired, several different design
methods are common:

1. Window design method


2. Frequency Sampling method
3. Weighted least squares design

WINDOW DESIGN METHOD

In the window design method, one first designs an ideal IIR filter and then truncates the infinite
impulse response by multiplying it with a finite length window function. The result is a finite
impulse response filter whose frequency response is modified from that of the IIR filter.
Procedure:-
1) Open MATLAB
2) Open new M-file
3) Type the program
4) Save in current directory
5) Compile and Run the program
6) For the output see command window\ Figure window
Algorithm:
Step I : Enter the pass band frequency (fp) and stop band frequency (fq).
Step II : Get the sampling frequency (fs), length of window (n).
Step III : Calculate the cut off frequency, fn
Step IV : Use boxcar, hamming, blackman Commands to design window.
Step V : Design filter by using above parameters.
Step VI : Find frequency response of the filter using matlab command freqz.
Step VII : Plot the magnitude response and phase response of the filter.

Flow Chart:

PROGRAM:
clc;
clear all;
close all;
n=20;
fp=200;
fq=300;
fs=1000;
fn=2*fp/fs;
window=blackman(n+1);
b=fir1(n,fn,window);
[H W]=freqz(b,1,128);
subplot(2,1,1);
plot(W/pi,abs(H));
title('magnitude response of lpf');
ylabel('gain in db-------->');
xlabel('normalized frequency------>');
subplot(2,1,2);
plot(W/pi,angle(H));
title('phase response of lpf');
ylabel('angle-------->');
xlabel('normalized frequency------>');
Output Wave forms:

IMPLEMENTATION OF HP FIR FILTER

Algorithm:

Step I : Enter the pass band frequency (fp) and stop band frequency (fq).
Step II : Get the sampling frequency (fs), length of window (n).
Step III : Calculate cut off frequency
Step IV : Use boxcar, hamming, Blackman Commands to design window.
Step V : Design filter by using above parameters.
Step VI : Find frequency response of the filter using matlab command freqz.
Step VII : Plot the magnitude response and phase response of the filter.

Flow Chart:
PROGRAM:

clc;
clear all;
close all;
n=20;
fp=300;
fq=200;
fs=1000;
fn=2*fp/fs; window=blackman(n+1);
b=fir1(n,fn,'high',window);
[H W]=freqz(b,1,128);
subplot(2,1,1);
plot(W/pi,abs(H));
title('mag res of lpf');
ylabel('gain in db-------->');
xlabel('normalized frequency------>');
subplot(2,1,2);
plot(W/pi,angle(H));
title('phase res of lpf');
ylabel('angle-------->');
xlabel('normalized frequency------>');

Output Waveforms:
RESULT: Thus FIR LP and HP Filter is designed for windowing techniques using MATLAB.

VIVA QUESTIONS:
1. Define filter.
2. What are the different types of filters?
3. Why are FIR filters generally preferred over IIR filters in multirate (decimating and
interpolating) systems/
4. Difference between IIR and FIR filters?
5. Differentiate ideal filter and practical filter responses.
6. What is the filter specifications required to design the analog filters?
7. What is meant by frequency response of filter?
8. What is meant by magnitude response?
9. What is meant by phase response?
10. Difference between FIR low pass filter and high pass filter.
EXPERIMENT NO-11
Implementation of LP & HP IIR Filter for a given
Sequence/Signal

AIM: To implement LP and HP IIR filter for a given sequence.

APPARATUS REQUIRED: System with MATLAB

THEORY: IIR filters are digital filters with infinite impulse response. Unlike FIR filters, they
have the feedback (a recursive part of a filter) and are known as recursive digital filters therefore.
For this reason IIR filters have much better frequency response than FIR filters of the same order.
Unlike FIR filters, their phase characteristic is not linear which can cause a problem to the
systems which need phase linearity. For this reason, it is not preferable to use IIR filters in digital
signal processing when the phase is of the essence. Otherwise, when the linear phase
characteristic is not important, the use of IIR filters is an excellent solution. There is one problem
known as a potential instability that is typical of IIR filters only. FIR filters do not have such a
problem as they do not have the feedback. For this reason, it is always necessary to check after
the design process whether the resulting IIR filter is stable or not. IIR FILTER DESIGN For
the given specifications to Design a digital IIR filter, first we need to design analog filter
(Butterworth or chebyshev). The resultant analog filter is transformed to digital filter by using
either “Bilinear transformation or Impulse Invariant transformation”.
Procedure:-
1) Open MATLAB
2) Open new M-file
3) Type the program
4) Save in current directory
5) Compile and Run the program
6) For the output see command window\ Figure window

Algorithm:
Step I : Enter the pass band ripple (rp) and stop band ripple (rs).
Step II : Enter the pass band frequency (wp) and stop band frequency (ws).
Step III : Get the sampling frequency (fs).
Step IV : Calculate normalized pass band frequency, and normalized stop band frequency w1 and
w2 respectively. w1 = 2 * wp /fs w2 = 2 * ws /fs
Step V : Make use of the following function to calculate order of filter Butterworth filter order
[n,wn]=buttord(w1,w2,rp,rs ) Chebyshev filter order [n,wn]=cheb1ord(w1,w2,rp,rs)
Step VI : Design an nth order digital low pass Butterworth or Chebyshev filter using the
following statements. Butterworth filter [b, a]=butter (n, wn) Chebyshev filter [b,a]=cheby1 (n,
0.5, wn) Step VII : Find the digital frequency response of the filter by using „freqz( )‟ function
Step VIII : Calculate the magnitude of the frequency response in decibels (dB) mag=20*log10
(abs (H))
Step IX : Plot the magnitude response [magnitude in dB Vs normalized frequency]
Step X : Calculate the phase response using angle (H)
Step XI : Plot the phase response [phase in radians Vs normalized frequency (Hz)].

Flow Chart:

PROGRAM:
clc;
clear all;
close all;
disp('enter the IIR filter design specifications');
rp=input('enter the passband ripple:');
rs=input('enter the stopband ripple:');
wp=input('enter the passband freq:');
ws=input('enter the stopband freq:');
fs=input('enter the sampling freq:');
w1=2*wp/fs;
w2=2*ws/fs;
[n,wn]=buttord(w1,w2,rp,rs,'s');
disp('Frequency response of IIR LPF is:');
[b,a]=butter(n,wn,'low','s');
w=0:.01:pi;
[h,om]=freqs(b,a,w);
m=20*log10(abs(h));
an=angle(h);
figure,
subplot(2,1,1);
plot(om/pi,m);
title('magnitude response of IIR filter is:');
xlabel('(a) Normalized freq. -->');
ylabel('Gain in dB-->');
subplot(2,1,2);
plot(om/pi,an);
title('phase response of IIR filter is:');
xlabel('(b) Normalized freq. -->');
ylabel('Phase in radians-->');
INPUT:
enter the IIR filter design specifications
enter the passband ripple:15
enter the stopband ripple:60
enter the passband freq:1500
enter the stopband freq:3000
enter the sampling freq:7000

Output waveforms:

IMPLEMENTATION OF HP IIR FILTER

Algorithm:

Step I : Enter the pass band ripple (rp) and stop band ripple (rs).
Step II : the pass band frequency (wp) and stop band frequency (ws).
Step III : Get the sampling frequency (fs).
Step IV : Calculate normalized pass band frequency, and normalized stop band frequency w1 and
w2 respectively. w1 = 2 * wp /fs w2 = 2 * ws /fs
Step V : Make use of the following function to calculate order of filter Butterworth filter order
[n,wn]=buttord(w1,w2,rp,rs ) Chebyshev filter order [n,wn]=cheb1ord(w1,w2,rp,rs)
Step VI : Design an nth order digital high pass Butterworth or Chebyshev filter using the
following statement. Butterworth filter [b,a]=butter (n, wn,‟high‟) Chebyshev filter [b,a]=cheby1
(n, 0.5, wn,'high')
Step VII : Find the digital frequency response of the filter by using „freqz( )‟ function
Step VIII : Calculate the magnitude of the frequency response in decibels (dB) mag=20*log10
(abs (H))
Step IX : Plot the magnitude response [magnitude in dB Vs normalized frequency]
Step X : Calculate the phase response using angle (H)
Step XI : Plot the phase response [phase in radians Vs normalized frequency (Hz)].

Flow chart:
PROGRAM:
clc;
clear all;
close all;
disp('enter the IIR filter design specifications');
rp=input('enter the passband ripple');
rs=input('enter the stopband ripple');
wp=input('enter the passband freq');
ws=input('enter the stopband freq');
fs=input('enter the sampling freq');
w1=2*wp/fs;w2=2*ws/fs;
[n,wn]=buttord(w1,w2,rp,rs,'s');
disp('Frequency response of IIR HPF is:');
[b,a]=butter(n,wn,'high','s');
w=0:.01:pi;
[h,om]=freqs(b,a,w);
m=20*log10(abs(h));
an=angle(h);
figure,
subplot(2,1,1);
plot(om/pi,m);
title('magnitude response of IIR filter is:');
xlabel('(a) Normalized freq. -->');
ylabel('Gain in dB-->');
subplot(2,1,2);
plot(om/pi,an);
title('phase response of IIR filter is:');
xlabel('(b) Normalized freq. -->');
ylabel('Phase in radians-->');

INPUT:

enter the IIR filter design specifications


enter the passband ripple15
enter the stopband ripple60
enter the passband freq1500
enter the stopband freq3000
enter the sampling freq7000

Output Waveforms:

RESULT: Thus IIR LP and HP Filter is designed using MATLAB.

VIVA QUESTIONS:

1. List some advantages of digital filters over analog filters.


2. Write some differences between FIR and IIR filters.
3. What are the different methods to design IIR filters?
4. Why IIR filters are not reliable?
5. What are different applications of IIR filters?
6. What are advantages of IIR filters?
7. What are disadvantages of IIR filters?
8. Differentiate Butterworth and Chebyshev approximations.
9. What is meant by impulse response?
10. Difference between IIR low pass and High pass filters.
EXPERIMENT NO-12

GENERATION OF NARROW BAND SIGNAL THROUGH FILTERING


AIM: - To Generation of Narrow Band Signal through Filtering

APPARATUS REQUIRED:-

1. MATLAB Software.
2. Computer Systems.
THEORY:-
One application of an LTI discrete-time system is to pass certain frequency components
in an input sequence without any distortion and block other frequency components. Such
systems are called digital filters. The key to the filtering process is the inverse Discrete
Fourier transform, which expresses an arbitrary input sequence as a linear weighed sum
of an infinite number of exponential sequences, or equivalently, as a linear weighted sum
of sinusoidal sequences. As a result, by appropriately choosing the values of magnitude
function of the LTI digital filter at frequencies corresponding to the frequencies of the
sinusoidal components of the input, some of these sinusoidal sequences can be selectively
heavily attenuated or filtered with respect to the others.

PROCEDURE:-

 Open MATLAB
 Open new M-file
 Type the program
 Save in current directory
 Compile and Run the program
 For the output see command window/ Figure window

PROGRAM:-

close all;

clear all;

clc;

b=[1];
a=[1,-1,0.9];
n=[-20:120];
t=0:0.1:2*pi;
x=sin(t);

s=filter(b,a,x);
stem(t,s);
title('sinusoidal response');
xlabel('n');
ylabel('s(n)');

OUTPUT:-

RESULT:- Generated a Narrow Band Signal Through Filtering Using MATLAB.

VIVA QUESTIONS:-

1. Define sequence and signal?


2. Differentiate periodic and non-periodic signals?
3. Define period of the signal?
4. Define LTI system.
5. What is filtering?
6. When a FIR filter is said to be a linear phase FIR filter
7. What are the advantages and disadvantages of FIR filters?
8. What is the need for spectral estimation?
9. When a system is said to have memory?
10. What is memory less system?
EXPERIMENT NO-13

GENERATION OF DTMF SIGNALS

AIM: To generate DTMF Signals using MATLAB Software.

APPARATUS REQUIRED:-

1. MATLAB Software.

2. Computer Systems.
THEORY:
The DTMF stands for “Dual Tone Multi Frequency”, and is a method of
representing digits with tone frequencies, in order to transmit them over an analog
communications network, for example a telephone line. In telephone networks, DTMF
signals are used to encode dial trains and other information.
Dual-tone Multi-Frequency (DTMF) signaling is the basis for voice
communications control and is widely used worldwide in modern telephony to dial
numbers and configure switchboards. It is also used in systems such as in voice mail,
electronic mail and telephone banking.
A DTMF signal consists of the sum of two sinusoids - or tones - with frequencies
taken from two mutually exclusive groups. These frequencies were chosen to prevent any
harmonics from being incorrectly detected by the receiver as some other DTMF
frequency. Each pair of tones contains one frequency of the low group (697 Hz, 770 Hz,
852 Hz, 941 Hz) and one frequency of the high group (1209 Hz, 1336 Hz, 1477Hz) and
represents a unique symbol.

PROCEDURE:-

 Open MATLAB
 Open new M-file
 Type the program
 Save in current directory
 Compile and Run the program
 For the output see command window/ Figure window

PROGRAM:
Clc;
Clear all;
Close all;
t = -2:0.05:2;
x=input('enter the input number');
fr1=697;
fr2=770;
fr3=852;
fr4=941;
fc1=1209;
fc2=1336;
fc3=1477;
fc4=1633;
y0 = sin(2*pi*fr4*t) + sin(2*pi*fc2*t); % 0
y1 = sin(2*pi*fr1*t) + sin(2*pi*fc1*t); % 1
y2 = sin(2*pi*fr1*t) + sin(2*pi*fc2*t); % 2
y3 = sin(2*pi*fr1*t) + sin(2*pi*fc3*t); % 3
y4 = sin(2*pi*fr2*t) + sin(2*pi*fc1*t); % 4
y5 = sin(2*pi*fr2*t) + sin(2*pi*fc2*t); % 5
y6 = sin(2*pi*fr2*t) + sin(2*pi*fc3*t); % 6
y7 = sin(2*pi*fr3*t) + sin(2*pi*fc1*t); % 7
y8 = sin(2*pi*fr3*t) + sin(2*pi*fc2*t); % 8
y9 = sin(2*pi*fr3*t) + sin(2*pi*fc3*t); % 9
y_start = sin(2*pi*fr4*t) + sin(2*pi*fc1*t); % *
y_canc = sin(2*pi*fr4*t) + sin(2*pi*fc3*t); % #
if (x==1)
plot(t,y1)
xlabel('time(t)')
ylabel('amplitude')
elseif (x==2)
plot(t,y2)
xlabel('time(t)')
ylabel('amplitude')
elseif (x==3)
plot(t,y3)
xlabel('time(t)')
ylabel('amplitude')
elseif (x==4)
plot(t,y4)
xlabel('time(t)')
ylabel('amplitude')
elseif (x==5)
plot(t,y5)
xlabel('time(t)')
ylabel('amplitude')
elseif (x==6)
plot(t,y6)
xlabel('time(t)')
ylabel('amplitude')
elseif (x==7)
plot(t,y7)
xlabel('time(t)')
ylabel('amplitude')
elseif (x==8)
plot(t,y8)
xlabel('time(t)')
ylabel('amplitude')
elseif (x==9)
plot(t,y9)
xlabel('time(t)')
ylabel('amplitude')
elseif (x==0)
plot(t,y0)
xlabel('time(t)')
ylabel('amplitude')
elseif (x==11)
plot(t,y_start)
xlabel('time(t)')
ylabel('amplitude')
elseif (x==12)
plot(t,y_canc)
xlabel('time(t)')
ylabel('amplitude')
else
disp('enter the correct input')
end

INPUT:-
Enter the input number = 7

OUTPUT:-

RESULT:- Generated of DTMF Signals using Matlab.


VIVA QUESTIONS:

1. Expand DTMF?
2. Define frequency groups for all symbols?
3. Define DTMF?
4. Give the applications of DTMF?
5. Define low frequency group and high frequency group?
6. Explain about multi rate digital signal processing.
7. List the Applications of multi rate digital signal processing
8. What is meant anti aliasing?
9. What is the effect of anti imaging filter?
10. What is meant by magnitude response?
EXPERIMENT NO-14
Implementation of Decimation Process

AIM: program to verify the decimation of given sequence.

APPARATUS REQUIRED: System with MATLAB

THEORY: “Decimation” is the process of reducing the sampling rate. “Downsampling” is a more
specific term which refers to just the process of throwing away samples, without the lowpass filtering
operation. The most immediate reason to decimate is simply to reduce the sampling rate at the output
of one system so a system operating at a lower sampling rate can input the signal. But a much more
common motivation for decimation is to reduce the cost of processing: the calculation and/or
memory required to implement a DSP system generally is proportional to the sampling rate, so the
use of a lower sampling rate usually results in a cheaper implementation.

Algorithm:
Step I : Define down sampling factor and input frequencies f1 and f2
Step II : Represent input sequence with frequencies f1 and f2
Step III : Perform the decimation on input signal using matlab command decimate.
Step IV : Plot the input and output sequence.

Procedure :
1) Open MATLAB
2) Open new M-file
3) Type the program
4) Save in current directory
5) Compile and Run the program
6) For the output see command window\ Figure window
PROGRAM:
Clc;
Clear all;
Close all;
D=input('enter the downsampling factor');
L=input('enter the length of the input signal');
f1=input('enter the frequency of first sinusodal');
f2=input('enter the frequency of second sinusodal');
n=0:L-1;
x=sin(2*pi*f1*n)+sin(2*pi*f2*n);
y=decimate(x,D,'fir');
subplot(2,1,1);
stem(n,x(1:L));
title('input sequence');
xlabel('time(n)');
ylabel('amplitude');
subplot(2,1,2)
m=0:(L/D)-1;
stem(m,y(1:L/D));
title('Decimated sequence');
xlabel('time(n)');
ylabel('amplitude');

INPUT:
enter the downsampling factor = 5
enter the length of the input signal = 100
enter the frequency of first sinusoidal = 0.01
enter the frequency of second sinusoidal = 0.03

Output Waveforms:
RESULT: Hence the decimation of given sequence verified using MATLAB.

VIVA QUESTIONS:
1. Explain about multi rate digital signal processing.
2. List the Applications of multi rate digital signal processing.
3. Define interpolation.
4. Define decimation.
5. Define aliasing
6. What are the two basic operations in multi-rate signal processing?
7. How can different sampling rates be obtained?
8. Name the areas in which multi-rate signal processing is used.
9. What are the advantages of multi-rate signal processing?
10. What are single-rate systems?
EXPERIMENT NO-15
Implementation of Interpolation Process

AIM: program to verify the Interpolation Process of given sequence.

APPARATUS REQUIRED: System with MATLAB.

THEORY
“Upsampling” is the process of inserting zero-valued samples between original samples to
increase the sampling rate. (This is called “zero-stuffing”.) “Interpolation”, is the process of
upsampling followed by filtering. The filtering removes the undesired spectral images. The primary
reason to interpolate is simply to increase the sampling rate at the output of one system so that
another system operating at a higher sampling rate can input the signal.

Algorithm:

Step I : Define up sampling factor and input frequencies f1 and f2


Step II : Represent input sequence with frequencies f1 and f2
Step II : Perform the interpolation on input signal using matlab command interp.
Step IV : Plot the input and output signal/sequence.

Flow Chart:
Procedure:-
1) Open MATLAB
2) Open new M-file
3) Type the program
4) Save in current directory
5) Compile and Run the program
6) For the output see command window\ Figure window
PROGRAM:
Clc;
Clear all;
Close all;
L=input('enter the upsampling factor');
N=input('enter the length of the input signal');
% Length should be greater than 8
f1=input('enter the frequency of first sinusodal');
f2=input('enter the frequency of second sinusodal');
n=0:N-1;
x=sin(2*pi*f1*n)+sin(2*pi*f2*n);
y=interp(x,L);
subplot(2,1,1)
stem(n,x(1:N))
title('input sequence');
xlabel('time(n)');
ylabel('amplitude');
subplot(2,1,2)
m=0:N*L-1;
stem(m,y(1:N*L))
title('output sequence ');
xlabel('time(n)');
ylabel('amplitude');

INPUT:
enter the upsampling factor = 5
enter the length of the input signal = 9
enter the frequency of first sinusoidal = 0.1
enter the frequency of second sinusoidal = 0.3

Output Waveforms:
RESULT: Hence the Interpolation Process of given sequence is verified using MATLAB.

VIVA QUESTIONS:
1. Explain about multi rate digital signal processing.
2. List the Applications of multi rate digital signal processing.
3. Define interpolation.
4. Define decimation.
5. Define aliasing.
6. MATLAB stands for what?
7. What is impulse function?
8. Differentiate between even and odd signals.
9. What is impulse function?
10. State sampling theorem.
EXPERIMENT NO-16
Implementation of I/D Sampling Rate Converters
AIM: program to implement sampling rate conversion.

APPARATUS REQUIRED: System with MATLAB


THEORY:
"Multirate"means"multiplesamplingrates".AmultirateDSPsystemusesmultiplesamplin
grateswithinthesystem.Wheneverasignalatoneratehastobeusedby a system that expects a
different rate, the rate has to be increased or decreased, andsome processing is required to do
so. Therefore "Multirate DSP" refers to the art orscience of changing sampling rates.
"Resampling" means combining interpolation anddecimationtochangethesamplingrateby
arationalfactor.Resamplingisdonetointerfacetwo systems with different sampling rates.

ALGOTITHAM:
Step I : Define up-sampling factor, down-sampling and inputfrequenciesf1 andf2

Step II: Represent input sequence with frequenciesf1 and f2


Step II: Perform I/D sampling rate conversion on input signal using math resample
Step IV: Plot the input and output signal/sequence.

Flow Chart:
Procedure:-
1) Open MATLAB
2) Open new M-file
3) Type the program
4) Save in current directory
5) Compile and Run the program
6) For the output see command window\ Figure window
PROGRAM:

Clc;
Clearall;Clos
eall;
L=input('enter the upsampling factor');
D=input('enter the downsampling factor');
N=input('enter the length of the input signal');
f1=input('enter the frequency of first sinusodal');
f2=input('enterthefrequencyofsecondsinusodal');
n=0:N-1;
x=sin(2*pi*f1*n)+sin(2*pi*f2*n);y=r
esample(x,L,D);
subplot(2,1,1)
stem(n,x(1:N))
title('inputsequence');xlab
el('time(n)');
ylabel('amplitude');subpl
ot(2,1,2)
m=0:N*L/D-1;
stem(m,y(1:N*L/D);
title('outputsequenc');xlab
el('time(n)');
ylabel('amplitude');
INPUT:
enter the up-sampling factor =3
enter the down-sampling factor=2
enter the length of the input signal=40
enter the frequency of first sinusoidal=0.01
enter the frequency of second sinusoidal = 0.03

OUTPUT WAVEFORMS

RESULT: Hence the sampling rate conversion verified using MATLAB.

VIVA QUESTIONS:
1. What is decimation?
2. Define down sampling.
3. How can different sampling rates be obtained?
4. Define up sampling.
5. What is interpolation?
6. What for decimation is used in multi-rate digital signal processing system?
7. What for interpolation is used in multi-rate digital signal processing system?
8. How is decimation achieved?
9. How is interpolation achieved?
10. What is sampling rate conversion?
LIST OF EXPERIMENTS USING DSP PROCESSOR ARCHITECTURE
AND INSTRUCTION SET OF DSPCHIP-TMS320C5515
Introduction to the TMS320C55x: The TMS320C55x digital signal processor (DSP) represents the
latest generation of ‟C5000 DSPs from Texas Instruments. The ‟C55x is built on the proven legacy of
the ‟C54x and is source code compatible with the ‟C54x, protecting the customer‟s software
investment. Following the trends set by the ‟C54x, the ‟C55x is optimized for power efficiency, low
system cost, and best-in-class performance for tight power budgets. With core power dissipation as
low as 0.05 mW/MIPS at 0.9V, and performance up to 800 MIPS (400 MHz), the TMS320C55x
offers a cost-effective solution to the toughest challenges in personal and portable processing
applications as well as digital communications infrastructure with restrictive power budgets.
Compared to a 120-MHz ‟C54x, a 300-MHz ‟C55x will deliver approximately 5X higher
performance and dissipate one-sixth the core power dissipation of the ‟C54x. The ‟C55x core‟s ultra-
low power dissipation of 0.05mW/MIPS is achieved through intense attention to low-power design
and advanced power management techniques. The ‟C55x designers have implemented an
unparalleled level of power-down configurability and granularity coupled with unprecedented power
management that occurs automatically and is transparent to the user. The ‟C55x core delivers twice
the cycle efficiency of the ‟C54x through a dual- MAC (multiply-accumulate) architecture with
parallel instructions, additional accumulators, ALUs, and data registers. An advanced instruction set,
a superset to that of the ‟C54x, combined with expanded busing structure complements the new
hardware execution units. The ‟C55x continues the standard set by the ‟C54x in code density
leadership for lower system cost. The ‟C55x instructions are variable byte lengths ranging in size
from 8 bits to 48 bits. With this scalable instruction word length, the ‟C55x can reduce control code
size per function by up to 40% more than ‟C54x. Reduced control code size means reduced memory
requirements and lower system cost.

Key Features of the ’C55x The ‟C55x incorporates a rich set of features that provide processing
efficiency, low-power dissipation, and ease of use. Some of these features are listed in Table
Overview of the C5515 eZdsp USB Stick

The C5515 eZdsp USB Stick is an evaluation tool for the Texas Instruments TMS320C5515 Digital
Signal Processor (DSP). This USB bus powered tool allows the user to evaluate the following items:

• The TMS320C5515 processor along with its peripherals

• The TLV320AIC3204 codec

• The Code Composer Studio IDETM software development tools


Key Features of the C5515 eZdsp USB Stick

The C5515 eZdsp USB Stick has the following features:

• Texas Instrument‟s TMS320C5515 Digital Signal Processor

• Texas Instruments TLV320AIC3204 Stereo Codec (stereo in, stereo out)

• Micro SD connector

• USB 2.0 interface to C5515 processor

• 32 Mb NOR flash

• I2C OLED display

• 5 user controlled LEDs

• 2 user readable push button switches

• Embedded USB XDS100 JTAG emulator

• Bluetooth board interface

• Expansion edge connector

• Power provided by USB interface

• Compatible with Texas Instruments Code Composer Studio v4


• USB extension cable C5515 eZdsp USB Stick Block Diagram

The block diagram of the C5515 eZdsp USB Stick is shown below.

CODE COMPOSER STUDIO


INTRODUCTION TO CODE COMPOSER STUDIO

Code Composer Studio™ (CCS or CCStudio) is the integrated development environment for TI's
DSPs, microcontrollers and application processors. CCStudio includes a suite of tools used to
develop and debug embedded applications. It includes compilers for each of TI's device families,
source code editor, project build environment, debugger, profiler, simulators and many other
features. CCStudio provides a single user interface taking users through each step of the application
development flow. Familiar tools and interfaces allow users to get started faster than ever before and
add functionality to their application thanks to sophisticated productivity tools. CCStudio version 4
(CCSv4) is based on the Eclipse open source software framework. CCSv4 is based on Eclipse
because it offers an excellent software framework for development environments a standard
framework many embedded software vendors. CCSv4 combines the advantages of the Eclipse
software framework with advanced embedded debug capabilities from TI resulting in a compelling
feature rich development environment for embedded developers.
Features Debugger
CCStudio's integrated debugger has several capabilities and advanced breakpoints to simplify
development. Conditional or hardware breakpoints are based on full C expressions, local variables or
registers. The advanced memory window allows you to inspect each level of memory so that you can
debug complex cache coherency issues. CCStudio supports the development of complex systems
with multiple processors or cores. Global breakpoints and synchronous operations provide control
over multiple processors and cores.

Profiling

CCStudio's interactive profiler makes it easy to quickly measure code performance and ensure the
efficient use of the target's resources during debug and development sessions. The profiler allows
developers to easily profile all C/C++ functions in their application for instruction cycles or other
events such as cache misses/hits, pipeline stalls and branches. Profile ranges can be used to
concentrate efforts on high-usage areas of code during optimization, helping developers produce
finely-tuned code. Profiling is available for ranges of assembly, C++ or C code in any combination.
To increase productivity, all profiling facilities are available throughout the development cycle.

Scripting

Some tasks such as testing need to run for hours or days without user interaction. To accomplish such
a task, the IDE should be able to automate common tasks. CCStudio has a complete scripting
environment allowing for the automation of repetitive tasks such as testing and performance
benchmarking. A separate scripting console allows you to type commands or to execute scripts
within the IDE.
Image Analysis and Visualization

CCStudio has many image analysis and graphic visualization. It includes the ability to graphically
view variables and data on displays which can be automatically refreshed. CCStudio can also look at
images and video data in the native format (YUV, RGB) both in the host PC or loaded in the target
board.

Compiler

TI has developed C/C++ compilers specifically tuned to maximize the processor's usage and
performance. TI compilers use a wide range of classical, application-oriented, and sophisticated
device-specific optimizations that are tuned to all the supported architectures.

Some of these optimizations include:

• Common sub-expression elimination

• Software pipelining

• Strength Reduction

• Auto increment addressing

• Cost-based register allocation

• Instruction predication

• Hardware looping

• Function In-lining

• Vectorization

TI compilers also perform program level optimizations that evaluate code performance at the
application level. With the program level view, the compiler is able to generate code similar to an
assembly program developer who has the full system view. This application level view is leveraged
by the compiler to make trade-offs that significantly increase the processor performance. The TI
ARM and Microcontroller C/C++ compilers are specifically tuned for code size and control code
efficiency. They offer industry leading performance and compatibility.

Simulation

Simulators provide a way for users to begin development prior to having access to a development
board. Simulators also have the benefit of providing enhanced visibility into application performance
and behavior. Several simulator variants are available allowing users to trade off cycle accuracy,
speed and peripheral simulation, with some simulators being ideally suited to algorithm
benchmarking and others for more detailed system simulation. Hardware Debugging (Emulation) TI
devices include advanced hardware debugging capabilities.
These capabilities include:

• IEEE 1149.1 (JTAG) and Boundary Scan

• Non-intrusive access to registers and memory

• Real-time mode which provides for the debugging of code that interacts with interrupts that must
not be disabled. Real-time mode allows you to suspend background code at break events while
continuing to execute time-critical interrupt service routines.

• Multi-core operations such as synchronous run, step, and halt. This includes crosscore triggering,
which provides the ability to have one core trigger other cores to halt. Advanced Event Triggering
(AET) which is available on selected devices, allows a user to halt the CPU or trigger other events
based on complex events or sequences such as invalid data or program memory accesses. It can non-
intrusively measure performance and count system events (for example, cache events).

CCStudio provides Processor Trace on selected devices to help customers find previously
“invisible” complex real-time bugs. Trace can detect the really hard to find bugs – race conditions
between events, intermittent real-time glitches, crashes from stack overflows, runaway code and false
interrupts without stopping the processor. Trace is a completely nonintrusive debug method that
relies on a debug unit inside the processor so it does not interfere or change the application‟s real-
time behavior. Trace can fine tune code performance and cache optimization of complex switch
intensive multi-channel applications. Processor Trace supports the export of program, data, timing
and selected processor and system events/interrupts. Processor Trace can be exported either to an
XDS560 Trace external JTAG emulator, or on selected devices, to an on chip buffer Embedded
Trace Buffer (ETB).

Real time operating system support

CCSv4 comes with two versions of TI's real time operating system:

• DSP/BIOS 5.4x is a real-time operating system that provides pre-emptive multitasking


services for DSP devices. Its services include ISR dispatching, software interrupts, semaphores,
messages, device I/O, memory management, and power management. In addition, DSP/BIOS 5.x
also includes debug instrumentation and tooling, including low-overhead print and statistics
gathering.

• BIOS 6.x is an advanced, extensible real-time operating system that supports ARM926,
ARM Cortex M3, C674x, C64x+, C672x, and 28x-based devices. It offers numerous kernel and
debugging enhancements not available in DSP/BIOS 5.x, including faster, more flexible memory
management, events, and priority-inheritance mutexes.

Note: BIOS 6.x includes a DSP/BIOS 5.x compatibility layer to support easy migration of
application source code.
Step 1: Open the code composer studio (CCSV4) and give a name to workspace and store it
in the default path itself. Note: don‟t assign other than default path unless you are familiar with
eclipse frame work based CCSV4

Step 2: Project windows overview


EXPERIMENT NO-1
COMPUTATION OF N- POINT DFT OF A GIVEN SEQUENCE

AIM: To compute the N (=4/8/16) point DFT of the given sequence

EQUIPMENTS:
1. Host (PC) with windows (95/98/Me/XP/NT/2000).
2. TMS320C5515 DSP Starter Kit (DSK).
THEORY:
Basic equation to find the DFT of a sequence is given below.

Basic equation to find the IDFT of a sequence is given below.

Program
//dft.c N-point DFT of sequence read from lookup table
#include <stdio.h>
#include <math.h>
#define PI 3.14159265358979
#define N 64
#define TESTFREQ 10000.0
#define SAMPLING_FREQ 64000.0
typedef struct
{
float real;
float imag;
} COMPLEX;
float x1[N],y1[N];
COMPLEX samples[N];
void dft(COMPLEX *x)
{
COMPLEX result[N];
int k,n,i;
for (k=0 ; k<N ; k++)

result[k].real=0.0;

result[k].imag = 0.0;

for (n=0 ; n<N ; n++)

result[k].real += x[n].real*cos(2*PI*k*n/N) + x[n].imag*sin(2*PI*k*n/N);

result[k].imag += x[n].imag*cos(2*PI*k*n/N) - x[n].real*sin(2*PI*k*n/N);

for (k=0 ; k<N ; k++)

x[k] = result[k];

printf("output");

for (i = 0 ; i < N ; i++) //compute magnitude

x1[i] = (int)sqrt(result[i].real*result[i].real + result[i].imag*result[i].imag);

printf("\n%d = %f",i,x1[i]);

void main()

//main function

int n;

for(n=0 ; n<N ; n++)


{

y1[n] = samples[n].real = c

os(2*PI*TESTFREQ*n/SAMPLING_FREQ);

samples[n].imag = 0.0;

printf("\n%d = %f",n,samples[n].real);

printf("real input data stored in array samples[]\n");

printf("\n");

// place breakpoint here dft(samples);

//call DFT function printf("done!\n");

Code Flow:

• Step 1 - Select no. of points for DFT(Eg: 64)

• Step 2 – Generate a sine wave of frequency „f „ (eg: 10 Hz with a sampling rate = No. of Points of
DFT(eg. 64)) using math library function.

• Step 3 - Take sampled data and apply DFT algorithm.

Execution Procedure:

Open CCstudio setup

Go to File Menu , select Import option.

In the Import Window under CCs choose Existing CCS/CCE Eclipse project then next.

In Select root Directory Browse for project file where it is located.

Select DFT Project folder and Finish it.

Now Connect the DSP Kit to PC and Launch it.(Follow the above given manual procedure from
Step 46 to 51)

Give Right Click on Your Dft.out file under Binaries and select Load program Option.

Now Go to Target select Run.


From Tools select Graph(Dual Time) , give properties and select OK.

Result: Hence the N (=4/8/16) point DFT of the given sequence computed.

Input Signal:

Output Signal :
EXPERIMENT NO-2

IMPLEMENTATION OF FFT OF GIVEN SEQUENCE


AIM: To compute the FFT of the given sequence

EQUIPMENTS:

1. Host (PC) with windows (95/98/Me/XP/NT/2000).

2. TMS320C5515 DSP Starter Kit (DSK).

FFT Algorithm The FFT has a fairly easy algorithm to implement, and it is shown step by step in
the list below. This version of the FFT is the Decimation in Time Method

1. Pad input sequence, of N samples, with Zero‟s until the number of samples is the nearest power of
two. e.g. 500 samples are padded to 512 (2^9)

2. Bit reverse the input sequence. e.g.

3 = 011 goes to 110 = 6 3. Compute (N / 2) two sample DFT's from the shuffled inputs. See
"Shuffled Inputs"

4. Compute (N / 4) four sample DFT's from the two sample DFT's. See "Shuffled Inputs"

5. Compute (N / 2) eight sample DFT's from the four sample DFT's. See "Shuffled Inputs"

6. Until the all the samples combine into one N-sample DFT

PROGRAM:

Main.c

#include "usbstk5515.h"

#include <math.h> #include <stdio.h>

#define PTS 64 //no of points for FFT

#define PI 3.14159265358979

typedef struct {float real,imag;}

COMPLEX;

void FFT(COMPLEX *Y, int n); //FFT prototype

float iobuffer[PTS]; //as input and output buffer

float x1[PTS]; //intermediate buffer


short i; //general purpose index variable

short buffercount = 0; //number of new samples in iobuffer

short flag = 0; //set to 1 by ISR when iobuffer full

COMPLEX w[PTS]; //twiddle constants stored in w

COMPLEX samples[PTS]; //primary working buffer

void main(void)

for(i=0;i<PTS;i++)

iobuffer[i]=0;

x1[i]=0;

printf("\n input");

for (i = 0 ; i<PTS ; i++) // set up twiddle constants in w

w[i].real = cos(2*PI*i/(PTS*2.0)); //Re component of twiddle constants

w[i].imag =-sin(2*PI*i/(PTS*2.0)); //Im component of twiddle constants

for (i = 0 ; i < PTS ; i++) //swap buffers

iobuffer[i] = sin(2*PI*10*i/64.0);/*10- > freq, 64 -> sampling freq*/

printf("\n%d = %f",i,iobuffer[i]);

samples[i].real=0.0; samples[i].imag=0.0;

for (i = 0 ; i < PTS ; i++) //swap buffers

{
samples[i].real=iobuffer[i]; //buffer with new data

for (i = 0 ; i < PTS ; i++)

samples[i].imag = 0.0; //imag components = 0

FFT(samples,PTS); //call function FFT.c

printf("\n output");

for (i = 0 ; i < PTS ; i++) //compute magnitude

x1[i] = sqrt(samples[i].real*samples[i].real + samples[i].imag*samples[i].imag);

printf("\n%d = %f",i,x1[i]);

} //end of main

fft.c

#define PTS 64 //# of points for FFT

typedef struct {float real,imag;

COMPLEX;

extern COMPLEX w[PTS]; //twiddle constants stored in w

void FFT(COMPLEX *Y, int N) //input sample array, # of points

COMPLEX temp1,temp2; //temporary storage variables

int i,j,k; //loop counter variables

int upper_leg, lower_leg; //index of upper/lower butterfly leg

int leg_diff; //difference between upper/lower leg

int num_stages = 0; //number of FFT stages (iterations)

int index, step; //index/step through twiddle constant


i = 1; //log(base2) of N points= # of stages

do

num_stages +=1;

i = i*2;

while (i!=N);

leg_diff = N/2; //difference between upper&lower legs

step = (PTS*2)/N; //step between values in twiddle.h

for (i = 0;i < num_stages; i++) //for N-point FFT

index = 0; for (j = 0; j < leg_diff; j++)

for (upper_leg = j; upper_leg < N; upper_leg += (2*leg_diff))

lower_leg = upper_leg+leg_diff;

temp1.real = (Y[upper_leg]).real + (Y[lower_leg]).real;

temp1.imag = (Y[upper_leg]).imag + (Y[lower_leg]).imag;

temp2.real = (Y[upper_leg]).real - (Y[lower_leg]).real;

temp2.imag = (Y[upper_leg]).imag - (Y[lower_leg]).imag;

(Y[lower_leg]).real = temp2.real*(w[index]).real

-temp2.imag*(w[index]).imag;

(Y[lower_leg]).imag = temp2.real*(w[index]).imag +temp2.imag*(w[index]).real;

(Y[upper_leg]).real = temp1.real;

(Y[upper_leg]).imag = temp1.imag; } index += step;

}
leg_diff = leg_diff/2; step *= 2;

j = 0;

for (i = 1; i < (N-1); i++) //bit reversal for resequencing data

k = N/2;

while (k <= j)

j = j - k;

k = k/2;

j = j + k;

if (i<j)

temp1.real = (Y[j]).real;

temp1.imag = (Y[j]).imag;

(Y[j]).real = (Y[i]).real;

(Y[j]).imag = (Y[i]).imag;

(Y[i]).real = temp1.real;

(Y[i]).imag = temp1.imag;

return;

Code Flow:

• Step 1 - Select no. of points for FFT(Eg: 64)


• Step 2 – Generate a sine wave of frequency „f „ (eg: 10 Hz with a sampling rate = No. of Points of
FFT(eg. 64)) using math library function.

• Step 3 - Take sampled data and apply FFT algorithm.

Execution Procedure:

Open CCstudio setup

Go to File Menu , select Import option.

In the Import Window under CCs choose Existing CCS/CCE Eclipse project then next.

In Select root Directory Browse for project file where it is located.

Select FFT Project folder and Finish it.

Now Connect the DSP Kit to PC and Launch it.(Follow the above given manual procedure from
Step 46 to 51)

Give Right Click on Your fft.out file under Binaries and select Load program Option.

Now Go to Target select Run.

From Tools select Graph (Dual Time) , give properties and select OK.

Result: Hence the FFT of the given sequence is computed.

Input Signal:

You might also like