0% found this document useful (0 votes)
14 views3 pages

Abdl Waab Assesment 1 DSP

The document contains MATLAB code for generating and plotting discrete signals with different parameters for two questions. Q1 generates a signal with a frequency of 0.1 Hz and amplitude of 1.5, while Q2 generates a signal with a frequency of 0.2 Hz and amplitude of 2.5. Key parameters such as time variable, phase offset, and signal length are also provided.

Uploaded by

zimalabdi
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)
14 views3 pages

Abdl Waab Assesment 1 DSP

The document contains MATLAB code for generating and plotting discrete signals with different parameters for two questions. Q1 generates a signal with a frequency of 0.1 Hz and amplitude of 1.5, while Q2 generates a signal with a frequency of 0.2 Hz and amplitude of 2.5. Key parameters such as time variable, phase offset, and signal length are also provided.

Uploaded by

zimalabdi
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/ 3

.

Name
ABDUL WAHAB

Registration Number FA20-BEE-010

Instructor’s Name Dr. Fawad


Zaman

Q1:

Code:
clc;
close all;
clear all;
n = 0:40; % vales of time variable
w = 0.1*2*pi; % frequency of the sinusoid
phi = 0; % phase offset
A = 1.5; % Amplitude
Xn = A*cos(w*n-phi); % Discrete Signal
a = length(Xn); % Length of Signal on
stem(n,Xn); % Command to show graph of Signal
axis([0 a -3 3]); % define axis
title('Discrete Signal')
xlabel('n')
ylabel('Xn')

Q2

Code:
clc;
close all;
clear all;
n = 0:50; % vales of time variable
w = 0.4*2*pi; % frequency of the sinusoid
phi = 90; % phase offset
A = 2.5; % Amplitude
Xn = A*cos(w*n-phi); % Discrete Signal
a = length(Xn); % Length of Signal on
stem(n,Xn); % Command to show graph of Signal
axis([0 a -3 3]); % define axis
title('Discrete Signal')
xlabel('n')
ylabel('Xn')

Q1 Q2
T = 10s T = 5sec
a = 41 a = 51
F = 0.1Hz F = 0.2Hz

You might also like