CASE 3: When Amplitudes and Phases of the sinusoids are the same but Frequencies are different.
t=-2:0.01:2;
x1=cos(2*pi*0.5*t); x2=cos(2*pi*1*t); x3=x1+x2; subplot(3,1,1); plot(t,x1,'linewidth',3); grid; ylabel('Amplitude'); xlabel('Time');
title('COS WAVE , AMPLITUDE = 1, FREQ = 0.5 HZ, Phase = 0 RADIAN');
subplot(3,1,2); plot(t,x2,'linewidth',3); grid; ylabel('Amplitude'); xlabel('Time');
title('COS WAVE , AMPLITUDE = 1, FREQ = 1 HZ, Phase = 0 RADIAN');
subplot(3,1,3);
plot(t,x3,'linewidth',3); grid; ylabel('Amplitude'); xlabel('Time');
title('SUM OF THE ABOVE TWO COSINE SIGNALS');
CASE 4: When Amplitudes and Frequencies of the sinusoids are the same but Phases are different
t=-2:0.01:2;
x1=cos(2*pi*0.5*t); x2=cos((2*pi*0.5*t)+1); x3=x1+x2; subplot(3,1,1);
plot(t,x1,'linewidth',3); grid; ylabel('Amplitude');
xlabel('Time');
title('COS WAVE , AMPLITUDE = 1, FREQ = 0.5 HZ, Phase = 0 RADIAN');
subplot(3,1,2); plot(t,x2,'linewidth',3); grid; ylabel('Amplitude'); xlabel('Time');
title('COS WAVE , AMPLITUDE = 1, FREQ = 0.5 HZ, Phase = 1 RADIAN');
subplot(3,1,3); plot(t,x3,'linewidth',3); grid; ylabel('Amplitude'); xlabel('Time');
title('SUM OF THE ABOVE TWO COSINE SIGNALS');
-----------------------------------TASK 04------------------------------------
Write a general program that takes ‘n’ sinusoids from user of same frequency, amplitude, and phase. Plot the individual sinusoids & the resultant using subplot function on same figure. Do perform proper labeling. Note: Take the amplitude, frequency, and phase given in example of case 1. Run the code for different values of n and state the result on paper.
Lab # 7
Dostları ilə paylaş: |