Experiment - 1: Generation of Sinusoidal Waveform / Signal Based On Recursive Difference Equations Aim: Apparatus
Experiment - 1: Generation of Sinusoidal Waveform / Signal Based On Recursive Difference Equations Aim: Apparatus
DATE:
ROLL NO : 21EG104A46 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: T,LAKSHMI PRASANNA DATE:
ROLL NO : 21EG104A46 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=4:20 %recursion using for loop
y(n)=1*x(n)+0.3*x(n-2)+0.6*y(n-3) %recursive function
end %end of loop
subplot(2,1,1)
plot(y) %plotting the sine signal
xlabel('time') %labelling on x-axis
ylabel('amplitude') %labelling on y-axis
title("Generation of sinusoidal signal using recursive function") %labelling the title
Output waveforms:
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.