Final Lab Manual ECE_EEE Stream
Final Lab Manual ECE_EEE Stream
Name :
USN :
Section :
INSTITUTE VISION
INSTITUTE MISSION
DEPARTMENT VISION
DEPARTMENT MISSION
5. Modern tool usage: Create, select, and apply appropriate techniques, resources, and
modern engineering and IT tools including prediction and modelling to complex engineering activities
with anunderstanding of the limitations.
6. 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.
7. Environment and sustainability: Understand the impact of the professional
engineering solutions in societal and environmental contexts, and demonstrate the
knowledge of, and need for sustainabledevelopment.
8. Ethics: Apply ethical principles and commit to professional ethics and responsibilities
and norms of the engineering practice.
9. Individual and team work: Function effectively as an individual, and as a member or
leader in diverse teams, and in multidisciplinary settings.
10. 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.
11. 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.
12. 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
Do’s
It is mandatory for all the students to attend all practical classes & complete the
Students should strictly follow the lab timings, dress code with ID cards.
Submit the complete lab records of executed programs and update the index book in
Should prepare for viva questions regularly. Handle the computers systems carefully.
Don’ts
Should not take Bags and Mobile phones into the Laboratory.
Systems & components should be handled carefully failing to which penalty will be
imposed.
(23ECI301)
CO1 Illustrate the fundamental concepts of transforms and PO1, PO2, PO3, PO5, PO12,
CO2 Apply the knowledge of transform calculus, Fourier series PO1, PO2, PO3, PO5, PO12,
CO3 Analyze the solution of the problems using suitable PO1, PO2, PO3, PO5, PO12,
statistical methods.
CO4 Interpret the knowledge of transform calculus, Fourier PO1, PO2, PO3, PO5, PO12,
Correlation Matrix
CO/PO PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 P09 PO10 PO11 PO12 PSO1 PSO2 PSO3
CO1 3 2 1 2 1 2 1 1
CO2 3 2 1 2 1 2 1 1
CO3 3 2 1 2 1 2 1 1
CO4 3 2 1 2 1 2 1 1
Note: Correlation levels: 1: Slight (Low) 2: Moderate (Medium) 3: Substantial (High), “-” à No
correlations
Choice Based Credit System (CBCS) and Outcome Based Education (OBE)
6 Write a program to find the correlation between two variables and the plot the
Regression line.
7 Write a program to find the Fitting a straight line by the method of least square
using MATLAB.
2 Conduction (C) 15
3 Results (R) 10
4 Viva (V) 10
1 Write-up (W) 15
2 Conduction (C) 15
3 Results(R) 10
4 Viva (V) 10
EXP. PAGE
NAME OF THE EXPERIMENT CO RBT
NO NO
Write a program to obtain the Fourier series and its CO1, L1, L2 24-29
3 properties. CO2, CO3
4 Implementation of Fourier transform its properties. CO1, L1, L2 30-35
CO2, CO3
MATLAB stands for Matrix Laboratory. It is a high-performance language that is used for
Engineers and scientist’s world wise use MATLAB to solve complicated real-world
problems. Analyze data and visualize ideas lead to a better understanding of complex
systems. This course walks you through is an excellent tool for the basics of using
MATLAB including performing calculation with commands, importing data from external
Built in functions
User-written functions
Incase if the program requires very large number of commands or it needs to be executed repeatedly
or if one wants to modify some of the command after running the whole program or if one wants to
execute the whole program again in such cases MATLAB offers a provision where complete MATLAB
code is written in sequence in a file called m-file (MATLAB file). The extension of this files are .m.
\ Left-division operator
/ Right-division operator
Mathematical Functions:
3. s.*t
s = 1:6;
t = 6:-1:1;
u = s.*t
OUTPUT: 6 10 12 12 10 6
4. s./t
s = 1:6;
t = 6:-1:1;
u = s./t
OUTPUT: 0.1667 0.4000 0.7500 1.3333 2.5000 6.0000
5. s.^2
s = 1:6;
t = 6:-1:1;
u = s.^2
OUTPUT: 1 4 9 16 25 36
x=0.1
x= -1:0.1:1;
f = x+2;
g = x.^3+1;
y = (f.^2).*(g);
OUTPUT: x = 0.1000
Exercises:
1. Create two vectors running from one to six and from six to one and then
demonstrate the use of the dot arithmetical operations: s=1:6; t = 6:-1:1; find 1./s, s/2,
s+1.
2. Construct the polynomial y = (x + 2)3(x5 + 1) for values of x from minus one to one in
steps of 0.2.
Importance:
Enables the study of system behavior in the frequency domain, which is essential for understanding
resonance, filtering, and frequency response characteristics.
Inverse Laplace transforms make theoretical solutions applicable to real-world problems, allowing
engineers to predict and control the behavior of systems over time.
Many physical phenomena involve sudden changes, such as a switch being flipped or a force being
applied instantly. The unit step function provides a simple and effective way to model these events
mathematically.
2. sinat
syms t s a
f = sin(a * t);
at
3. e
syms t s a
OUTPUT: -1/(a - s)
, and
1.
% Import the Symbolic Math Toolbox
syms s t
syms s t
F = (s + 5) / (s^2 - 6*s + 13); % Define the given Laplace function
F_simplified = (s + 5) / ((s - 3)^2 + 4); % Express using the completed square form
f_t = ilaplace(F, s, t); % Find the inverse Laplace transform
disp(f_t); % Display the time-domain function
syms s t
F = 1 / (s * (s + 1) * (s + 2) * (s + 3)); % Define the Laplace function
F_partial = partfrac(F); % Perform partial fraction decomposition
f_t = ilaplace(F_partial, s, t); % Find the inverse Laplace transform
disp(f_t); % Display the time-domain function
4.
syms s t a b
F = log((s + a) / (s + b)); % Define the Laplace function
f_t = ilaplace(F, s, t); % Compute the inverse Laplace transform
disp(f_t); % Display the time-domain function
5.
syms s t a tau
6.
syms s t k Y
% Define the Laplace transform equation
eqn = s^2*Y - 2*s + k^2*Y == 0;
% Solve for Y(s)
Y_s = solve(eqn, Y);
% Take the inverse Laplace transform to get y(t)
y_t = ilaplace(Y_s, s, t);
disp('The solution y(t) is:');
disp(y_t);
1.
syms t s
f = (exp(t-1) + sin(t-1)) * heaviside(t-1); % Define the function using Heaviside
function
F = laplace(f, t, s);
disp(F);
2.
syms t s
f = sin(2*t) * (heaviside(t) - heaviside(t - pi)); % Define the piecewise function using
Heaviside functions
F = laplace(f, t, s);
disp(F);
3.
syms t s
f = cos(t) * heaviside(t) - cos(t) * heaviside(t - pi) + ...
cos(2*t) * heaviside(t - pi) - cos(2*t) * heaviside(t - 2*pi) + ...
cos(3*t) * heaviside(t - 2*pi);
F = laplace(f, t, s);
disp(F);
Exercises:
1. Find the Laplace Transform of cos2t, sin4t, e6t and t3
2. Find the Inverse Laplace Transform of , ,
, and
4. or and
2. How does the Laplace transform differ from the Fourier transform?
Ans. The Laplace transform is a generalization of the Fourier transform. While the Fourier transform is
used for analyzing signals in terms of their frequency components and is applicable to periodic signals,
the Laplace transform is more versatile, handling a broader class of signals, including those that grow
exponentially, and is useful for both stable and unstable systems.
4. What role does the inverse Laplace transform play in solving differential equations?
Ans. The inverse Laplace transform is crucial for obtaining the time-domain solution of a differential
equation after it has been solved in the s-domain. Once the algebraic equation in the s-domain is
solved, the inverse Laplace transform is applied to return the solution to its original time-domain form.
5. Can you give an example of a physical situation where the unit step function is used?
Ans. One example is in circuit analysis, where a voltage source is suddenly switched on at t=0.The
resulting voltage can be modeled using a unit step function to analyze how the circuit responds to this
sudden change.
Fourier series is used to analyze and process signals. By decomposing signals into their frequency
components, engineers can filter, compress, and enhance signals in communications and audio
processing.
In electrical engineering, Fourier series are used to analyze alternating current (AC) circuits and
design filters. They help in understanding the behavior of circuits with periodic inputs.
Fourier series help in analyzing and designing control systems by breaking down periodic signals
into their frequency components. This aids in system analysis, stability analysis, and controller
design.
Fourier series are used in image processing for filtering and image compression. Techniques such
as JPEG compression use Fourier transforms to analyze and compress image data.
In acoustics, Fourier series are used to analyze sound waves and musical tones. This helps in
sound synthesis, music analysis, and designing acoustically optimized environments.
Importance:
Fourier series decompose complex periodic functions into simple sine and cosine components. This
simplification makes it easier to analyze and understand the frequency content of signals.
By transforming signals into the frequency domain, Fourier series allow engineers and scientists to
study the frequency components and their contributions. This is essential for tasks like filtering,
signal reconstruction, and spectral analysis.
Fourier series are crucial for designing and analyzing systems in various fields, including
electronics, control systems, and mechanical systems. They help in optimizing system performance
and stability.
Fourier series enhance our understanding of periodic phenomena and their underlying structures.
This knowledge is applied across various scientific and engineering disciplines to solve real-world
problems.
for n = 1:n_terms
a_n(n) = (1 / pi) * integral(@(x) exp(x) .* cos(n * x), 0, 2 * pi);
b_n(n) = (1 / pi) * integral(@(x) exp(x) .* sin(n * x), 0, 2 * pi);
end
OUTPUT:
for n = 1:n_terms
b_n(n) = (2 / L) * integral(@(x) x .* sin(x) .* sin(n * x), 0, L);
end
% Plot the original function and its Fourier sine series approximation
figure;
plot(x, f(x), 'k', 'LineWidth', 2); hold on;
plot(x, F_sine_series, 'r--', 'LineWidth', 2);
legend('Original function x sin(x)', 'Half-Range Sine Series');
title('Half-Range Sine Series Approximation of x sin(x)');
xlabel('x');
ylabel('f(x) and Fourier Series');
grid on;
OUTPUT:
% Display results
fprintf('a_0: %f\n', a0);
fprintf('a_1: %f\n', a1);
fprintf('b_1: %f\n', b1);
2. Why is the Fourier series useful for solving partial differential equations (PDEs).
Ans. The Fourier series is useful for solving PDEs because it allows the decomposition of complex
boundary value problems into simpler, solvable components. By representing the solution as a series of
sine and cosine functions, the problem can be transformed into a set of ordinary differential equations
or algebraic equations, which are easier to solve. This approach is commonly used in problems
involving heat conduction, wave propagation, and vibrations.
IMPORTANCE:
Fourier transforms are crucial in signal processing for various tasks, including filtering,
compression, and signal reconstruction. They enable the efficient processing and analysis of signals
in both the time and frequency domains.
Fourier transforms are fundamental in data compression techniques. By transforming data into the
frequency domain, it is possible to remove redundant information and compress data more
efficiently, as seen in image and audio compression formats.
In engineering and control systems, the Fourier transform helps in analyzing system responses and
designing systems to meet specific performance criteria. It aids in understanding how systems
behave across different frequencies.
The Fourier transform provides a powerful method for analyzing signals in the frequency domain.
This allows for easier understanding and manipulation of signal characteristics, such as identifying
dominant frequencies, analyzing spectral content, and designing filters.
EXERCISES:
1. Find the Fourier transform of
2. Can you describe a practical application of the Fourier Transform in signal processing?
Ans. In signal processing, the Fourier Transform is used for audio signal analysis. For example, in
audio compression techniques such as MP3 encoding, the Fourier Transform is used to convert audio
signals from the time domain into the frequency domain. By analyzing the frequency components, the
algorithm can remove less significant frequencies, reducing the file size while preserving the quality of
the audio. This application illustrates how the Fourier Transform helps in efficient data compression
and improves audio storage and transmission.
3. What is the significance of the frequency domain representation obtained from the Fourier
Transform?
Ans. The frequency domain representation obtained from the Fourier Transform is significant because
it reveals the frequency content of a signal. Frequency Analysis understanding which frequencies are
present in the signal and their relative strengths. Filtering designing and applying filters to remove or
enhance specific frequency components. Signal compression compressing signals by retaining only
significant frequency components. Signal reconstruction reconstructing signals from their frequency
components using the inverse Fourier Transform. System analysis analyzing how systems respond to
different frequencies, which is essential for system design and stability analysis.
EXERCISES:
1. Find the Z transform of
2. Find the Z transform of
1. What is the difference between the Z transform and the Fourier transform?
Ans. The Z transform and the Fourier transform are both used for analyzing signals, but they differ in their
applications and domains.Z transform applied to discrete-time signals and sequences, converting them
into the complex frequency domain. It includes both the magnitude and phase information and is used
to analyze discrete-time systems, solve difference equations, and design digital filters. Fourier
transform typically used for continuous-time signals, converting them into the frequency domain. It
provides a continuous spectrum of frequencies and is used for analyzing continuous-time signals and
systems.
Regression analysis is to model the relationship between a dependent variable and one or more
independent variables. The regression line represents the best fit line that predicts the dependent
variable based on the independent variable(s).
Applications:
Understanding relationships between variables in exploratory data analysis. For example,
analyzing the relationship between hours studied and exam scores.
Assessing the relationship between stock prices and economic indicators. For instance, studying
how changes in interest rates affect stock returns.
Examining the correlation between lifestyle factors and health outcomes, such as the relationship
between exercise and cholesterol levels.
Used to predict the value of a dependent variable based on known values of independent variables.
For example, predicting sales based on advertising expenditure.
In engineering and manufacturing, regression can optimize processes and control systems by
modeling and adjusting variables to achieve desired outcomes.
Importance:
Predictive Insight helps in identifying patterns and making predictions based on the relationship
between variables.
In machine learning, correlation helps in selecting relevant features that are strongly related to the
target variable.
Provides valuable insights for decision-making by understanding how variables are related.
Enables predictions and forecasts based on the regression model, facilitating planning and
decision-making.
OUTPUT: r = -0.65955
EXERCISES:
1. The two-regression equation of the variables x and y are x=15.13-0.87y and
y=21.64-0.5 x. Find the correlation coefficient between x and y.
AIM:
The Method of Least Squares is to find the best-fitting line or model that minimizes the sum of the squared
differences between the observed data points and the values predicted by the model. It is used to
approximate the solution of an overdetermined system of equations, where the number of equations
exceeds the number of unknowns.
Regression Analysis estimate the coefficients of a linear regression model, which predicts a
dependent variable based on one or more independent variables.
Signal Processing estimate parameters of a signal model from noisy data. For example, filtering out
noise from a signal by fitting a model to the observed data.
Importance:
Best Fit Model provides a method to determine the line or curve that best represents the underlying
relationship in the data, which is essential for prediction and analysis.
Minimizes Errors by minimizing the sum of squared errors, the method ensures that the model has
the smallest possible discrepancy from the actual data, leading to more accurate predictions.
Statistical Analysis forms the basis for many statistical techniques, including regression analysis,
which is widely used in economics, engineering, and various scientific fields to make inferences
and predictions.
OUTPUT:
EXERCISES:
1. Find the best possible curve of the curve of the form y =a+bx, using the least squares
for the data: x=1 3 4 6 8 9 11 14 and y=1 2 4 4 5 7 8 9
2. Can the Method of Least Squares be used for fitting curves other than lines? If so, give an example.
Ans. Yes, the Method of Least Squares can be used to fit curves other than lines. For example, it can be
used to fit a quadratic curve to a set of data points. If the model is , the coefficients
are determined by minimizing the sum of the squared errors between the observed
values and the values predicted by this quadratic equation.
Problem 1: Analyze the RLC circuit using the Laplace transform for a resistance of 2
ohms, an inductance of 3 henry, and a capacitance of 3.5 microfarads.
R = 2; % Resistance in ohms
L = 3; % Inductance in henries
C = 3.5; % Capacitance in farads
OUTPUT:
3. What is the significance of using the Laplace transform in analyzing circuits like this RLC circuit?
Ans. The Laplace transform simplifies the analysis of circuits by converting differential equations (in
the time domain) into algebraic equations (in the s-domain). This makes it easier to solve for the
system’s behavior, especially for complex circuits.
Figure 1: Original Input Image was obtained by Figure 2: log of absolute Inverse Fourier Transform image.
taking the Inverse FT of the FT image
Figure 3: Corners shifted to center. Figure 4: Inverse FT after removing some frequencies
from Freq Domain.
4. What are some common image processing tasks that involve the Fourier Transform?
Ans. Image Compression techniques like JPEG use Fourier Transform (or its variants) for efficient
image compression. Edge Detection using frequency domain techniques to detect edges and patterns in
images. Image Restoration enhancing or recovering images degraded by noise or distortion through
frequency domain methods. Frequency Domain Analysis analyzing periodic structures or patterns
within images.
b = [1 1 1 1];
a = [0.25 .25 .25 .25];
y = filter(b,a,x)
Problem 2: Apply the Z transform and analyze the noise effect on figure.
I = imread('eight.tif');
J = imnoise(I,'salt & pepper',0.02);
K = wiener2(J);
L = medfilt2(J);
figure, imshow(I), figure, imshow(K)
figure,imshow(L)
OUTPUT: