Q1.40 The information displayed in the command window as a result of the whos command is -
1.4 OTHER TYPES OF SIGNALS (Optional)
Project 1.8 Squarewave and Sawtooth Signals
Answer:
Q1.41 MATLAB programs to generate the square-wave and the sawtooth wave sequences of the type shown in Figures 1.1 and 1.2 are given below along with the sequences generated by running these programs:
% Program P1_4
% Generation of a sinusoidal sequence
n = 0:30;
f = 0.1;
phase = 0;
A = 2.5;
arg = 2*pi*f*n - phase;
x = A*square(arg,60);
clf; % Clear old graph
stem(n,x); % Plot the generated sequence
axis([0 30 -3 3]);
grid;
title('Sinusoidal Sequence');
xlabel('Time index n');
ylabel('Amplitude');
axis;
% Program P1_4
% Generation of a sinusoidal sequence
n = 0:30;
f = 0.1;
phase = 0;
A = 2.5;
arg = 2*pi*f*n - phase;
x = A*square(arg,30);
clf; % Clear old graph
stem(n,x); % Plot the generated sequence
axis([0 30 -3 3]);
grid;
title('Sinusoidal Sequence');
xlabel('Time index n');
ylabel('Amplitude');
axis;
Date: Signature:
Chia sẻ với bạn bè của bạn: |