Академический Документы
Профессиональный Документы
Культура Документы
LIST OF EXPERIMENTS
1 To study the architecture of DSP chips – TMS 320C 5X/6X Instructions
2 Linear Convolution
3 Circular Convolution
4 To design FIR filter (LP/HP) using windowing technique
a) Using rectangular window
b) Using triangular window
c) Using Kaiser window
5 To Implement IIR filter (LP/HP) on DSP Processors
6 N-point FFT algorithm.
7 MATLAB program to generate sum of sinusoidal signals
8 MATLAB program to find frequency response of analog LP/HP filters
9 To compute power density spectrum of a sequence
10 To find the FFT of given 1-D signal and plot
CODE COMPOSER STUDIO
1 sum of sinusoidal signals
2 Linear Convolution
3 frequency response of analog LP/HP filters
ADDITIONAL EXPERIMENTS BEYOND THE JNTUK SYLLABUS
11 Implementation of Decimation and interpolation process
12 Implementation of I/D sampling rate converters
13 DTMF(Dual Tone Multi Frequency) signal generation
Each semester end lab Examination shall be evaluated by an External Examiner along
with an Internal Examiner
Each semester Total Final lab Examination marks is the sum of marks obtained in
both internal and external Exams.
S.No Criteria Marks
1 Internal Examination 25M
2 External Examination 70M
Total Marks 75M
MATLAB:
This is very important tool used for making long complicated calculations and
plotting graphs of different functions depending upon our requirement. Using MATLAB an
m-file created in which the basic operations are performed which the basic operations are
performed which leads to simple short and simple computations of very complicated
problems in no or very short time.
Important functions performed by MATLAB are give as follows:
Matrix computations
Vector Analysis
Differential equations computations
Integration is possible
Computer language programming
Simulations
Graph Plotations
2D and 3D plotting
Befits:
Simple to use
Fast computations are possible
Wide working range
Solutions of matrix any order
Desired operations are performed in matrices
Different programming languages can be used
Simulation is possible
LIBRARY FUNCTIONS:
clc
Clear Command Window.
clc clears all input and output from the Command Window display, giving you a
"clean screen."
Close all
Remove specified figure
close deletes the current figure or the specified figure(s). It optionally returns the
status of the close operation.
close deletes the current figure
clear all
zeros
plot
subplot divides the current figure into rectangular panes that are numbered rowwise.
Each pane contains an axes object which you can manipulate using Axes Properties.
Subsequent plots are output to the current pane.
h = subplot(m,n,p) or subplot(mnp) breaks the figure window into an m-by-n matrix
of small axes, selects the pth axes object for the current plot, and returns the axes
handle. The axes are counted along the top row of the figure window, then the second
row, etc.
title
stem
% sine wave
t=0:0.01:0.5;
a=2;
b=a*sin(2*pi*2*t);
subplot(3,3,1);
stem(t,b);
xlabel('time');
ylabel('Amplitude');
title ('sinewave');
% Cosine wave
t=0:0.01:0.5;
a=2;
b=a*cos(2*pi*2*t);
subplot(3,3,2);
stem(t,b);
xlabel('time');
ylabel('Amplitude');
title ('Cos wave');
% Square wave
t=0:0.01:0.5;
a=2;
b=a*square(2*pi*2*t);
subplot(3,3,3);
stem(t,b);
xlabel('time');
ylabel('Amplitude');
title ('square wave');
% Exponential waveform
t=0:0.01:0.5;
a=2; b=a*exp(2*pi*2*t);
subplot(3,3,4);
stem(t,b);
xlabel('time');
ylabel('Amplitude');
title ('exponential wave');
%sawtooth
t=0:0.01:0.5;
a=2;
b=a*sawtooth(2*pi*2*t);
subplot(3,3,5);
stem(t,b);
xlabel('time');
ylabel('Amplitude');
title ('sawtooth wave');
% unit step signal
n=-5:5;
a = [zeros(1,5),ones(1,6)];
subplot(3,3,6);
stem(n,a);
Xlabel ('time');
Ylabel ('amplitude');
title('Unit step');
% unit impulse
n=-5:5;
a = [zeros(1,5),ones(1,1),zeros(1,5)];
subplot(3,3,7);
stem(n,a);
Xlabel ('time');
Ylabel ('amplitude');
title('Unit impulse');
Model Graph:
DATE :
- RAM
-ROM
- I/O ports
- Timer
Optimized for – fast arithmetic
- Extended precision
- Dual operand fetch
- Zero overhead loop
- Circular buffering
Feature Use
Fast-Multiply accumulate Most DSP algorithms, including filtering,
transforms, etc. are
multiplication- intensive
Multiple – access memory Many data-intensive DSP operations
architecture require reading a program instruction
and multiple data items during each
instruction cycle for best performance
Specialized addressing modes Efficient handling of data arrays and
first-in, first-out buffers in memory
Specialized program control Efficient control of loops for many
iterative DSP algorithms. Fast interrupt
handling for frequent I/O operations.
On-chip peripherals and I/O On-chip peripherals like A/D converters
interfaces allow for small low cost system designs.
Similarly I/O interfaces tailored for
common peripherals allow clean
interfaces to off-chip I/O devices.
ARCHITECTURE OF 6713 DSP PROCESSOR
This chapter provides an overview of the architectural structure of the TMS320C67xx
DSP, which comprises the central processing unit (CPU), memory, and on-chip peripherals.
The C67xE DSPs use an advanced modified Harvard architecture that maximizes processing
power with eight buses. Separate program and data spaces allow simultaneous access to
program instructions and data, providing a high degree of parallelism. For example, three
reads and one write can be performed in a single cycle. Instructions with parallel store and
application-specific instructions fully utilize this architecture. In addition, data can be
transferred between data and program spaces. Such Parallelism supports a powerful set of
arithmetic, logic, and bit-manipulation operations that can all be performed in a single
machine cycle. Also, the C67xx DSP includes the control mechanisms to manage interrupts,
repeated operations, and function calling.
Bus Structure
(ALU) and two 40-bit accumulators (accumulators A and B). The ALU can also perform
Boolean operations. The ALU uses these inputs:
_ 16-bit immediate value
_ 16-bit word from data memory
_ 16-bit value in the temporary register, T
_ Two 16-bit words from data memory
_ 32-bit word from data memory
_ 40-bit word from either accumulator
The ALU can also function as two 16-bit ALUs and perform two 16-bit operations
simultaneously.
Accumulators
Accumulators A and B store the output from the ALU or the multiplier/adder block.
They
can also provide a second input to the ALU; accumulator A can be an input to the
multiplier/adder. Each accumulator is divided into three parts:
Barrel Shifter
The C67x DSP barrel shifter has a 40-bit input connected to the accumulators or to
data memory (using CB or DB), and a 40-bit output connected to the ALU or to data memory
(using EB). The barrel shifter can produce a left shift of 0 to 31 bits and a right shift of 0 to
16 bits on the input data. The shift requirements are defined in the shift count field of the
instruction, the shift count field (ASM) of status register ST1, or in temporary register T
(when it is designated as a shift count register).The barrel shifter and the exponent encoder
normalize the values in an accumulator in a single cycle. The LSBs of the output are filled
with 0s, and the MSBs can be either zero filled or sign extended, depending on the state of
the sign-extension mode bit (SXM) in ST1. Additional shift capabilities enable the processor
to perform numerical scaling, bit extraction, extended arithmetic, and overflow prevention
operations.
Multiplier/Adder Unit
and ALU operations in parallel in a single instruction cycle. This function is used in
determining the Euclidian distance and in implementing symmetrical and LMS filters, which
are required for complex DSP algorithms. See section 4.5, Multiplier/Adder Unit, for more
details about the multiplier/adder unit.
These are the some of the important parts of the processor and you are instructed to go
through the detailed architecture once which helps you in developing the optimized code for
the required application.
EXPT. NO : 2
LINEAR CONVOLUTION DATE :
AIM :
Write a program in MATLAB to compute the response of a discrete LTI system with
input sequence x(n) and impulse response h(n) by using linear convolution.
COMPONENTS REQUIRED :
Personal Computer
MATLAB software.
THEORY:
Convolution is a special operation, operated between two signals and which includes
the following operations.
Folding.
Shifting.
Multiplication.
Addition
Convolution sum is useful to obtain the response of discrete LTI system with input
x(n) and impulse response h(n).
. y(n) x(n) h(n) x(m)h(n m)
m
It is also used to compute the impulse response of cascaded discrete LTI system with
individual systems having impulse responses h1(n), h2(n), h3(n).
Linear Convolution.
Circular Convolution.
Linear convoluted sequence y(n) between x(n) with duration N1and h(n) with duration N2 is
defined as
N 1
y(n) x(m)h(n m)
m0
DFT does not support linear convolution, because of x(n) and h(n) are of different durations.
That’s why we can go for circular convolution.
PROCEDURE:
PROGRAM:
MATLAB PROGRAM:
y=conv(x,h);
N1=length(x);
N2=length(h);
N=length(y);
disp(x);
disp(h);
disp(y);
n=0:1:N1-1;
subplot(2,2,1);
stem(n,x);
ylabel('Amplitude');
n=0:1:N2-1;
subplot(2,2,2);
stem(n,h);
ylabel('Amplitude');
n=0:1:N-1;
subplot(2,2,3);
stem(n,y);
ylabel('Amplitude');
EXPECTED RESULTS:
MODEL GRAPH:
RESULT:
Program is executed successfully and results are obtained as per the expected values.
EXPT. NO : 3
CIRCULAR CONVOLUTION DATE :
AIM:
Write a program in MATLAB to compute the response of a discrete LTI system with
input sequence x(n) and impulse response h(n) by using Circular convolution.
COMPONENTS REQUIRED :
Personal Computer
MATLAB software.
THEORY:
Convolution is a special operation, operated between two signals and which includes
the following operations.
Folding.
Shifting.
Multiplication.
Addition
Convolution sum is useful to obtain the response of discrete LTI system with input
x(n) and impulse response h(n).
x(n)
h(n) y(n)
. y(n) x(n) h(n) x(m)h(n m)
m
It is also used to compute the impulse response of cascaded discrete LTI system with
individual systems having impulse responses h1(n), h2(n), h3(n).
Linear Convolution.
Circular Convolution.
Linear convoluted sequence y(n) between x(n) with duration N1and h(n) with duration N2 is
defined as
N 1
y(n) x(m)h(n m)
m0
DFT does not support linear convolution, because of x(n) and h(n) are of different
durations. That’s why we can go for circular convolution.
DFT supports only circular convolution, because of x(n) and h(n) are equal durations.
Circular convoluted sequence y(n) between x(n) and h(n) with equal duration N is defined as
N 1
y(n) x(m)h(n m)
m0
In this case if x(n) and h(n) are of different durations, then zero padding is required to
obtain the response of discrete LTI system.
COMPUTATION:
Following steps are required to compute the response of discrete LTI system with
input x(n) and impulse response h(n)
Keep the input sequence x(m) as it is and fold the impulse response h(m).
Shift the folded version sequence, h(-m) by n units to get h(n-m).
Multiply the input sequence x(m) and h(n-m).
Finally compute the sum over the range 0 to N1+N2 –2.
PROCEDURE:
PROGRAM:
MATLAB PROGRAM:
y=cconv(x,h,p);
y1=length(y);
display('Input sequence x(n)');
disp(x);
display('Impulse sequence h(n)');
disp(h);
display('Output sequence y(n)');
disp(y);
t=0:1:m1-1;
subplot(2,2,1);
stem(t,x);
xlabel('Discrete Time');
ylabel('Amplitude');
title('Input Sequence');
t=0:1:n1-1;
subplot(2,2,2);
stem(t,h);
xlabel('Discrete Time');
ylabel('Amplitude');
title('Impulse response');
t=0:1:y1-1;
subplot(2,2,3);
stem(t,y);
xlabel('Discrete Time');
ylabel('Amplitude');
title('Response of discrete LTI System');
EXPECTED RESULTS:
MODEL GRAPH:
RESULT:
Program is executed successfully and results are obtained as per the expected values.
AIM:
COMPONENTS REQUIRED :
Personal Computer
MATLAB software.
THEORY:
In this equation, x(k) and y(n) represent the input to and output from the filter at time
n. h(n-k) is the transversal filter coefficients at time n. These coefficients are generated by
using FDS (Filter Design Software or Digital filter design package). FIR – filter is a finite
impulse response filter. Order of the filter should be specified. Infinite response is truncated
to get finite impulse response. placing a window of finite length does this. Types of windows
available are Rectangular, Barlett, Hamming, Hanning, Blackmann window etc. This FIR
filter is an all zero filter.
PROCEDURE:
PROGRAM:
MATLAB Program:
MODEL GRAPH:
EXPECTED RESULTS:
Enter Passband ripple=0.07
Enter Stopband ripple=0.06
Enter Passband cutoff frequency=1000
Enter Stopband cutoff frequency=1500
Enter Sampling Frequency=8000
MODEL GRAPH:
%%%%%%%%%%%Triangular Window-LPF%%%%%%%%
clc; close all; clear all;
rp=input('Enter Passband ripple=');
rs=input('Enter Stopband ripple=');
fp=input('Enter Passband cutoff frequency=');
fs=input('Enter Stopband cutoff frequency=');
f=input('Enter Sampling Frequency=');
wp=2*fp/f;
ws=2*fs/f;
% Finding order of filter
num=-20*log10(sqrt(rp*rs))-13;
dem=14.6*((fs-fp)/f);
n=ceil(num/dem);
n1=n+1;
%Triangular Window
y=triang(n1);
b=fir1(n,wp,'low',y);
[x1 y1]=freqz(b);
mag=20*log(abs(x1));
ang=angle(x1);
subplot(2,1,1);
plot(y1/pi,mag)
xlabel('Frequency');
ylabel('Gain in dB');
title('Magnitude Response of FIR Filter');
subplot(2,1,2);
plot(y1/pi,ang)
xlabel('Frequency');
ylabel('Phase in radius');
title('Phase Response of FIR Filter');
EXPECTED RESULTS:
Enter Passband ripple=0.06
Enter Stopband ripple=0.05
Enter Passband cutoff frequency=1000
Enter Stopband cutoff frequency=1500
Enter Sampling Frequency=8000
MODEL GRAPH:
%%%%%%%%%%%%%Trinagular Window-HPF%%%%%%%%%
clc; close all; clear all;
rp=input('Enter Passband ripple=');
rs=input('Enter Stopband ripple=');
fp=input('Enter Passband cutoff frequency=');
fs=input('Enter Stopband cutoff frequency=');
f=input('Enter Sampling Frequency=');
wp=2*fp/f;
ws=2*fs/f;
% Finding order of filter
num=-20*log10(sqrt(rp*rs))-13;
dem=14.6*((fs-fp)/f);
n=ceil(num/dem);
n1=n+1;
%Triangular Window
y=triang(n1);
b=fir1(n,wp,'high',y);
[x1 y1]=freqz(b);
mag=20*log(abs(x1));
ang=angle(x1);
subplot(2,1,1);
plot(y1/pi,mag)
xlabel('Frequency');
ylabel('Gain in dB');
title('Magnitude Response of FIR Filter');
subplot(2,1,2);
plot(y1/pi,ang)
xlabel('Frequency');
ylabel('Phase in radius');
title('Phase Response of FIR Filter');
EXPECTED RESULTS:
Enter Passband ripple=0.04
Enter Stopband ripple=0.03
Enter Passband cutoff frequency=1500
Enter Stopband cutoff frequency=2000
Enter Sampling Frequency=7000
MODEL GRAPH:
%%%%%%%%%%%Kaiser Window-LPF%%%%%%%%%%
EXPECTED RESULTS:
Enter Passband ripple=0.05
Enter Stopband ripple=0.04
Enter Passband cutoff frequency=1500
Enter Stopband cutoff frequency=2000
Enter Sampling Frequency=8000
MODEL GRAPH:
%%%%%%%%%%Kaiser Window-HPF%%%%%%%
EXPECTED RESULTS:
Enter Passband ripple=0.04
Enter Stopband ripple=0.03
Enter Passband cutoff frequency=1000
Enter Stopband cutoff frequency=1500
Enter Sampling Frequency=7000
MODEL GRAPH:
RESULT:
Program is executed successfully and results are obtained as per the expected values.
AIM:
Write a program in MATLAB to design IIR (LP/HP) filters for the given
specifications pass band frequency, stop band frequency, gain at pass band frequency and
gain at stop band frequency.
COMPONENTS REQUIRED :
Personal Computer
MATLAB software.
THEORY:
The IIR filter can realize both the poles and zeroes of a system because it has a
rational transfer function, described by polynomials in z in both the numerator and the
denominator:
M and N are order of the two polynomials. bk and ak are the filter coefficients. These filter
coefficients are generated using FDS (Filter Design software or Digital Filter design
package). IIR filters can be expanded as infinite impulse response filters. In designing IIR
filters, cutoff frequencies of the filters should be mentioned. The order of the filter can be
estimated using butter worth polynomial. That’s why the filters are named as butter worth
filters. Filter coefficients can be found and the response can be plotted.
PROCEDURE:
PROGRAM:
MATLAB PROGRAM :
%%%%%%%%%Butterworth Filter-LPF%%%%%%%%%
clc; close all; clear all;
rp=input('Enter Passband ripple=');
rs=input('Enter Stopband ripple=');
fp=input('Enter Passband cutoff frequency=');
fs=input('Enter Stopband cutoff frequency=');
f=input('Enter Sampling Frequency=');
wp=2*fp/f;
ws=2*fs/f;
[n,wc]=buttord(wp,ws,rp,rs);
[a b]=butter(n,wc,'low');
[x1 y1]=freqz(a,b,256);
mag=20*log(abs(x1));
ang=angle(x1);
subplot(2,1,1);
plot(y1/pi,mag)
xlabel('Frequency');
ylabel('Gain in dB');
title('Magnitude Response of FIR Filter');
subplot(2,1,2);
plot(y1/pi,ang)
xlabel('Frequency');
ylabel('Phase in radius');
title('Phase Response of FIR Filter');
EXPECTED RESULTS:
Enter Passband ripple=0.15
Enter Stopband ripple=60
Enter Passband cutoff frequency=1500
Enter Stopband cutoff frequency=3000
Enter Sampling Frequency=7000
MODEL GRAPH:
%%%%%%%%%Butterworth Filter-HPF%%%%%%%%%
clc; close all; clear all;
rp=input('Enter Passband ripple=');
rs=input('Enter Stopband ripple=');
fp=input('Enter Passband cutoff frequency=');
fs=input('Enter Stopband cutoff frequency=');
f=input('Enter Sampling Frequency=');
wp=2*fp/f;
ws=2*fs/f;
[n,wc]=buttord(wp,ws,rp,rs);
[a b]=butter(n,wc,'high');
[x1 y1]=freqz(a,b,256);
mag=20*log(abs(x1));
ang=angle(x1);
subplot(2,1,1);
plot(y1/pi,mag)
xlabel('Frequency');
ylabel('Gain in dB');
title('Magnitude Response of FIR Filter');
subplot(2,1,2);
plot(y1/pi,ang)
xlabel('Frequency');
ylabel('Phase in radius');
title('Phase Response of FIR Filter');
EXPECTED RESULTS:
Enter Passband ripple=0.15
Enter Stopband ripple=60
Enter Passband cutoff frequency=1500
Enter Stopband cutoff frequency=3000
Enter Sampling Frequency=8000
MODEL GRAPH:
EXPECTED RESULTS:
Enter Passband ripple=0.3
Enter Stopband ripple=30
Enter Passband cutoff frequency=1000
Enter Stopband cutoff frequency=1500
Enter Sampling Frequency=8000
MODEL GRAPH:
EXPECTED RESULTS:
MODEL GRAPH:
EXPECTED RESULTS:
MODEL GRAPH:
EXPECTED RESULTS:
Enter Passband ripple=0.4
Enter Stopband ripple=40
Enter Passband cutoff frequency=1000
Enter Stopband cutoff frequency=1500
Enter Sampling Frequency=8000
MODEL GRAPH:
RESULT:
Program is executed successfully and results are obtained as per the expected values.
AIM
COMPONENTS REQUIRED :
Personal Computer
MATLAB software.
THEORY:
The Fast Fourier Transform is useful to map the time-domain sequence into a
continuous function of a frequency variable. The FFT of a sequence {x(n)} of length N is
given by a complex-valued sequence X(k).
The above equation is the mathematical representation of the DFT. As the number of
computations involved in transforming a N point time domain signal into its corresponding
frequency domain signal was found to be N2 complex multiplications, an alternative
algorithm involving lesser number of computations is opted. When the sequence x(n) is
divided into 2 sequences and the DFT performed separately, the resulting number of
computations would be N2/2
Consider x(2n) be the even sample sequences and x(2n+1) be the odd sample
sequence derived form x(n).
Further solving
Dividing the sequence x(2n) into further 2 odd and even sequences would reduce the
computations.
WN - is the twiddle factor
The time burden created by this large number of computations limits the usefulness of
DFT in many applications. Tremendous efforts devoted to develop more efficient ways of
computing DFT resulted in the above explained Fast Fourier Transform algorithm. This
mathematical shortcut reduces the number of calculations the DFT requires drastically. The
above mentioned radix-2 decimation in time FFT is employed for domain transformation.
Dividing the DFT into smaller DFTs is the basis of the FFT. A radix-2 FFT divides
the DFT into two smaller DFTs, each of which is divided into smaller DFTs and so on,
resulting in a combination of two-point DFTs. The Decimation -In-Time (DIT) FFT divides
the input (time) sequence into two groups, one of even samples and the other of odd samples.
N/2 point DFT are performed on the these sub-sequences and their outputs are combined to
form the N point DFT.
The above shown mathematical representation forms the basis of N point FFT and is called
the Butterfly Structure.
PROCEDURE:
PROGRAM:
MATLAB PROGRAM:
ylabel('Amplitude');
title('Input Sequence');
subplot(3,1,2);
stem(t,y);
xlabel('Discrete Time');
ylabel('Amplitude');
title('FFT Sequence');
subplot(3,1,3);
stem(t,m);
xlabel('Discrete Time');
ylabel('Amplitude');
title('Magnitude Response');
figure
subplot(1,2,1);
stem(t,a);
xlabel('Discrete Time');
ylabel('Amplitude');
title('Phase Response');
subplot(1,2,2);
stem(t,z);
xlabel('Discrete Time');
ylabel('Amplitude');
title('Magnitude Response');
EXPECTED RESULTS:
Enter Input Sequence=[1 2 3 4]
Input sequence x(n)=
1 2 3 4
FFT Sequence y(n)=
InverseFFT
1 2 3 4
MODEL GRAPH:
RESULT:
Program is executed successfully and results are obtained as per the expected values.
AIM:
Write a program in MATLAB to generate two sinusoidal signals and its sum.
COMPONENTS REQUIRED :
Personal Computer
MATLAB software.
THEORY:
A signal can be defined as a physical quantity, which varies with respect to one or
more independent variables. Mathematically signal can be defined as a function, which varies
with respect to time and conveys some information. Information may be temperature,
Voltage, Current, Power etc. Based on variation of amplitude of a signal, signals are
classified into two categories.
Example :
-1
0 20 40 60 80 100
Continuous Time (t)
Discrete time signals are those for which the signal amplitude is discretely varies with
respect to discrete variation in time.
Example :
0.5
Amplitude
-0.5
-1
0 10 20 30 40 50 60 70 80 90 100
Discrete Time (n)
PROCEDURE:
PROGRAM:
MATLAB PROGRAM:
MODEL GRAPH:
MATLAB PROGRAM:
MODEL GRAPH:
RESULT:
Program is executed successfully and results are obtained as per the expected values.
DATE :
AIM:
COMPONENTS REQUIRED:
Personal Computer
MATLAB software.
THEORY:
Filter is a frequency selective device, which allows only specified band of frequencies
of a input signal and attenuate all other unwanted frequencies of input signal. Based on the
frequency response of the filter, filters are classified into four types.
Where
1
Y(s) I(s).
sC
X(s) 1
Y(s) .
1 sC
R
sC
X(s)
Y(s) .
RCs 1
Y(s) 1
.
X(s) RCs 1
1
H(s) .
1 sRC
1
H(j ω)
1 jω R C
1
H(j ω) and
1 (ω RC ) 2
H(j ω ) Tan 1 (ωωRC
Ideal characteristics
1 Practical characteristics
0 c
High Pass Filter: High pass filter allows only high frequencies of input signal and attenuate
all other low frequencies of input signal. A simple RC high pass filter shown below
Where
X(s)
Loop equation I(s)
1
R
sC
Y(s) I(s). R
X(s)
Y(s) .R
1
R
sC
sRCX(s)
Y(s) .
RCs 1
Y(s) sRC
.
X(s) RCs 1
sRC
H(s) .
1 sRC
jRC
H(j ω)
1 jω R C
ω RC
H(j ω) and
1 (ω RC ) 2
H(j ) Tan 1 ( ωRC)
Characteristics of HPF:
H(j)
Ideal characteristics
Practical characteristics
0 c
Band Pass Filter: Band pass filter allows only a certain band of frequencies and
attenuate all other unwanted frequencies of input signal.
Characteristics of BSF:
H(j)
Ideal characteristics
Practical characteristics
0 c1 c2
Band Stop Filter: Band stop filter allows entire band of frequencies of input signal,
except a certain band of input signal.
Characteristics of BPF:
H(j)
1 Ideal
characteristics
Practical characteristics
0 c1 c2
PROCEDURE:
PROGRAM:
MATLAB PROGRAM:
ks=k.*k;
S=sqrt(1+ks);
MSofLPF=S.^-1;
MSofHPF=k.*(S.^-1);
display('Amplitude of Magnitude Spectrum of LPF');
disp(MSofLPF);
display('Amplitude of Magnitude Spectrum of HPF');
disp(MSofHPF);
subplot(2,1,1);
plot(W,MSofLPF);
title('Response of LPF');
xlabel('Frequency');
ylabel('Amplitude');
subplot(2,1,2);
plot(W,MSofHPF);
title('Response of HPF');
xlabel('Frequency');
ylabel('Amplitude');
EXPECTED RESULTS:
MODEL GRAPH:
RESULT:
Program is executed successfully and results are obtained as per the expected values.
DATE :
AIM :
COMPONENTS REQUIRED :
Personal Computer
MATLAB software.
THEORY:
PROCEDURE:
PROGRAM:
MATLAB PROGRAM:
RESULT:
Program is executed successfully and results are obtained as per the expected values.
DATE :
AIM:
COMPONENTS REQUIRED :
Personal Computer
MATLAB software.
THEORY:
1D, an important concept in linear system analysis is that of the Fourier transform.
The Fast Fourier Transform is useful to map the time-domain sequence into a continuous
function of a frequency variable. The FFT of a sequence {x(n)} of length N is given by a
complex-valued sequence X(k).
The above equation is the mathematical representation of the DFT. As the number of
computations involved in transforming a N point time domain signal into its corresponding
frequency domain signal was found to be N2 complex multiplications, an alternative
algorithm involving lesser number of computations is opted. When the sequence x(n) is
divided into 2 sequences and the DFT performed separately, the resulting number of
computations would be N2/2
Consider x(2n) be the even sample sequences and x(2n+1) be the odd sample
sequence derived form x(n).
Further solving
Dividing the sequence x(2n) into further 2 odd and even sequences would reduce the
computations.
WN - is the twiddle factor
The time burden created by this large number of computations limits the usefulness of
DFT in many applications. Tremendous efforts devoted to develop more efficient ways of
computing DFT resulted in the above explained Fast Fourier Transform algorithm. This
mathematical shortcut reduces the number of calculations the DFT requires drastically. The
above mentioned radix-2 decimation in time FFT is employed for domain transformation.
Dividing the DFT into smaller DFTs is the basis of the FFT. A radix-2 FFT divides
the DFT into two smaller DFTs, each of which is divided into smaller DFTs and so on,
resulting in a combination of two-point DFTs.
PROCEDURE:
PROGRAM:
MATLAB PROGRAM:
MODEL GRAPH:
RESULT:
ADDITIONAL EXPERIMENTS
OTHER THAN JNTU-K
SYLLABUS
AIM:
COMPONENTS REQUIRED :
Personal Computer
MATLAB software.
THEORY:
Decimation is the process of reducing the sampling frequency of a signal to a lower
sampling frequency that differs from the original frequency by an integer value. Decimation
also is known as down-sampling. The lowpass filtering associated with decimation removes
high-frequency content from the signal to accommodate the new sampling frequency.
Decimation is useful in applications in which the Nyquist frequency of a signal is much
higher than the highest frequency of the signal. Decimation filters help you remove the
excess bandwidth and reduce the sampling frequency of the signal. Decimation filters also
help you reduce the computational resources required for processing and storing the signal.
During the analog-to-digital (A/D) conversion process, decimation filters also can reduce the
variance of quantization noise in a signal and maintain the signal power, thus improving the
signal-to-noise ratio (SNR).
Upsampling is the process of increasing the sampling rate of a signal and upsampling
images faster such as photographs means increasing the resolution of the image. The
upsampling factor (commonly denoted by L) is usually an integer or a rational fraction
greater than unity. This factor multiplies the sampling rate or, equivalently, divides the
sampling period.
The process of increasing the sampling rate is called interpolation. Interpolation is
upsampling followed by appropriate filtering(n). Obtained by interpolating y(n) , is generally
represented as:
y(n)=x(n/L)
The simplest method to interpolate by a factor of L is to add L-1 zeros in between the
samples, multiply the amplitude by L and filter the generated signal, with a so-called anti-
imaging low pass filter at the high sampling frequency.
PROCEDURE:
PROGRAM:
EXPECTED RESULTS:
DECIMATION:
INTERPOLATION:
Enter sample value = 50
Enter up sampling factor = 2
MODEL GRAPH:
DECIMATION:
INTERPOLATION:
RESULT:
COMPONENTS REQUIRED :
Personal Computer
MATLAB software.
THEORY:
"Up sampling" is the process of inserting zero-valued samples between original
samples to increase the sampling rate. (This is called "zero-stuffing".) Up sampling adds to
the original signal undesired spectral images which are centered on multiples of the original
sampling rate. "Interpolation", in the DSP sense, is the process of up sampling followed by
filtering. (The filtering removes the undesired spectral images.) As a linear process, the DSP
sense of interpolation is somewhat different from the "math" sense of interpolation, but the
result is conceptually similar: to create "in-between" samples from the original samples. The
result is as if you had just originally sampled your signal at the higher rate.
PROCEDURE:
PROGRAM:
EXPECTED RESULTS:
MODEL GRAPH:
RESULT:
DATE :
AIM:
COMPONENTS REQUIRED :
Personal Computer
MATLAB software.
THEORY:
PROCEDURE:
PROGRAM:
t=[0:1/fs:T]';
tx=[sin(x(1)*t),sin(x(2)*t),sin(x(3)*t),sin(x(4)*t)]/2;
ty=[sin(y(1)*t),sin(y(2)*t),sin(y(3)*t),sin(y(4)*t)]/2;
for k=1:length(number)
switch number(k)
case '1'
tone = tx(:,1)+ty(:,1);
sound(tone);
stem(tone);
case '2'
tone = tx(:,1)+ty(:,2);
sound(tone);
stem(tone);
case '3'
tone = tx(:,1)+ty(:,3);
sound(tone);
stem(tone);
case '4'
tone = tx(:,2)+ty(:,1);
sound(tone);
stem(tone);
otherwise
disp('invalid number');
end
pause(2.70) ;
end;
EXPECTED RESULTS:
Number = 01234
MODEL GRAPH:
RESULT:
Dual Tone Multiple Frequency (DTMF) Signals are generated by using MAT LAB.
CODE COMPOSER
STUDIO
SIGNALS DATE :
AIM:
Write a program in C to generate two sinusoidal signals and its sum.
COMPONENTS REQUIRED :
1. Personal Computer
THEORY:
A signal can be defined as a physical quantity, which varies with respect to one or
more independent variables. Mathematically signal can be defined as a function, which varies
with respect to time and conveys some information. Information may be temperature,
Voltage, Current, Power etc. Based on variation of amplitude of a signal, signals are
classified into two categories.
PROCEDURE:
PROGRAM:
CCS PROGRAM:
#include<stdio.h>
#include<math.h>
float x1[127],x2[127],x[127];
void main()
int t;
for(t=0;t<127;t++)
x1[t]=sin(2*3.14*freq*t/24000);
x2[t]=sin(2*3.14*freq*t/14000);
x[t]=x1[t]+x2[t];
printf(“\n%f”,x1[t]);
printf(“\n%f”,x2[t]);
printf(“\n%f”,x[t]);
MODEL GRAPH:
RESULT:
Program is executed successfully and results are obtained as per the expected values.
EXPT. NO: 2
LINEAR CONVOLUTION
DATE :
AIM:
Write a program in C to compute the response of a discrete LTI system with input
sequence x(n) and impulse response h(n) by using linear convolution.
COMPONENTS REQUIRED :
3. Personal Computer
THEORY:
Convolution is a special operation, operated between two signals and which includes
the following operations.
1. Folding.
2. Shifting.
3. Multiplication.
4. Addition
Convolution sum is useful to obtain the response of discrete LTI system with input
x(n) and impulse response h(n).
x(n)
h(n) y(n)
. y(n) x(n) h(n) x(m)h(n m)
m
1. Linear Convolution.
2. Circular Convolution.
Linear convoluted sequence y(n) between x(n) with duration N1and h(n) with duration N2 is
defined as
N 1
y(n) x(m)h(n m)
m0
DFT does not support linear convolution, because of x(n) and h(n) are of different
durations. That’s why we can go for circular convolution.
DFT supports only circular convolution, because of x(n) and h(n) are equal durations.
Circular convoluted sequence y(n) between x(n) and h(n) with equal duration N is defined as
N 1
y(n) x(m)h(n m)
m0
In this case if x(n) and h(n) are of different durations, then zero padding is required to
obtain the response of discrete LTI system.
PROGRAM:
CCS PROGRAM:
#include<stdio.h>
int x[15],h[15],y[15];
main()
int i,j,m,n;
for(i=0;i<m;i++)
for(i=0;i<n; i++)
scanf("%d",&h[i]);
for(i=m;i<=m+n-1;i++)
x[i]=0;
for(i=n;i<=m+n-1;i++)
h[i]=0;
for(i=0;i<m+n-1;i++)
y[i]=0;
for(j=0;j<=i;j++)
y[i]=y[i]+(x[j]*h[i-j]);
for(i=0;i<m+n-1;i++)
MODEL GRAPH:
Input Sequence:
Impulse Response:
Output:
Enter value of input sequence = 4
Enter value of impulse response = 4
Enter values for input sequence x(n)= 1 2 3 4
Enter values for impulse response h(n)= 4 3 2 1
The values of output y[0]=4
The values of output y[1]=11
The values of output y[2]=20
The values of output y[3]=30
The values of output y[4]=20
The values of output y[5]=11
The values of output y[6]=4
RESULT:
Program is executed successfully and results are obtained as per the expected values.
LPF/HPF DATE :
AIM:
COMPONENTS REQUIRED:
3. Personal Computer
THEORY:
Filter is a frequency selective device, which allows only specified band of frequencies
of a input signal and attenuate all other unwanted frequencies of input signal. Based on the
frequency response of the filter, filters are classified into four types.
High Pass Filter: High pass filter allows only high frequencies of input signal and attenuate
all other low frequencies of input signal.
Band Pass Filter: Band pass filter allows only a certain band of frequencies and attenuate
all other unwanted frequencies of input signal.
Band Stop Filter: Band stop filter allows entire band of frequencies of input signal,
except a certain band of input signal.
PROGRAM:
CCS PROGRAM:
#include<studio.h>
#include<math.h>
int w,L;
float r,c,k,ks,lpf[1000],hpf[1000];
void main()
{
Printf(“Enter resistor value of filter, r=”);
Scanf(“%f”, &r);
Printf(“Enter capacitor value of filter, c=”);
Scanf(“%f”, &c);
Printf(“Enter frequency repo value of filter, L=”);
Scanf(“%d”, &L);
Printf(“\n Analog filter”);
Printf(“Resistor(r)=%f”,r);
Printf(“Capacitor(c)=%f”,c);
r=1000*r;
c=c/1000000;
for(w=0;w<L,w++)
{
K=w*r*c;
Ks=k*k;
lpf[w]=1/sqrt(1+ks);
hpf[w]=k/sqrt(1+ks);
}
Printf(“Magnitude response of LPF\n”);
For(w=0;w<=L;w++)
Printf(“lpf[%f]=%f”,w,lpf[w]);
Printf(“Magnitude response of HPF\n”);
For(w=0;w<=L;w++)
Printf(“hpf[%f]=%f”,w,hpf[w]);
}
MODEL GRAPH:
EXPECTED RESULTS:
RESULT:
Program is executed successfully and results are obtained as per the expected values.