OBJECTIVES OF THE LAB
This lab aims at the understanding of:
Generating unit impulse and unit step sequences
Basic signal operations
GENERATING UNIT IMPULSE AND UNIT STEP SEQUENCES
Use matlab commands zeros and ones to generate unit impulse and unit step sequences.
Example: Unit Impulse Sequence
n=‐10:10;
% unit impulse x1=[zeros(1,10) 1 zeros(1,10)];
stem(n,x1,'filled'); xlabel('sample #'); ylabel('signal amplitude'); title('Unit impulse'); axis([‐10 10 ‐1 2]);
Example: Unit Step Sequence
n= ‐10:10;
%unit step x1=[zeros(1,10) ones(1,11)];
stem(n,x1,'filled'); xlabel('sample #'); ylabel('signal amplitude'); title('Unit step');
axis([‐10 10 ‐1 2]);
TASK 1
Using ones function, plot the signum sequence over interval ‐10≤n≤10. It can be defined as:
BASIC SIGNAL OPERATIONS
clc clear all close all
n=0:0.002:4;
x=sin(2*pi*1*n);
subplot(2,1,1); plot(n,x,'linewidth',2); title('Original Signal'); xlabel('Time'); ylabel('Signal Amplitude'); axis([‐3 4 ‐1 1]);
grid;
subplot(2,1,2); plot(n‐1,x,'linewidth',2); title('Advanced signal'); xlabel('Time'); ylabel('Signal Amplitude');
axis([‐3 4 ‐1 1]);
grid;
Task 1
Delay the original signal given in above example by 1 sec. Plot both the delayed & original signal on the same figure.
Dostları ilə paylaş: |