0% found this document useful (0 votes)
0 views18 pages

Bs Lab Experiments

The document outlines a comprehensive list of experiments for a Basic Simulation Lab course in B.Tech ECE, covering matrix operations, signal generation, operations on signals, convolution, correlation, system properties, and LTI system responses. Each experiment includes specific tasks to be performed using MATLAB, such as generating various signals, performing mathematical operations on sequences, and verifying system properties. The experiments aim to provide hands-on experience in signal processing and system analysis techniques.

Uploaded by

kittumudarakolla
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)
0 views18 pages

Bs Lab Experiments

The document outlines a comprehensive list of experiments for a Basic Simulation Lab course in B.Tech ECE, covering matrix operations, signal generation, operations on signals, convolution, correlation, system properties, and LTI system responses. Each experiment includes specific tasks to be performed using MATLAB, such as generating various signals, performing mathematical operations on sequences, and verifying system properties. The experiments aim to provide hands-on experience in signal processing and system analysis techniques.

Uploaded by

kittumudarakolla
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/ 18

BASIC SIMULATION LAB

COURSE CODE: AS22-04PC05


II B.Tech.ECE, I-Sem.,
LIST OF EXPERIMENTS
EXP 1.BASIC OPERATIONS ON MATRICES
1. Create and Display a Matrix
Create a 3x3 matrix A with elements from 1 to 9 and display it.
2. Matrix Addition and Subtraction
Given matrices
A and B ,compute A+B,B-A
3. Scalar Multiplication
Multiply every element of matrix A by 3.
4. Matrix Multiplication
Multiply matrices
A and B using matrix multiplication rules.
5. Element-wise Multiplication and Division
Perform element-wise multiplication and division of the matrices A and B.
6. Transpose a Matrix
Find the transpose of matrix A.
7. Matrix Inverse and Identity Check
Compute the inverse of matrix A (if it exists) and verify that A×A−1 is the identity
matrix.
8. Extract Submatrix
For the Given matrixextract the submatrix formed by rows 2 to 3 and columns 2 to 4.
9. Apply a Function to Each Element
Create a matrix A and compute the sine of each element in A.
EXP 2.GENERATION OF VARIOUS SIGNALS AND SEQUENCES
(PERIODIC AND APERIODIC), SUCH AS UNIT IMPULSE, UNIT STEP,
SQUARE, SAW TOOTH, TRIANGULAR, SINUSOIDAL, RAMP, SINC.
1. Unit Impulse Signal Generation
Write MATLAB code to generate and plot a discrete-time unit impulse
signal δ[n] for n=−10 to n=10. Explain how the code ensures the impulse occurs at n=0.

2. Unit Step Signal Generation


Generate and plot a unit step signal u[n] for n=−10 to n=10 in MATLAB. Modify the code to
shift the step to start at n=3. What changes in the code are required for the shift?
3. Square Wave Generation
Using MATLAB's built-in functions, generate a square wave of frequency 5 Hz, amplitude 2, and
duration 1 second with a sampling rate of 1000 Hz. Plot the result. How does changing the duty
cycle parameter affect the waveform?
4. Sawtooth Wave Generation
Write MATLAB code to generate a sawtooth wave of period 0.2 seconds and amplitude 1 over
the interval t=0 to t=1 second. Use the sawtooth function and plot the result. How would you
modify the code to create a triangular wave instead?
5. Triangular Wave Generation
Generate and plot a triangular wave using MATLAB for t=0 to t=2 seconds. Compare the code
and output with that of a sawtooth wave. What parameter in the sawtooth function creates a
symmetric triangular waveform?
6. Sinusoidal Signal Generation
Write MATLAB code to generate and plot a sinusoidal signal with frequency 50 Hz, amplitude 1,
and phase π/4 for 0.1 seconds at a 1 kHz sampling rate. How does changing the phase value
affect the plot?
7. Ramp Signal Generation
Create a unit ramp signal r[n]=n for n=−5 to n=5 in MATLAB. Plot the signal and explain the
difference between the ramp and step signals in terms of their mathematical definitions and plots.
8. Sinc Function Generation
Generate and plot the sinc function sinc(t) for t=−10 to t=10 in MATLAB. What is the
significance of the sinc function in signal processing?
9. Periodic vs. Aperiodic Signal Classification
Given the signals: unit impulse, unit step, ramp, square, sawtooth, triangular, sinusoidal, and
sinc, classify each as periodic or aperiodic. Justify your classification and explain how MATLAB
code structure might differ for periodic versus aperiodic signal generation.

EXP 3. OPERATIONS ON SIGNALS AND SEQUENCES SUCH AS


ADDITION, MULTIPLICATION, SCALING, SHIFTING, FOLDING,
COMPUTATION OF ENERGY AND AVERAGE POWER.
1. Addition of Signals
Given two discrete-time signals x1[n]= sin(2πf1nT) and x2[n]=cos(2πf2nT), write a MATLAB
program to compute and plot their sum y[n]=x1[n]+x2[n] for n=0:100, f1=5 Hz, f2=10Hz,
and T=0.01 s.
2. Multiplication of Signals
For the same signals as above, compute and plot the pointwise product y[n]=x1[n]⋅x2[n] in
MATLAB.
3. Scaling (Amplification/Attenuation)
Given a signal x[n]=sin(2πfnT) with f=5f and T=0.01 s, write MATLAB code to plot the original
signal and its scaled versions for scaling factors a=0.5 (attenuation) and a=2 (amplification).
4. Time Shifting
Given a discrete-time signal x[n], plot the original and its delayed (y[n]=x[n−5]) and advanced
(y[n]=x[n+5]) versions using MATLAB.
5. Folding (Time Reversal)
Given a signal x[n], write MATLAB code to plot both x[n] and its folded version x[−n].
6. Computation of Energy
Given a finite-length signal x[n], compute its energy using MATLAB:
Plot the signal and display its computed energy.
7. Computation of Average Power
For a periodic discrete-time signal x[n], compute its average power over one period in
MATLAB:
8. Combined Operations
Given two signals x1[n] and x2[n], perform the following in MATLAB:
Add the signals,Multiply the signals,Scale the result by a=1.5 and Shift the result by k=3
Plot each step.
9. Sequence Manipulation and Analysis
Given a sequence x[n]=[1,[2][3][4][5], perform the following using MATLAB:Find Fold the
sequence,Shift the folded sequence by 2 units to the right and Compute and display the energy
and average power of the final sequence.
EXP 4.FINDING THE EVEN AND ODD PARTS OF SIGNAL/SEQUENCE
AND REAL AND IMAGINARY PARTS OF SIGNAL.

1. Given a discrete-time signal x[n]=[2,1,1,2,0,1,[2][3] defined for n=−4:4, write MATLAB


code to compute and plot its even and odd parts. Explain each step of your code.
2. For a continuous-time signal x(t)=sin(t)+cos(t), use MATLAB to: find Plot the original
signal,Compute and plot its even and odd components and Show the mathematical
expressions used.
3. Write a MATLAB function that takes any signal x and its time vector t and returns its
even and odd parts. Demonstrate the function with x=e−t for t=−5:0.1:5.
4. Given a user-input sequence, describe how to compute its folded (time-reversed) version
in MATLAB and use it to find the even and odd parts. Provide sample code and output
for x=[1,2,3,[4][5].
5. A signal x[n] is defined only for n≥0. Explain how you would extend it to negative indices
in MATLAB to compute its even and odd parts. Provide code for x=[1,[3][5][7]for n=0:3.
6. Given a complex sequence y=[1+6i,2−5i,3,4+3i,5i], write MATLAB code to extract and
plot its real and imaginary parts. Show the output.
7. For the complex exponential x(t)=e(1+j2)t for t=0:0.1:5, write MATLAB code to
plot:find The real part,the imaginary part and the magnitude and phase (angle)
8. Write a MATLAB function that takes a complex signal and returns its real and imaginary
components as separate vectors. Test your function with x=[2+3j,4−2j,5,−1+0.5j].
9. Explain, with MATLAB code, how to use the built-in functions real() and imag() to
process a vector of complex numbers. Show how to plot both parts using subplots
for z=[3+4j,1−2j,−2+5j,0].

EXP 5. CONVOLUTION FOR SIGNALS AND SEQUENCES


1. Basic Linear Convolution of Two Sequences
Given x=[1,2,3,[4] and h=[1,0,−1], use MATLAB to compute their linear convolution. Plot the
input signals and the output sequence.
2. Manual vs. Built-in Convolution
Write a MATLAB function to compute the convolution of two sequences manually (without
using conv). Compare your result with MATLAB’s built-in conv function for x=[2,[1]
[2] and h=[1,−1,1].
3. Convolution with Time Shift
Let x[n]=[0,1,[3] and h[n]=[1,2,[1]. Compute and plot the convolution result. Then, shift x[n] by
2 units to the right and repeat the convolution. How does the output change?
4. Convolution Using DFT
Given x1=[1,2,1, and x2=[1,1,1,[1], compute their convolution directly using conv and via the
Discrete Fourier Transform (DFT) method. Compare the results in MATLAB.
5. Even and Odd Decomposition Before Convolution
Decompose the signal x[n]=[3,2,1,0,−1,−2,−3] into its even and odd components. Convolve each
component with h[n]=[1,[2][1] separately and plot the outputs.
6. Convolution with Nonzero Starting Indices
MATLAB’s conv function assumes sequences start at n=0n=0. Write a function conv_m that
properly handles sequences with nonzero starting indices, and use it to convolve x[n]=[1][2]
[3] starting at n=−1 with h[n]=[2,[1] starting at n=0.
7. Convolution and Signal Energy
Given x=[1][2][1] and h=[1,1,[1], compute the convolution y. Calculate and compare the energy
(∑∣x[n]∣2) of the input and the output signals.
8. Circular Convolution
For x=[1,2,3,[4] and h=[1,0,−1,0], compute their circular convolution using
MATLAB’s cconv function. Compare the result with linear convolution using conv.
9. Convolution and System Response
A discrete-time LTI system has impulse response h[n]=[0.5,1,0.5]. If the input is x[n]=[1,, use
convolution to determine the system’s output. Interpret the result in terms of system behavior.

EXP 6.AUTO CORRELATION AND CROSS CORRELATION FOR SIGNALS AND


SEQUENCES
1. Compute the Autocorrelation of a Sequence
Given a sequence x=[1,2,3,[4], compute and plot its autocorrelation using
MATLAB's xcorr function.
2. Compute the Cross-Correlation of Two Sequences
Given x=[1,2,3,[4] and y=[4,3,2,[1], compute and plot their cross-correlation.
3. Find the Lag at Maximum Cross-Correlation
For sequences x=[0,1,[3][4][5]and y=[5,4,[3][2][1], find the lag where their cross-correlation
is maximum.
4. Normalize the Autocorrelation Sequence
Compute the normalized autocorrelation of x=[2,−1,3,0,1] and plot it.

5. Cross-Correlation with Multichannel Input


Given matrix X=[1 2 3;4 5 6;7 8 9], compute the autocorrelation and cross-correlation of
its columns.

6. Detect Delay Between Two Signals


Given x=[0,0,1,[4]and $$ y = [1, 2, 3, 4, 0, 0, 0,cross-correlation to estimate the delay
between them.

7. Compare Linear and Circular Correlation


For x=[1,2,3,[4]and y=[4,3,2,[1] compute both linear and circular cross-correlation.

8. Autocorrelation of a Noisy Sine Wave


Generate a sine wave with added noise, compute its autocorrelation, and plot the result.

9. Manual Computation of Cross-Correlation


Write MATLAB code to compute the cross-correlation between x=[1,2,[3]and y=[3][2]
[1]without using xcorr.

EXP 7. VERIFICATION OF LINEARITY AND TIME INVARIANCE PROPERTIES OF


A GIVEN CONTINUOUS/DISCRETE SYSTEM.

1. Linearity Test for a Discrete System

Given the system y[n]=2x[n]+3, y[n]=2x[n]+3, test for linearity using two arbitrary input
signals x1[n] and x2[n]and scalars a, b.
.2. Time Invariance Test for a Discrete System
For the system y[n]=x[n−1], verify time invariance by shifting the input and comparing the
output shift.
3. Linearity Test for a Continuous System
Given y(t)=x2(t)y(t)=x2(t), test for linearity with two signals x1(t), x2(t), and scalars a, b.
4. Time Invariance Test for a Continuous System
Test the time invariance of y(t)=x(t2) by applying a time shift and comparing the outputs.
5. Linearity and Time Invariance for a System with Multiplicative Input
For y[n]=n⋅x[n], verify both linearity and time invariance.
6. MATLAB Simulation of Linearity
Simulate in MATLAB: y[n]=x[n]+5. Is the system linear?
7. MATLAB Simulation of Time Invariance
Simulate y[n]=x[−n] in MATLAB. Is the system time-invariant?
8. Combined Test for a Piecewise System
Given y[n]=x[n] for n≥0n≥0, y[n]=0 otherwise, test for both properties.
9. Random Signal Test for Time Invariance
Generate a random input signal x[n] in MATLAB, shift it by 2 units to get x[n−2], and test time
invariance for y[n]=10x[n]cos(0.25πn+0.1π).
EXP 8. COMPUTATION OF UNIT SAMPLE, UNIT STEP AND SINUSOIDAL
RESPONSES OF THE GIVEN LTI SYSTEM COMPUTATION OF UNIT SAMPLE,
UNIT STEP AND SINUSOIDAL RESPONSES OF THE GIVEN LTI SYSTEM AND
VERIFYING ITS PHYSICAL REALIZABILITY AND STABILITY PROPERTIES.
1: Basic Impulse Response Computation
Given the LTI system difference equation:
y[n]−0.5y[n−1]=x[n],Use MATLAB to compute and plot the unit sample response h[n] for n=0to
20 and Comment on system stability and realizability.
2: Impulse Response for Higher-Order System
Given:y[n]=0.9y[n−1]−0.4y[n−2]+x[n],Use MATLAB to compute and plot the impulse response
h[n] and Check if the system is BIBO stable using the impulse response.
3: Verify LTI Property Using Impulse Response
Let system S have impulse response h[n]. Verify in MATLAB:Linearity: S[ax1[n]
+bx2[n]]=ay1[n]+by2[n] and Time invariance: Apply a delayed input and compare with delayed
output.
4: Compute and Plot Unit Step Response
Given:y[n]−0.8y[n−1]=x[n],Find and plot the unit step response s[n] in MATLAB and Compare
with the cumulative sum of the impulse response.
5: Causal System Step Response
Given:y[n]=x[n]+2x[n−1]+x[n−2],Compute the step response and Determine if the system is
causal and physically realizable.
6: Frequency Response Analysis
Given:y[n]=x[n]−x[n−1]+0.5x[n−2],Use MATLAB to compute the system's frequency response
using freqz and Find the magnitude and phase response for input x[n]=cos(0.2πn).
7: Response to Complex Exponential
Let input be x[n]=ej0.4πn. Given:y[n]=0.6y[n−1]+x[n],Simulate in MATLAB and verify that
output is H(ej0.4π)⋅x[n] and Calculate H(ej0.4π) analytically and compare.
8: Physical Realizability
Given impulse response:matlab h = [0.2 0.3 0.1 -0.05 0]; % For n = 0 to 4,Determine if the
system is realizable and causal and Write the corresponding difference equation.
9: Stability Analysis from Impulse Response
Given impulse response in MATLAB:
h = (0.9).^(0:49); % Exponentially decaying,Plot h[n], and compute ∑∣h[n]∣ and Determine
BIBO stability.
EXP 9. FINDING THE FOURIER TRANSFORM OF A GIVEN SIGNAL AND
PLOTTING ITS MAGNITUDE AND PHASE SPECTRUM.
1. Basic Exponential Signal
Find the Fourier Transform of the signal:
x(t) = exp(-a*t) * u(t), where a > 0,Plot the magnitude and phase spectrum in MATLAB.
2. Rectangular Pulse
x(t) = rect(t/T), where T is the pulse width,Find and plot its Fourier Transform using MATLAB.
Use the fft function to approximate it numerically.
3. Cosine Signal
x(t) = cos(2*pi*f0*t), where f0 = 10 Hz,Use MATLAB to compute the Fourier Transform and
plot the magnitude and phase.
4. Sinc Function
x(t) = sinc(t/T), where T is a scaling factor,Find and plot its Fourier Transform using MATLAB
and compare the result with the theoretical transform.
5. Gaussian Pulse
x(t) = exp(-t.^2),Compute its Fourier Transform numerically in MATLAB. Plot the magnitude
and phase spectrum.
6. Time-Shifted Signal
x(t) = rect(t-2),Find its Fourier Transform. Plot and explain the phase shift due to time translation
using MATLAB.
7. Periodic Square Wave
Use MATLAB to compute and plot the Fourier series coefficients (which relate to the Fourier
Transform) of a periodic square wave.
Use fft for numerical computation.
8. Linear Combination of Signals
x(t) = 2*cos(2*pi*10*t) + 3*sin(2*pi*20*t),Use MATLAB to compute the Fourier Transform.
Plot the magnitude and phase spectrum and identify the frequencies present.
9. Complex Exponential and Modulation
x(t) = exp(j*2*pi*f0*t) * rect(t/T),Find the Fourier Transform using MATLAB. Show how
modulation affects the frequency content.

EXP 10. WAVEFORM SYNTHESIS USING LAPLACE TRANSFORM

1. Impulse Response to Laplace Domain


o Problem: Given the impulse response h(t)=e−2tu(t), compute its Laplace
Transform using MATLAB.
o Objective: Understand how to use symbolic computation for Laplace Transform
in MATLAB.
o Hint: Use laplace() with heaviside(t) for u(t).
2. Laplace Transform of a Composite Signal
o Problem: Compute the Laplace Transform of x(t)=3e−4tu(t)+2cos(5t)u(t).
o Objective: Practice Laplace of exponential and sinusoidal signals.
o Task: Plot the Laplace domain representation (poles and zeros).
3. Inverse Laplace to Time-Domain Signal
o Problem: Given X(s)=5\s+3+2s/s2+4s+13, find x(t) using MATLAB.
o Objective: Practice inverse Laplace transforms and time-domain synthesis.
o MATLAB Task: Use ilaplace().

4. Step Response via Laplace Domain


o Problem: A system has a transfer function H(s)=1\s2+2s+2. Find the step
response using Laplace methods.
o MATLAB Task: Multiply H(s) by 1\s, then apply ilaplace(), and plot the
response.
5. Partial Fraction Expansion
o Problem: Perform partial fraction decomposition of X(s)=2s+5\(s+1)(s+2).
o Objective: Prepare for inverse Laplace by breaking into known components.
o MATLAB Task: Use residue() or partfrac().
6. Waveform Synthesis from Laplace Transform
o Problem: Synthesize the time-domain waveform corresponding to X(s)=10\
s2+6s+25.
o Tasks:
 Find the time-domain function using ilaplace().
 Plot both the real and imaginary parts of the result if complex.

7. System Output Using Laplace Convolution


o Problem: A system has impulse response h(t)=e−tsin(t)u(t), and input x(t)=u(t).
Use Laplace domain to compute the output y(t).
o Steps:
1. Find H(s) and X(s),
2. Multiply to get Y(s),
3. Use inverse Laplace for y(t).
8. Laplace Domain Filtering
oProblem: Design a filter H(s) to suppress high frequencies from x(t)=sin(10t)
+sin(t), then synthesize the output waveform.
o Objective: Use Laplace to model filtering operations.
o MATLAB Task: Use symbolic Laplace and inverse Laplace to model low-pass
filtering.
9. Simulate and Compare Time and Laplace Domain Results
o Problem: Given H(s)=s+3\s2+4s+8 and input x(t)=e−tu(t), compute output y(t) in
two ways:

 a) Using Laplace transform.


 b) Using numerical simulation via lsim or ode45.

o Goal: Compare symbolic Laplace method with time-domain simulation.

EXP 11. LOCATING THE ZEROS AND POLES AND PLOTTING THE POLE-ZERO
MAPS IN S-PLANE AND Z-PLANE FOR THE GIVEN TRANSFER FUNCTIONS.

1. First-order low-pass
G1(s)=5\0.2s+1
Tasks:
a) List the poles and zeros.
b) Plot the pole–zero map with pzmap.
c) Comment on stability and DC gain.
2. Second-order under-damped
G2(s)=25\s2+2s+25
Tasks:
a) Compute damping ratio ζ and natural frequency ωn.
b) Plot the P–Z map and locate the complex-conjugate pole pair.
c) Verify your numeric poles with the quadratic formula.
3. Lead compensator
G3(s)=s+3\0.05s+1
Tasks:
a) Identify the pole and zero and sketch their relative positions.
b) Use MATLAB to confirm and plot.
c) Explain qualitatively how the lead zero affects phase margin.
4. High-order notch
G4(s)=(s2+4s+13)\(s2+6s+25)(s+2)
Tasks:
a) Factor the numerator and denominator to show conjugate pairs.
b) Plot the P–Z map and label poles vs. zeros.
c) Predict the frequency where the magnitude response exhibits a notch.
5. PI-controlled plant
Plant: P(s)=10\s(s+4)
Controller: C(s)=1+2\s
Tasks:
a) Form the open-loop transfer L(s)=C(s)P(s).
b) Find and plot poles/zeros of L(s)
c) Discuss closed-loop stability from the open-loop pole locations.
Discrete-Time ( z-plane ) Problems
(Use the supplied sampling period Ts when building tf or zpk.)
6. IIR low-pass
H1(z)=0.0675 (1+z−1)\1−1.143 z−1+0.4128 z−2,
Ts=0.1 s
Tasks:
a) Convert to polynomial form in zzz.
b) Plot the P–Z map (zplane from DSP System Toolbox or pzmap).
c) Check if all poles lie inside the unit circle.
7. Simple comb filter
H2(z)=1−z−6, Ts=1 ms
Tasks:
a) List all zeros (hint: 6th-roots of unity).
b) Plot the zeros on the unit circle.
c) Comment on its magnitude response at f=k\6Ts.
8. Bilinear-transformed band-pass
Start with the analog prototype
Ga(s)=0.5s\s2+0.5s+100
and sample with Ts=0.01 s using the bilinear (Tustin) method.
Tasks:
a) Use c2d(G_a,Ts,'tustin') to obtain Gd(z).
b) Extract and plot the discrete-time poles/zeros.
c) Explain how the bilinear transform preserves stability.
9. FIR Hilbert transformer (7-tap)
Coefficient vector
matlab
b = [-0.0895 0 0.4480 0 -0.4480 0 0.0895];
H3(z)=∑k=06bkz−k, Ts=1 s
Tasks:
a) Plot the zeros; show that they are symmetric about the unit circle.
b) Verify the filter has only zeros (all poles at the origin).
c) Explain why the response has approximately 90° phase shift over its pass-band.

EXP 12. GENERATION OF GAUSSIAN NOISE (REAL AND COMPLEX),


COMPUTATION OF ITS MEAN, M.S. VALUE AND ITS SKEW, KURTOSIS, AND PSD,
PROBABILITY DISTRIBUTION FUNCTION.
1: Real Gaussian Noise Generation
Generate 10,000 samples of zero-mean unit-variance real Gaussian noise.
 Plot the time-domain signal.
 Compute and display its mean and mean square value.
2: Complex Gaussian Noise Generation
Generate 10,000 samples of complex Gaussian noise, where both real and imaginary parts are
zero-mean and unit-variance.
 Compute the magnitude and phase of the noise samples.
 Display histograms of both the real and imaginary components.
3: Skewness and Kurtosis
Using the real Gaussian noise from Problem 1:
 Compute the skewness and kurtosis.
 Comment on how the values reflect the properties of Gaussian distribution.
4: Probability Distribution Function (PDF)
Plot the empirical PDF of the real Gaussian noise from Problem 1 using histogram with
'Normalization','pdf'.
 Overlay the theoretical Gaussian PDF using MATLAB's normpdf.
5: PSD of Real Gaussian Noise
Use the pwelch function to compute and plot the Power Spectral Density (PSD) of the real
Gaussian noise.
 Explain the nature of the PSD for white noise.
6: PSD of Complex Gaussian Noise
Repeat Problem 5 for the complex Gaussian noise.
 Compare the PSD results of real vs complex Gaussian noise.
7: Noise with Non-Zero Mean
Generate real Gaussian noise with a mean of 2 and variance of 4.
 Compute and plot its PDF.
 Verify the computed mean and M.S. value.
8: Time-Varying Mean Noise
Create a Gaussian noise signal whose mean varies linearly from 0 to 5 over 10,000 samples.
 Plot the signal and overlay the time-varying mean.
 Analyze the effect on the PDF.
9: Comparison of Gaussian vs Uniform Noise
Generate both:
 10,000 samples of Gaussian noise (mean = 0, std = 1)
 10,000 samples of Uniform noise in the range [-√3, √3] (same variance = 1)
Compare their:
 Mean, M.S. value, skewness, and kurtosis
 Histograms and PDFs

EXP 13. VERIFICATION OF SAMPLING THEOREM.


1. Generate and Plot a Continuous-Time Signal
Write a MATLAB script to generate a continuous-time x(t)=sin(2πft) with frequency
f=50 Hz, and plot it using a high sampling frequency (e.g., 10000 Hz).Plot the signal and explain
why a high sampling rate is used here.
2. Undersampling Case (Aliasing Effect)
Sample the same signal from Q1 at a rate below the Nyquist rate (e.g., 60 Hz). Plot the sampled
signal and explain the distortion due to aliasing.
3. Nyquist Rate Sampling
Sample the same signal at exactly twice its maximum frequency (Nyquist rate).Plot and analyze
if perfect reconstruction is possible.
4. Oversampling Case
Sample the signal from Q1 at 10 times the Nyquist rate (e.g., 1000 Hz).Compare the sampled
signal with the original one. How does oversampling affect reconstruction?
5. Reconstruction Using Sinc Interpolation
Use sinc interpolation to reconstruct the original signal from samples taken at the Nyquist rate.
Write MATLAB code for reconstruction and plot both original and reconstructed signals. Discuss
the result.
6. Varying Sampling Frequency Analysis
Write a function in MATLAB that takes sampling frequency as input and shows aliasing if the
condition is violated. Use this function to analyze sampling at 30 Hz, 50 Hz, 100 Hz, and 200 Hz
for a 70 Hz sine wave.
7. Verification Using FFT
Use Fast Fourier Transform (FFT) to analyze the frequency spectrum of a sampled signal. What
do you observe when the sampling frequency is below, at, and above the Nyquist rate?
8. Sampling Theorem for a Composite Signal
Create a composite signal x(t)=sin(2π100t)+sin(2π200t). What is the minimum sampling rate
required? Verify using MATLAB by sampling at 250 Hz and 400 Hz.
9.Effect of Quantization + Sampling
Combine quantization with sampling: Sample a 50 Hz sine wave at 500 Hz and quantize it to 8
levels. Plot the original, sampled, and quantized signal. Discuss the impact on signal fidelity.

EXP 14. REMOVAL OF NOISE BY AUTOCORRELATION / CROSS CORRELATION


Autocorrelation / Cross-Correlation – Noise Removal in MATLAB
Q1. Generate and Correlate
Generate a clean sinusoidal signal s(t) = sin(2πft) where f = 10 Hz, add white Gaussian
noise to it, and use autocorrelation to identify the periodicity of the original signal.
Q2. Cross-Correlation for Signal Detection
Generate a known reference signal and embed it within a longer noisy signal. Use cross-
correlation to detect the position of the reference signal within the noisy signal.

Q3. Filter Design Using Autocorrelation


Generate a noisy signal and use the autocorrelation function to design a matched filter to
improve signal quality. Implement and compare SNR before and after filtering.
Q4. Noise Identification
Generate a signal with a mixture of white Gaussian noise and a sinusoidal component.
Use autocorrelation to distinguish between noise and deterministic components.
Q5. Cross-Correlation and Delay Estimation
Generate two delayed versions of the same signal (with noise). Use cross-correlation to
estimate the delay between the two signals.
Q6. Denoising with Template Matching
Create a signal and a reference "template". Add noise to the signal. Use cross-correlation
with the template to extract the clean portion.
Q7. Autocorrelation-based Noise Filter
Simulate a noisy signal. Design a denoising method by computing its autocorrelation,
thresholding the small lags (low correlation), and reconstructing the signal with only highly
correlated components.
Q8. Compare Autocorrelation Before and After Denoising
Add noise to a signal, apply a denoising technique (e.g., moving average filter), and
compare the autocorrelation before and after.
Q9. Cross-Correlation for Multi-Channel Denoising
Assume a signal is recorded by two microphones with different noise levels. Use cross-
correlation between the two channels to extract the clean signal by emphasizing the common
(correlated) parts.

EXP 15. EXTRACTION OF PERIODIC SIGNAL MASKED BY NOISE USING


CORRELATION.
Topic: Extraction of Periodic Signal Masked by Noise using Correlation in MATLAB
Problem 1: Generate Periodic Signal with Noise
Task:Generate a cosine signal x(t) = cos(2πf₀t) with f₀ = 5 Hz and add Gaussian noise.
Plot the noisy signal.
Goal: Understand how noise affects the visual appearance of periodic signals.
Problem 2: Autocorrelation of Pure Periodic Signal
Task:Generate a clean cosine signal and compute its autocorrelation using xcorr. Plot the result.
Goal: Analyze the autocorrelation pattern of a clean periodic signal.
Problem 3: Autocorrelation of Noisy Signal
Task:Repeat the autocorrelation process on the noisy signal from Problem 1.
Goal: Observe how noise alters the autocorrelation and what remains identifiable.
Problem 4: Cross-Correlation with Known Template
Task:Use a clean cosine signal as a reference (template) and compute the cross-
correlation with the noisy signal.
Goal: Show how cross-correlation helps in detecting a known periodic pattern within noise.
Problem 5: Estimate Fundamental Frequency
Task:Use the autocorrelation of a noisy periodic signal to estimate its fundamental
frequency.
Hint: Identify the lag at which the autocorrelation peaks repeat.
Goal: Frequency estimation using autocorrelation.
Problem 6: Noise Reduction via Correlation Averaging
Task:Simulate multiple realizations of noisy signals (same signal, different noise),
average their autocorrelations.
Goal: Understand how averaging autocorrelations helps suppress random noise.
Problem 7: Extract Hidden Signal Using Matched Filter (Cross-Correlation)
Task:Create a signal that contains a short burst of a cosine wave hidden in noise. Use cross-
correlation to detect the burst location.
Goal: Pattern matching using correlation.
Problem 8: Signal Detection in Non-Gaussian Noise
Task:Add non-Gaussian noise (e.g., uniform or impulse noise) to the periodic signal and evaluate
performance of correlation techniques.
Goal: Understand robustness of correlation under different noise conditions.
Problem 9: Spectral vs Correlation Approach
Task:Compare power spectral density (using pwelch) and autocorrelation method for detecting
periodicity in a noisy signal.
Goal: Highlight the advantages and limitations of correlation-based detection compared to
frequency-domain analysis.

EXP 16. VERIFICATION OF WEINER-KHINCHINE RELATIONS.


Q1. Generate a Wide-Sense Stationary Signal
Write a MATLAB program to generate a discrete-time wide-sense stationary Gaussian random
signal of length 1024. Plot the signal and verify its mean and variance.
Q2. Compute Autocorrelation Function
Compute and plot the autocorrelation function of the signal generated in Q1 using the xcorr()
function. Normalize it and analyze its shape.
Q3. Compute PSD Using FFT of ACF
Use the FFT of the autocorrelation function from Q2 to compute the Power Spectral Density
(PSD). Plot it and discuss the frequency characteristics.
Q4. Compute PSD Using Welch's Method
Use MATLAB’s pwelch() function to compute the PSD of the original signal. Plot this PSD and
compare it with the one obtained from FFT of the ACF in Q3.
Q5. Verify Wiener-Khinchin Theorem
Compare the PSDs from Q3 and Q4 using plots and compute the mean squared error (MSE)
between them. Comment on whether the Wiener-Khinchin relation is verified numerically.
Q6. Effect of Signal Length on Accuracy
Repeat Q1–Q5 for signal lengths of 256, 512, 2048 samples. Analyze how signal length affects
the closeness of the two PSD estimates and hence the accuracy of the theorem's verification.
Q7. Effect of Windowing on PSD
Use different windows (e.g., Hamming, Hanning, Rectangular) in pwelch() and study their effect
on the estimated PSD. Which window gives the closest match with the FFT of the ACF?
Q8. Use of Real vs Complex Signals
Generate a complex-valued stationary random signal and repeat Q1–Q5. Verify if Wiener-
Khinchin holds for complex signals and how the real and imaginary parts affect the PSD.
Q9. Analytical vs Numerical Verification
For a theoretical autocorrelation function R(τ)=σ2e−∣τ∣/T, compute the PSD analytically (via
Fourier transform) and compare with numerical FFT of discretized R(τ)R(\tau)R(τ). Validate
Wiener-Khinchin theorem from theory.
EXP 17. GIBBS PHENOMENON SIMULATION
Topic: Gibbs Phenomenon Simulation using MATLAB
Q1. Fourier Series Approximation of a Square Wave
Simulate the Fourier series approximation of a square wave using 5, 10, 20, and 50 harmonics.
Plot and compare the results. Observe the overshoots at the discontinuities.
Q2. Overshoot Quantification
Measure the overshoot (as a percentage of amplitude) near the jump discontinuity for the square
wave using 10 and 50 harmonics. Compare the results and comment on the persistence of the
overshoot.
Q3. Time vs Harmonics Tradeoff
Plot the approximation error vs. number of harmonics (up to 100) for a square wave at a fixed
point near the discontinuity. Show that the overshoot does not vanish even as the number of
harmonics increases.
Q4. Gibbs Phenomenon in a Sawtooth Wave
Repeat the Fourier series approximation for a sawtooth wave. Plot the original and approximated
waveforms using 10, 30, and 100 harmonics. Analyze and compare the overshoot behavior with
that of a square wave.
Q5. Fourier Synthesis of a Periodic Pulse
Generate a periodic rectangular pulse signal and approximate it using Fourier series with
different harmonics. Simulate and visualize the Gibbs phenomenon as harmonics increase.
Q6. Spectral Analysis of the Approximation
Plot the magnitude spectrum of the Fourier coefficients for the square wave. Use stem plots for N
= 10, 30, and 50. Observe how the high-frequency components influence the overshoot.
Q7. Windowing to Reduce Gibbs Phenomenon
Apply a windowing function (e.g., Hamming or Blackman) to the Fourier coefficients before
synthesis. Compare the reconstructed signal with and without windowing. Discuss the trade-off
between overshoot and sharpness.
Q8. Energy Localization around Discontinuities
Compute the energy localized around the discontinuity (within ±5% of period) using Parseval’s
theorem for different harmonic numbers. Analyze how the energy concentration behaves as
harmonics increase.
Q9. Visualizing Pointwise Convergence
Create an animation that shows how the Fourier approximation evolves as more harmonics are
added (frame-by-frame addition). Highlight the fixed overshoot at the discontinuity while the
rest converges smoothly.

EXP 18. CHECKING A RANDOM PROCESS FOR STATIONARY IN WIDE


SENSE
Checking a Random Process for Stationarity in Wide Sense using MATLAB
Problem 1: Mean Stationarity Test
Generate a random processX(t)=Acos(ωt+θ), where θ∼Uniform(−π,π), and test if the mean is
time-invariant.
Problem 2: Autocorrelation Stationarity Test
Generate X(t)=e−αt+W(t), where W(t) is white Gaussian noise. Compute the autocorrelation
function RX(t1,t2). Check if RX(t1,t2)=RX(t1−t2).
Problem 3: WSS Verification for Sinusoidal Random Process
SimulateX(t)=Acos(ωt)+W(t), where A and ω are constants and W(t) is Gaussian white noise. Is
the process WSS?
Problem 4: Compare Mean and Autocorrelation over Time Shifts
Simulate a process X(t) over a time vector. Compute its mean and autocorrelation at different
time shifts. Plot and verify whether they are time-invariant.
Problem 5: Constant Mean but Non-WSS Process
Simulate X(t)=t⋅W(t), where W(t) is Gaussian white noise. Does the process satisfy WSS
conditions? Justify using mean and autocorrelation.
Problem 6: Cross-Verification with Time-Averaging
Use time-averaging to estimate mean and autocorrelation of a single realization and compare
with ensemble averaging over multiple realizations. Is the process ergodic and/or WSS?
Problem 7: Random Walk and WSS
Simulate a random walk process X(t)=X(t−1)+W(t) and test whether it satisfies the conditions
for WSS.
Problem 8: MATLAB xcorr and WSS
Use MATLAB’s xcorr function to estimate the autocorrelation of a signal X(t). Use this to check
the WSS property.
x = randn(1,1000); rxx = xcorr(x, 'biased');Analyze if rxx is symmetric and depends only on the
time lag.
Problem 9: Visualization and WSS Interpretation
Create subplots for:Mean vs time,Variance vs time and Autocorrelation vs lag
for a process X(t), and visually interpret whether the process is WSS.

HOD M.Krishna(Faculty)

You might also like