HWsolution #5

# HWsolution #5 - %Engineering 6 Spring 2004 Problem 5.1...

This preview shows pages 1–3. Sign up to view the full content.

%Engineering 6, Spring 2004, Problem 5.1 Solution %(Sinusoidal signals and mechanical vibration) %Suppress extra lines in output and set fixed short display format compact; format short; clc; %Clear command window clf; %Clear figure window %Part (a) %Do calculations for signal x1(t) w1 = 0.9*pi; %Calculate angular freq f1 = w1/(2*pi); %Regular freq T1 = 1/f1; %Period X1 = 3.4*exp(-j*pi/3); %Phasor disp( 'Angular frequency for x1(t) is:' ); disp(w1); disp( 'Regular frequency for x1(t) is:' ); disp(f1); disp( 'Period for x1(t) is:' ); disp(T1); disp( 'Phasor for x1(t) is:' ); disp(X1); disp( ' ' ); %Blank line %Do calculations for signal x2(t) w2 = 0.5*pi; %Calculate angular freq f2 = w2/(2*pi); %Regular freq T2 = 1/f2; %Period X2 = 2.7*exp(0); %Phasor disp( 'Angular frequency for s2(t) is:' ); disp(w2); disp( 'Regular frequency for s2(t) is:' ); disp(f2); disp( 'Period for s2(t) is:' ); disp(T2); disp( 'Phasor for s2(t) is:' ); disp(X2); %Define time vectors of 425 values from 0 to 5T %for signals 1 and 2 t1 = linspace(0,5*T1,425); t2 = linspace(0,5*T2,425); %Calculate values for signals s1 = 3.4*cos(0.9*pi*t1 - pi/3); s2 = 2.7*cos(0.5*pi*t2); %Plot the two signals in same figure window figure(1); plot(t1,s1,t2,s2),xlabel( 'Time' ),ylabel( 'Signal' ), ... title( 'Two sinusoidal signals' ),legend( 'x1' , 'x2' );

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
%Part (b) figure(2); %Specify a second figure window %First subplot (A = 0.25) %(Use same time values as for x1 above) d = 8*exp(-0.25*t1).*cos(0.8*pi*t1 - pi/4); subplot(2,1,1), plot(t1,d), ... title( 'Mechanical vibration, A = 0.25' ), ... xlabel( 'Time' ),ylabel( 'Signal' ); %Second subplot (A = 0.75) d = 8*exp(-0.75*t1).*cos(0.8*pi*t1 - pi/4); subplot(2,1,2), plot(t1,d), ...
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 01/22/2011 for the course ENG 006 taught by Professor Lagerstrom during the Spring '06 term at UC Davis.

### Page1 / 7

HWsolution #5 - %Engineering 6 Spring 2004 Problem 5.1...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online