0% found this document useful (0 votes)
94 views5 pages

DSP 3

The document describes an experiment to generate sinusoidal waveforms using recursive difference equations. It provides the theory behind recursive and non-recursive filters. The code generates a sinusoidal signal and random signal using recursion functions. It plots the outputs and verifies that sinusoidal waveforms can be created through recursive equations using MATLAB. The applications of recursive equations in signal processing, control systems, and image processing are also outlined.

Uploaded by

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

DSP 3

The document describes an experiment to generate sinusoidal waveforms using recursive difference equations. It provides the theory behind recursive and non-recursive filters. The code generates a sinusoidal signal and random signal using recursion functions. It plots the outputs and verifies that sinusoidal waveforms can be created through recursive equations using MATLAB. The applications of recursive equations in signal processing, control systems, and image processing are also outlined.

Uploaded by

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

NAME:K.

SAI PRARDHANA DATE:


ROLL NO: 21EG104A45 PAGE NO:

EXPERIMENT – 1
GENERATION OF SINUSOIDAL WAVEFORM / SIGNAL BASED
ON RECURSIVE DIFFERENCE EQUATIONS

Aim: To Generate Sinusoidal wave form / signal based on recursive difference equations.
Apparatus: software: matlab2023a
Hardware:personal computer

Theory:

A recursive filter has feedback from output to input,and in general its output is a function of the previous
outputvsamples and the present and past input samples as described by the following equation.

Where {ak,bk} are the filter coefficients and the output y(m) is a linera combination of the previous N
output samples[y(m-1)…..y(m-N)},the present input sample x(m) and the previous M input samples
[x(m-1)…x(m-N)].Thus a recursive filter is known as an infinite Impulse Response(IIR) filter.

A non Recursive filter has no feedback and its input output relation is given by

The output y(m) pf a non recursive filter is a function only of the input signal x(m). The response of such a
filter to an impulse consists of a finite sequence of M+1 samples,where M is the filter order.Hence,the filter
is known as a Finite Impulse Response(FIR) filter.
A first order filter recursive difference equation is given by

Y(m)=ay(m-1)+x(m)
.

ANURAG UNIVERSITY DIGITAL SIGNAL PROCESSING LAB ECE DEPARTMENT


NAME: K.SAI PRARDHANA DATE:
ROLL NO: 21EG104A45 PAGE NO:

ANURAG UNIVERSITY DIGITAL SIGNAL PROCESSING LAB ECE DEPARTMENT


NAME: K.SAI PRARDHANA DATE:
ROLL NO: 21EG104A45 PAGE NO:

Source code:

clc;
clear all;
close all;
%generation of sinusoidal signal using recursive function
t=0:0.01:5 %defining time interval
x=sin((2*pi+4)*t) %generation of sine signal
y=2*cos((2*pi+4)*t) %generation of cos signal
y(1)=x(1)
for n=2:20 %recursion using for loop
y(n)=0.2*x(n)+0.4*x(n-1)+0.5*y(n-1) %recursion function
end %end of loop
subplot(2,1,1)
plot(y) %plotting the sine signal
xlabel('time') %labelling x-axis
ylabel('amplitude') %labelling y-axis
title('generation of sinusoidal signal using recursive function')
%labelling the title

%generation of random signal using recursive function


n=1:20
x=rand(1,20) %generation of random signal x
y=rand(1,20) %generation of random signal y
y(1)=x(1)
for n=2:20 %recursion using for loop
y(n)=0.1*x(n)+0.4*x(n-1)+0.5*y(n-1) %recursion function
end %end of loop
subplot(2,1,2)
plot(y) %plotting the sine signal
xlabel('time') %labelling x-axis
ylabel('amplitude') %labelling y-axis
title('generation of random signal using recursive function')
%labelling the title
gtext('21EG104A45')

ANURAG UNIVERSITY DIGITAL SIGNAL PROCESSING LAB ECE DEPARTMENT


NAME: K.SAI PRARDHANA DATE:
ROLL NO: 21EG104A45 PAGE NO:

ANURAG UNIVERSITY DIGITAL SIGNAL PROCESSING LAB ECE DEPARTMENT


NAME: K.SAI PRARDHANA DATE:
ROLL NO: 21EG104A45 PAGE NO:

Procedure:
1. Open MATLAB application.
2. Create an editor file in “.m” format.
3.Type the program in the editor window.
4.And save the file in any of the drive using “.m” format.
5.Run the program.
6. Check if there are any errors in the command
window. 7.The result will be shown in the command
window

Applications:
1. Signal processing:
Filter Design: Recursive equations are often used in designing digital filters, such as Infinite
Impulse Response (IIR) filters
2. Control systems.
Transfer Functions: Recursive equations are used to represent and analyze systems in control
theory, particularly in the context of transfer functions for systems with feedback.
3. Image processing
Recursive Filters: Recursive equations are employed in image processing for tasks such as image
smoothing, edge detection, and noise reduction using recursive filters.

Result:
Generation of sinusoidal waveform / signal based on recursive difference equations is
performed and the output graphs are verified using Matlab 2023a.

ANURAG UNIVERSITY DIGITAL SIGNAL PROCESSING LAB ECE DEPARTMENT

You might also like