Question

Using MATLAB: 1) Create three variables to hold the amplitude, phase shift, and number of cycles...

Using MATLAB:

1) Create three variables to hold the amplitude, phase shift, and number of cycles for your sinusoid.

2) Create a sinusoid that has 100,000 points with the amplitude, phase shift, and number of cycles specified in the variables.

3) Generate three test sinusoids:

Amplitude = 5, Phase = pi/2, cycles = 5

Amplitude = 0.7, Phase = 0, cycles = 10

Amplitude = 8, Phase = -2pi/3, cycles = 4

Can someone help me with the exact formula to type this into MATLAB?

Homework Answers

Answer #1

The code for the above mentioned question is as follows :-

clear all;
t= 0:0.01:1 ; %for creating the time vector for the sinusoid

amp1=5,ph1=pi/2,cyc1=5; %amp stores the amplitude,ph stores phase and cyc stores cycles
amp2=0.7,ph2=0,cyc2=10;
amp3=8,ph3=-(2*pi)/3,cyc3=4;

y1=amp1*sin((2*pi*cyc1*t)+ph1); %sinusoid 1

y2=amp2*sin((2*pi*cyc2*t)+ph2); %sinusoid 2

y3=amp3*sin((2*pi*cyc3*t)+ph3); %sinusoid 3

subplot(2,2,1) %plotting the sinusoids
plot(t,y1)
subplot(2,2,2)
plot(t,y2)
subplot(2,2,3)
plot(t,y3)

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions