Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Answer the questions on the right through a Matlab code and a plot. % Prob 1.6 Follow Example 1.6 and plot a 2.5 Hz sinewave

image text in transcribedAnswer the questions on the right through a Matlab code and a plot.

% Prob 1.6 Follow Example 1.6 and plot a 2.5 Hz sinewave and a 5 % Hz cosine wave. Make the peak amplitude of both 20. Use a 500 point % array (N = 500) and make the sampling % freqeuncy 250 Hz. Plot the two waveforms in different colors superimposed and lable both axes. Also plot a zero centerline. clear all; close all; fs = 250; % Define the sample frequency N = 500; % Define the total number of points (given) t = (1:N) /fs; % Construct the time vector A = 20; % Sinewave amplitude (given) fp 2.5; % Sinewave frequency (given) fpl = 1.5; % Cosine wave frequency x = A*sin (2*pi*fp*t); % Define the sinewave y = A*cos (2*pi*fp1*t); % Define the sinewave plot(t, x, 'b'); hold on; % Plot sinewave plot(t, y, 'r'); % Plot cosine wave plot([t (1) t(end)], [0 0], 'k') % Plot centerline xlabel('Time (sec)'); % Label time axis ylabel ('Amplitude'); % Label y axis ylim ([-25 25]); % For esthetics % Prob 1.6 Follow Example 1.6 and plot a 2.5 Hz sinewave and a 5 % Hz cosine wave. Make the peak amplitude of both 20. Use a 500 point % array (N = 500) and make the sampling % freqeuncy 250 Hz. Plot the two waveforms in different colors superimposed and lable both axes. Also plot a zero centerline. clear all; close all; fs = 250; % Define the sample frequency N = 500; % Define the total number of points (given) t = (1:N) /fs; % Construct the time vector A = 20; % Sinewave amplitude (given) fp 2.5; % Sinewave frequency (given) fpl = 1.5; % Cosine wave frequency x = A*sin (2*pi*fp*t); % Define the sinewave y = A*cos (2*pi*fp1*t); % Define the sinewave plot(t, x, 'b'); hold on; % Plot sinewave plot(t, y, 'r'); % Plot cosine wave plot([t (1) t(end)], [0 0], 'k') % Plot centerline xlabel('Time (sec)'); % Label time axis ylabel ('Amplitude'); % Label y axis ylim ([-25 25]); % For esthetics

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data, Mining, And Analytics Components Of Strategic Decision Making

Authors: Stephan Kudyba

1st Edition

1466568704, 9781466568709

More Books

Students also viewed these Databases questions