How o you work the phase difference between the input and the output of a sine wave?
조회 수: 6 (최근 30일)
이전 댓글 표시
Here is my code:
n = 0:49; % These are the time indices
input = 7*cos(2*pi*0.125*n+pi/3);
input_a = 2*input;
input_b = 8*cos(2*pi*0.25*n);
input_c = input_a + input_b;
b = [5, -5]; % The filter coefficients
y = conv(b,input); % The output signal
y_a = conv(b,input_a);
y_b = conv(b,input_b);
y_c = conv(b,input_c);
subplot(2,2,1);
plot(input, 'b*-'); % Plot the input as a blue line
hold on;
plot(y, 'r.-'); % Plot the output as a red line
hold on;
xlabel('Time'); % Label x axis
ylabel('Amplitude'); % Label y axis
subplot(2,2,2);
plot(input_a, 'b*-'); % Plot the input as a blue line
hold on;
plot(y_a, 'r.-'); % Plot the output as a red line
hold on;
xlabel('Time'); % Label x axis
ylabel('Amplitude'); % Label y axis
subplot(2,2,3);
plot(input_b, 'b*-'); % Plot the input as a blue line
hold on;
plot(y_b, 'r.-'); % Plot the output as a red line
hold on;
xlabel('Time'); % Label x axis
ylabel('Amplitude'); % Label y axis
subplot(2,2,4);
plot(input_c, 'b*-'); % Plot the input as a blue line
hold on;
plot(y_c, 'r.-'); % Plot the output as a red line
hold on;
xlabel('Time'); % Label x axis
ylabel('Amplitude'); % Label y axis
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
How do i work the phase difference between the output of y_b to the input and the phase difference of y_c to the input.
댓글 수: 0
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Axis Labels에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!