You are on page 1of 2

Some questions for the DSP lab evaluation:

1. Signal Representation:

a. Generate and plot a 3 Hz sine wave with a duration of 2 seconds using MATLAB.

b. Plot a cosine wave with a frequency of 1 kHz and amplitude 0.5 over a time
interval of 0 to 5 milliseconds.

2. Create a MATLAB script to demonstrate aliasing by under-sampling a 10 Hz sine wave with


a sampling frequency of 8 Hz and plot the results.

3. Sequence Generation and Plotting:

a. Generate and plot the sequence: x(n) = 2^n for -5 ≤ n ≤ 5 using MATLAB.

b. Write a MATLAB program to plot the sequence y(n) = n^2 - 3n + 4 for -10 ≤ n ≤ 10.

4. Sequence Operations:

a. Perform sequence addition in MATLAB for the sequences:


x(n) = {1, 2, 3, 4, 5} and y(n) = {0, -1, -2, -3, -4}.

b. Calculate and plot the convolution of the sequences:


x(n) = {1, 2, 3} and y(n) = {0, 1, 2} using MATLAB.

5. Decomposition of a Sequence:

a. Generate the sequence x(n) = {1, 2, 3, 4, 5, 6, 7, 8} and calculate its even


component using MATLAB.

b. Calculate the odd component of the sequence x(n) using MATLAB and plot it.

6. Ensemble Average and Error Calculation:

a. Generate a sinusoidal signal s[n] with a frequency of 100 Hz and add Gaussian
noise to it using MATLAB.

b. Perform ensemble averaging for the noisy signal with 50 measurements, and
calculate the Mean Squared Error (MSE) and relative error.

7. Family of Sinusoidal Sequences:

a. Plot a family of sinusoidal sequences given by:


x[n] = 2 * cos(ωo*n) for ωo = 0, π/4, π/2, 3π/4, and π using MATLAB.

b. Calculate the fundamental period of these sinusoidal sequences and provide


theoretical verification.

8. Shifting and Energy Calculation:


a. Explain how to shift a sequence x(n) = {1, 2, 3, 4, 5} by two units to the right in
MATLAB.

b. Determine the energy of the shifted sequence obtained in part (a) using MATLAB.

9. Matrix and Array Operations:

a. Write MATLAB code to create a 3x3 matrix 'X' with various integer values.

b. Subtract a constant value of 10 from all elements of matrix 'X.'

c. Calculate the square root of each element in matrix 'X.'

d. Compute the inverse of matrix 'X.'

e. Check whether the product of 'X' and its inverse provides the identity matrix.

f. Calculate the cube of all elements in matrix 'X.'

g. Concatenate matrix 'X' horizontally and vertically.

10. Array Indexing in MATLAB:

a. Create a 5x5 matrix 'Y' with random values and access the element at position (3,
4).

b. List the elements in the first three rows and the second column of matrix 'Y.'

c. Access all columns in the fourth row of matrix 'Y.'

11. Plot and Subplot Functions in MATLAB:

a. Given vectors 'C' and 'D' (C = [12, 15, 18, 21], D = [3, 4, 5, 6]), write MATLAB code
to display a plot of 'C' vs. 'D.'

b. Repeat the above using the 'stem' function to create a stem plot.

c. Display three plots as described in part (a) and create subplots for those plots
using different vectors.

You might also like